Skip to content

Commit b77b683

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 8872c41 commit b77b683

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
@@ -422,11 +422,19 @@ buffer_from_host(struct vchiq_mmal_instance *instance,
422422
m.u.buffer_from_host.buffer_header.data =
423423
(u32)(unsigned long)buf->buffer;
424424
m.u.buffer_from_host.buffer_header.alloc_size = buf->buffer_size;
425-
m.u.buffer_from_host.buffer_header.length = 0; /* nothing used yet */
426-
m.u.buffer_from_host.buffer_header.offset = 0; /* no offset */
427-
m.u.buffer_from_host.buffer_header.flags = 0; /* no flags */
428-
m.u.buffer_from_host.buffer_header.pts = MMAL_TIME_UNKNOWN;
429-
m.u.buffer_from_host.buffer_header.dts = MMAL_TIME_UNKNOWN;
425+
if (port->type == MMAL_PORT_TYPE_OUTPUT) {
426+
m.u.buffer_from_host.buffer_header.length = 0;
427+
m.u.buffer_from_host.buffer_header.offset = 0;
428+
m.u.buffer_from_host.buffer_header.flags = 0;
429+
m.u.buffer_from_host.buffer_header.pts = MMAL_TIME_UNKNOWN;
430+
m.u.buffer_from_host.buffer_header.dts = MMAL_TIME_UNKNOWN;
431+
} else {
432+
m.u.buffer_from_host.buffer_header.length = buf->length;
433+
m.u.buffer_from_host.buffer_header.offset = 0;
434+
m.u.buffer_from_host.buffer_header.flags = buf->mmal_flags;
435+
m.u.buffer_from_host.buffer_header.pts = buf->pts;
436+
m.u.buffer_from_host.buffer_header.dts = buf->dts;
437+
}
430438

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

0 commit comments

Comments
 (0)