linux/drivers/media/platform/amphion/vdec.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/vmalloc.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_defs.h"
#include "vpu_core.h"
#include "vpu_helpers.h"
#include "vpu_v4l2.h"
#include "vpu_cmds.h"
#include "vpu_rpc.h"

#define VDEC_MIN_BUFFER_CAP
#define VDEC_MIN_BUFFER_OUT

struct vdec_fs_info {};

struct vdec_t {};

static const struct vpu_format vdec_formats[] =;

static int vdec_op_s_ctrl(struct v4l2_ctrl *ctrl)
{}

static const struct v4l2_ctrl_ops vdec_ctrl_ops =;

static int vdec_ctrl_init(struct vpu_inst *inst)
{}

static void vdec_handle_resolution_change(struct vpu_inst *inst)
{}

static int vdec_update_state(struct vpu_inst *inst, enum vpu_codec_state state, u32 force)
{}

static void vdec_set_last_buffer_dequeued(struct vpu_inst *inst)
{}

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

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

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

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

static int vdec_s_fmt_common(struct vpu_inst *inst, struct v4l2_format *f)
{}

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

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

static int vdec_drain(struct vpu_inst *inst)
{}

static int vdec_cmd_start(struct vpu_inst *inst)
{}

static int vdec_cmd_stop(struct vpu_inst *inst)
{}

static int vdec_decoder_cmd(struct file *file, void *fh, struct v4l2_decoder_cmd *cmd)
{}

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

static const struct v4l2_ioctl_ops vdec_ioctl_ops =;

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

static struct vb2_v4l2_buffer *vdec_get_src_buffer(struct vpu_inst *inst, u32 count)
{}

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

static struct vpu_vb2_buffer *vdec_find_buffer(struct vpu_inst *inst, u32 luma)
{}

static void vdec_buf_done(struct vpu_inst *inst, struct vpu_frame_info *frame)
{}

static void vdec_stop_done(struct vpu_inst *inst)
{}

static bool vdec_check_source_change(struct vpu_inst *inst)
{}

static void vdec_init_fmt(struct vpu_inst *inst)
{}

static void vdec_init_crop(struct vpu_inst *inst)
{}

static void vdec_init_mbi(struct vpu_inst *inst)
{}

static void vdec_init_dcp(struct vpu_inst *inst)
{}

static void vdec_request_one_fs(struct vdec_fs_info *fs)
{}

static int vdec_alloc_fs_buffer(struct vpu_inst *inst, struct vdec_fs_info *fs)
{}

static void vdec_alloc_fs(struct vpu_inst *inst, struct vdec_fs_info *fs)
{}

static void vdec_clear_fs(struct vdec_fs_info *fs)
{}

static int vdec_response_fs(struct vpu_inst *inst, struct vdec_fs_info *fs)
{}

static int vdec_response_frame_abnormal(struct vpu_inst *inst)
{}

static int vdec_response_frame(struct vpu_inst *inst, struct vb2_v4l2_buffer *vbuf)
{}

static void vdec_response_fs_request(struct vpu_inst *inst, bool force)
{}

static void vdec_response_fs_release(struct vpu_inst *inst, u32 id, u32 tag)
{}

static void vdec_recycle_buffer(struct vpu_inst *inst, struct vb2_v4l2_buffer *vbuf)
{}

static void vdec_clear_slots(struct vpu_inst *inst)
{}

static void vdec_event_seq_hdr(struct vpu_inst *inst, struct vpu_dec_codec_info *hdr)
{}

static void vdec_event_resolution_change(struct vpu_inst *inst)
{}

static void vdec_event_req_fs(struct vpu_inst *inst, struct vpu_fs_info *fs)
{}

static void vdec_evnet_rel_fs(struct vpu_inst *inst, struct vpu_fs_info *fs)
{}

static void vdec_event_eos(struct vpu_inst *inst)
{}

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

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

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

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

static void vdec_abort(struct vpu_inst *inst)
{}

static void vdec_stop(struct vpu_inst *inst, bool free)
{}

static void vdec_release(struct vpu_inst *inst)
{}

static void vdec_cleanup(struct vpu_inst *inst)
{}

static void vdec_init_params(struct vdec_t *vdec)
{}

static int vdec_start(struct vpu_inst *inst)
{}

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

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

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

static struct vpu_inst_ops vdec_inst_ops =;

static void vdec_init(struct file *file)
{}

static int vdec_open(struct file *file)
{}

static const struct v4l2_file_operations vdec_fops =;

const struct v4l2_ioctl_ops *vdec_get_ioctl_ops(void)
{}

const struct v4l2_file_operations *vdec_get_fops(void)
{}