linux/drivers/media/platform/amphion/venc.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Copyright 2020-2021 NXP
 */

#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/delay.h>
#include <linux/videodev2.h>
#include <linux/ktime.h>
#include <linux/rational.h>
#include <linux/vmalloc.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_defs.h"
#include "vpu_core.h"
#include "vpu_helpers.h"
#include "vpu_v4l2.h"
#include "vpu_cmds.h"
#include "vpu_rpc.h"

#define VENC_OUTPUT_ENABLE
#define VENC_CAPTURE_ENABLE
#define VENC_ENABLE_MASK
#define VENC_MAX_BUF_CNT
#define VENC_MIN_BUFFER_OUT
#define VENC_MIN_BUFFER_CAP

struct venc_t {};

struct venc_frame_t {};

static const struct vpu_format venc_formats[] =;

static int venc_querycap(struct file *file, void *fh, struct v4l2_capability *cap)
{}

static int venc_enum_fmt(struct file *file, void *fh, struct v4l2_fmtdesc *f)
{}

static int venc_enum_framesizes(struct file *file, void *fh, struct v4l2_frmsizeenum *fsize)
{}

static int venc_enum_frameintervals(struct file *file, void *fh, struct v4l2_frmivalenum *fival)
{}

static int venc_g_fmt(struct file *file, void *fh, struct v4l2_format *f)
{}

static int venc_try_fmt(struct file *file, void *fh, struct v4l2_format *f)
{}

static int venc_s_fmt(struct file *file, void *fh, struct v4l2_format *f)
{}

static int venc_g_parm(struct file *file, void *fh, struct v4l2_streamparm *parm)
{}

static int venc_s_parm(struct file *file, void *fh, struct v4l2_streamparm *parm)
{}

static int venc_g_selection(struct file *file, void *fh, struct v4l2_selection *s)
{}

static int venc_valid_crop(struct venc_t *venc, const struct vpu_core_resources *res)
{}

static int venc_s_selection(struct file *file, void *fh, struct v4l2_selection *s)
{}

static int venc_drain(struct vpu_inst *inst)
{}

static int venc_request_eos(struct vpu_inst *inst)
{}

static int venc_encoder_cmd(struct file *file, void *fh, struct v4l2_encoder_cmd *cmd)
{}

static int venc_subscribe_event(struct v4l2_fh *fh, const struct v4l2_event_subscription *sub)
{}

static const struct v4l2_ioctl_ops venc_ioctl_ops =;

static int venc_op_s_ctrl(struct v4l2_ctrl *ctrl)
{}

static const struct v4l2_ctrl_ops venc_ctrl_ops =;

static int venc_ctrl_init(struct vpu_inst *inst)
{}

static bool venc_check_ready(struct vpu_inst *inst, unsigned int type)
{}

static u32 venc_get_enable_mask(u32 type)
{}

static void venc_set_enable(struct venc_t *venc, u32 type, int enable)
{}

static u32 venc_get_enable(struct venc_t *venc, u32 type)
{}

static void venc_input_done(struct vpu_inst *inst)
{}

/*
 * It's hardware limitation, that there may be several bytes
 * redundant data at the beginning of frame.
 * For android platform, the redundant data may cause cts test fail
 * So driver will strip them
 */
static int venc_precheck_encoded_frame(struct vpu_inst *inst, struct venc_frame_t *frame)
{}

static int venc_get_one_encoded_frame(struct vpu_inst *inst,
				      struct venc_frame_t *frame,
				      struct vb2_v4l2_buffer *vbuf)
{}

static int venc_get_encoded_frames(struct vpu_inst *inst)
{}

static int venc_frame_encoded(struct vpu_inst *inst, void *arg)
{}

static void venc_set_last_buffer_dequeued(struct vpu_inst *inst)
{}

static void venc_stop_done(struct vpu_inst *inst)
{}

static void venc_event_notify(struct vpu_inst *inst, u32 event, void *data)
{}

static void venc_release(struct vpu_inst *inst)
{}

static void venc_cleanup(struct vpu_inst *inst)
{}

static int venc_start_session(struct vpu_inst *inst, u32 type)
{}

static void venc_cleanup_mem_resource(struct vpu_inst *inst)
{}

static void venc_request_mem_resource(struct vpu_inst *inst,
				      u32 enc_frame_size,
				      u32 enc_frame_num,
				      u32 ref_frame_size,
				      u32 ref_frame_num,
				      u32 act_frame_size,
				      u32 act_frame_num)
{}

static void venc_cleanup_frames(struct venc_t *venc)
{}

static int venc_stop_session(struct vpu_inst *inst, u32 type)
{}

static int venc_process_output(struct vpu_inst *inst, struct vb2_buffer *vb)
{}

static int venc_process_capture(struct vpu_inst *inst, struct vb2_buffer *vb)
{}

static void venc_on_queue_empty(struct vpu_inst *inst, u32 type)
{}

static int venc_get_debug_info(struct vpu_inst *inst, char *str, u32 size, u32 i)
{}

static struct vpu_inst_ops venc_inst_ops =;

static void venc_init(struct file *file)
{}

static int venc_open(struct file *file)
{}

static const struct v4l2_file_operations venc_fops =;

const struct v4l2_ioctl_ops *venc_get_ioctl_ops(void)
{}

const struct v4l2_file_operations *venc_get_fops(void)
{}