#define pr_fmt(fmt) …
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/mm.h>
#include <linux/slab.h>
#include <linux/completion.h>
#include <linux/vmalloc.h>
#include <media/videobuf2-vmalloc.h>
#include "../include/linux/raspberrypi/vchiq.h"
#include "../interface/vchiq_arm/vchiq_arm.h"
#include "mmal-common.h"
#include "mmal-vchiq.h"
#include "mmal-msg.h"
#define VCHIQ_MMAL_MAX_COMPONENTS …
#define SYNC_MSG_TIMEOUT …
#ifdef DEBUG
static const char *const msg_type_names[] = {
"UNKNOWN",
"QUIT",
"SERVICE_CLOSED",
"GET_VERSION",
"COMPONENT_CREATE",
"COMPONENT_DESTROY",
"COMPONENT_ENABLE",
"COMPONENT_DISABLE",
"PORT_INFO_GET",
"PORT_INFO_SET",
"PORT_ACTION",
"BUFFER_FROM_HOST",
"BUFFER_TO_HOST",
"GET_STATS",
"PORT_PARAMETER_SET",
"PORT_PARAMETER_GET",
"EVENT_TO_HOST",
"GET_CORE_STATS_FOR_PORT",
"OPAQUE_ALLOCATOR",
"CONSUME_MEM",
"LMK",
"OPAQUE_ALLOCATOR_DESC",
"DRM_GET_LHS32",
"DRM_GET_TIME",
"BUFFER_FROM_HOST_ZEROLEN",
"PORT_FLUSH",
"HOST_LOG",
};
#endif
static const char *const port_action_type_names[] = …;
#if defined(DEBUG)
#if defined(FULL_MSG_DUMP)
#define DBG_DUMP_MSG …
#else
#define DBG_DUMP_MSG …
#endif
#else
#define DBG_DUMP_MSG(MSG, MSG_LEN, TITLE) …
#endif
struct vchiq_mmal_instance;
struct mmal_msg_context { … };
struct vchiq_mmal_instance { … };
static struct mmal_msg_context *
get_msg_context(struct vchiq_mmal_instance *instance)
{ … }
static struct mmal_msg_context *
lookup_msg_context(struct vchiq_mmal_instance *instance, int handle)
{ … }
static void
release_msg_context(struct mmal_msg_context *msg_context)
{ … }
static void event_to_host_cb(struct vchiq_mmal_instance *instance,
struct mmal_msg *msg, u32 msg_len)
{ … }
static void buffer_work_cb(struct work_struct *work)
{ … }
static void buffer_to_host_work_cb(struct work_struct *work)
{ … }
static int bulk_receive(struct vchiq_mmal_instance *instance,
struct mmal_msg *msg,
struct mmal_msg_context *msg_context)
{ … }
static int inline_receive(struct vchiq_mmal_instance *instance,
struct mmal_msg *msg,
struct mmal_msg_context *msg_context)
{ … }
static int
buffer_from_host(struct vchiq_mmal_instance *instance,
struct vchiq_mmal_port *port, struct mmal_buffer *buf)
{ … }
static void buffer_to_host_cb(struct vchiq_mmal_instance *instance,
struct mmal_msg *msg, u32 msg_len)
{ … }
static void bulk_receive_cb(struct vchiq_mmal_instance *instance,
struct mmal_msg_context *msg_context)
{ … }
static void bulk_abort_cb(struct vchiq_mmal_instance *instance,
struct mmal_msg_context *msg_context)
{ … }
static int mmal_service_callback(struct vchiq_instance *vchiq_instance,
enum vchiq_reason reason, struct vchiq_header *header,
unsigned int handle, void *bulk_ctx)
{ … }
static int send_synchronous_mmal_msg(struct vchiq_mmal_instance *instance,
struct mmal_msg *msg,
unsigned int payload_len,
struct mmal_msg **msg_out,
struct vchiq_header **msg_handle)
{ … }
static void dump_port_info(struct vchiq_mmal_port *port)
{ … }
static void port_to_mmal_msg(struct vchiq_mmal_port *port, struct mmal_port *p)
{ … }
static int port_info_set(struct vchiq_mmal_instance *instance,
struct vchiq_mmal_port *port)
{ … }
static int port_info_get(struct vchiq_mmal_instance *instance,
struct vchiq_mmal_port *port)
{ … }
static int create_component(struct vchiq_mmal_instance *instance,
struct vchiq_mmal_component *component,
const char *name)
{ … }
static int destroy_component(struct vchiq_mmal_instance *instance,
struct vchiq_mmal_component *component)
{ … }
static int enable_component(struct vchiq_mmal_instance *instance,
struct vchiq_mmal_component *component)
{ … }
static int disable_component(struct vchiq_mmal_instance *instance,
struct vchiq_mmal_component *component)
{ … }
static int get_version(struct vchiq_mmal_instance *instance,
u32 *major_out, u32 *minor_out)
{ … }
static int port_action_port(struct vchiq_mmal_instance *instance,
struct vchiq_mmal_port *port,
enum mmal_msg_port_action_type action_type)
{ … }
static int port_action_handle(struct vchiq_mmal_instance *instance,
struct vchiq_mmal_port *port,
enum mmal_msg_port_action_type action_type,
u32 connect_component_handle,
u32 connect_port_handle)
{ … }
static int port_parameter_set(struct vchiq_mmal_instance *instance,
struct vchiq_mmal_port *port,
u32 parameter_id, void *value, u32 value_size)
{ … }
static int port_parameter_get(struct vchiq_mmal_instance *instance,
struct vchiq_mmal_port *port,
u32 parameter_id, void *value, u32 *value_size)
{ … }
static int port_disable(struct vchiq_mmal_instance *instance,
struct vchiq_mmal_port *port)
{ … }
static int port_enable(struct vchiq_mmal_instance *instance,
struct vchiq_mmal_port *port)
{ … }
int vchiq_mmal_port_set_format(struct vchiq_mmal_instance *instance,
struct vchiq_mmal_port *port)
{ … }
EXPORT_SYMBOL_GPL(…);
int vchiq_mmal_port_parameter_set(struct vchiq_mmal_instance *instance,
struct vchiq_mmal_port *port,
u32 parameter, void *value, u32 value_size)
{ … }
EXPORT_SYMBOL_GPL(…);
int vchiq_mmal_port_parameter_get(struct vchiq_mmal_instance *instance,
struct vchiq_mmal_port *port,
u32 parameter, void *value, u32 *value_size)
{ … }
EXPORT_SYMBOL_GPL(…);
int vchiq_mmal_port_enable(struct vchiq_mmal_instance *instance,
struct vchiq_mmal_port *port,
vchiq_mmal_buffer_cb buffer_cb)
{ … }
EXPORT_SYMBOL_GPL(…);
int vchiq_mmal_port_disable(struct vchiq_mmal_instance *instance,
struct vchiq_mmal_port *port)
{ … }
EXPORT_SYMBOL_GPL(…);
int vchiq_mmal_port_connect_tunnel(struct vchiq_mmal_instance *instance,
struct vchiq_mmal_port *src,
struct vchiq_mmal_port *dst)
{ … }
EXPORT_SYMBOL_GPL(…);
int vchiq_mmal_submit_buffer(struct vchiq_mmal_instance *instance,
struct vchiq_mmal_port *port,
struct mmal_buffer *buffer)
{ … }
EXPORT_SYMBOL_GPL(…);
int mmal_vchi_buffer_init(struct vchiq_mmal_instance *instance,
struct mmal_buffer *buf)
{ … }
EXPORT_SYMBOL_GPL(…);
int mmal_vchi_buffer_cleanup(struct mmal_buffer *buf)
{ … }
EXPORT_SYMBOL_GPL(…);
int vchiq_mmal_component_init(struct vchiq_mmal_instance *instance,
const char *name,
struct vchiq_mmal_component **component_out)
{ … }
EXPORT_SYMBOL_GPL(…);
int vchiq_mmal_component_finalise(struct vchiq_mmal_instance *instance,
struct vchiq_mmal_component *component)
{ … }
EXPORT_SYMBOL_GPL(…);
int vchiq_mmal_component_enable(struct vchiq_mmal_instance *instance,
struct vchiq_mmal_component *component)
{ … }
EXPORT_SYMBOL_GPL(…);
int vchiq_mmal_component_disable(struct vchiq_mmal_instance *instance,
struct vchiq_mmal_component *component)
{ … }
EXPORT_SYMBOL_GPL(…);
int vchiq_mmal_version(struct vchiq_mmal_instance *instance,
u32 *major_out, u32 *minor_out)
{ … }
EXPORT_SYMBOL_GPL(…);
int vchiq_mmal_finalise(struct vchiq_mmal_instance *instance)
{ … }
EXPORT_SYMBOL_GPL(…);
int vchiq_mmal_init(struct device *dev, struct vchiq_mmal_instance **out_instance)
{ … }
EXPORT_SYMBOL_GPL(…);
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;