Skip to content

Commit cd79d36

Browse files
6by9popcornmix
authored andcommitted
staging: vc04_services: Support sending data to MMAL ports
Add the ability to send data to ports. This only supports zero copy mode as the required bulk transfer setup calls are not done. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
1 parent 6be8173 commit cd79d36

1 file changed

Lines changed: 13 additions & 5 deletions

File tree

‎drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c‎

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -427,11 +427,19 @@ buffer_from_host(struct vchiq_mmal_instance *instance,
427427
m.u.buffer_from_host.buffer_header.data =
428428
(u32)(unsigned long)buf->buffer;
429429
m.u.buffer_from_host.buffer_header.alloc_size = buf->buffer_size;
430-
m.u.buffer_from_host.buffer_header.length = 0; /* nothing used yet */
431-
m.u.buffer_from_host.buffer_header.offset = 0; /* no offset */
432-
m.u.buffer_from_host.buffer_header.flags = 0; /* no flags */
433-
m.u.buffer_from_host.buffer_header.pts = MMAL_TIME_UNKNOWN;
434-
m.u.buffer_from_host.buffer_header.dts = MMAL_TIME_UNKNOWN;
430+
if (port->type == MMAL_PORT_TYPE_OUTPUT) {
431+
m.u.buffer_from_host.buffer_header.length = 0;
432+
m.u.buffer_from_host.buffer_header.offset = 0;
433+
m.u.buffer_from_host.buffer_header.flags = 0;
434+
m.u.buffer_from_host.buffer_header.pts = MMAL_TIME_UNKNOWN;
435+
m.u.buffer_from_host.buffer_header.dts = MMAL_TIME_UNKNOWN;
436+
} else {
437+
m.u.buffer_from_host.buffer_header.length = buf->length;
438+
m.u.buffer_from_host.buffer_header.offset = 0;
439+
m.u.buffer_from_host.buffer_header.flags = buf->mmal_flags;
440+
m.u.buffer_from_host.buffer_header.pts = buf->pts;
441+
m.u.buffer_from_host.buffer_header.dts = buf->dts;
442+
}
435443

436444
/* clear buffer type sepecific data */
437445
memset(&m.u.buffer_from_host.buffer_header_type_specific, 0,

0 commit comments

Comments
 (0)