#include <linux/init.h>
#include <linux/interconnect.h>
#include <linux/ioctl.h>
#include <linux/list.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/pm_runtime.h>
#include <linux/videodev2.h>
#include <media/v4l2-device.h>
#include <media/v4l2-event.h>
#include <media/v4l2-mem2mem.h>
#include <media/v4l2-ioctl.h>
#include <media/videobuf2-v4l2.h>
#include <media/videobuf2-dma-contig.h>
#include <media/videobuf2-vmalloc.h>
#include "vpu.h"
#include "vpu_core.h"
#include "vpu_v4l2.h"
#include "vpu_msgs.h"
#include "vpu_helpers.h"
void vpu_inst_lock(struct vpu_inst *inst)
{ … }
void vpu_inst_unlock(struct vpu_inst *inst)
{ … }
dma_addr_t vpu_get_vb_phy_addr(struct vb2_buffer *vb, u32 plane_no)
{ … }
unsigned int vpu_get_vb_length(struct vb2_buffer *vb, u32 plane_no)
{ … }
void vpu_set_buffer_state(struct vb2_v4l2_buffer *vbuf, unsigned int state)
{ … }
unsigned int vpu_get_buffer_state(struct vb2_v4l2_buffer *vbuf)
{ … }
void vpu_set_buffer_average_qp(struct vb2_v4l2_buffer *vbuf, u32 qp)
{ … }
void vpu_v4l2_set_error(struct vpu_inst *inst)
{ … }
int vpu_notify_eos(struct vpu_inst *inst)
{ … }
int vpu_notify_source_change(struct vpu_inst *inst)
{ … }
int vpu_set_last_buffer_dequeued(struct vpu_inst *inst, bool eos)
{ … }
bool vpu_is_source_empty(struct vpu_inst *inst)
{ … }
static int vpu_init_format(struct vpu_inst *inst, struct vpu_format *fmt)
{ … }
static int vpu_calc_fmt_bytesperline(struct v4l2_format *f, struct vpu_format *fmt)
{ … }
static int vpu_calc_fmt_sizeimage(struct vpu_inst *inst, struct vpu_format *fmt)
{ … }
u32 vpu_get_fmt_plane_size(struct vpu_format *fmt, u32 plane_no)
{ … }
int vpu_try_fmt_common(struct vpu_inst *inst, struct v4l2_format *f, struct vpu_format *fmt)
{ … }
static bool vpu_check_ready(struct vpu_inst *inst, u32 type)
{ … }
int vpu_process_output_buffer(struct vpu_inst *inst)
{ … }
int vpu_process_capture_buffer(struct vpu_inst *inst)
{ … }
struct vb2_v4l2_buffer *vpu_next_src_buf(struct vpu_inst *inst)
{ … }
void vpu_skip_frame(struct vpu_inst *inst, int count)
{ … }
struct vb2_v4l2_buffer *vpu_find_buf_by_sequence(struct vpu_inst *inst, u32 type, u32 sequence)
{ … }
struct vb2_v4l2_buffer *vpu_find_buf_by_idx(struct vpu_inst *inst, u32 type, u32 idx)
{ … }
int vpu_get_num_buffers(struct vpu_inst *inst, u32 type)
{ … }
static void vpu_m2m_device_run(void *priv)
{ … }
static void vpu_m2m_job_abort(void *priv)
{ … }
static const struct v4l2_m2m_ops vpu_m2m_ops = …;
static int vpu_vb2_queue_setup(struct vb2_queue *vq,
unsigned int *buf_count,
unsigned int *plane_count,
unsigned int psize[],
struct device *allocators[])
{ … }
static int vpu_vb2_buf_init(struct vb2_buffer *vb)
{ … }
static int vpu_vb2_buf_out_validate(struct vb2_buffer *vb)
{ … }
static int vpu_vb2_buf_prepare(struct vb2_buffer *vb)
{ … }
static void vpu_vb2_buf_finish(struct vb2_buffer *vb)
{ … }
void vpu_vb2_buffers_return(struct vpu_inst *inst, unsigned int type, enum vb2_buffer_state state)
{ … }
static int vpu_vb2_start_streaming(struct vb2_queue *q, unsigned int count)
{ … }
static void vpu_vb2_stop_streaming(struct vb2_queue *q)
{ … }
static void vpu_vb2_buf_queue(struct vb2_buffer *vb)
{ … }
static const struct vb2_ops vpu_vb2_ops = …;
static int vpu_m2m_queue_init(void *priv, struct vb2_queue *src_vq, struct vb2_queue *dst_vq)
{ … }
static int vpu_v4l2_release(struct vpu_inst *inst)
{ … }
int vpu_v4l2_open(struct file *file, struct vpu_inst *inst)
{ … }
int vpu_v4l2_close(struct file *file)
{ … }
int vpu_add_func(struct vpu_dev *vpu, struct vpu_func *func)
{ … }
void vpu_remove_func(struct vpu_func *func)
{ … }