linux/drivers/media/platform/amphion/vpu_windsor.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/platform_device.h>
#include <linux/time64.h>
#include <media/videobuf2-v4l2.h>
#include <media/videobuf2-dma-contig.h>
#include "vpu.h"
#include "vpu_rpc.h"
#include "vpu_defs.h"
#include "vpu_helpers.h"
#include "vpu_cmds.h"
#include "vpu_v4l2.h"
#include "vpu_imx8q.h"
#include "vpu_windsor.h"

#define CMD_SIZE
#define MSG_SIZE
#define WINDSOR_USER_DATA_WORDS
#define WINDSOR_MAX_SRC_FRAMES
#define WINDSOR_MAX_REF_FRAMES
#define WINDSOR_BITRATE_UNIT
#define WINDSOR_H264_EXTENDED_SAR

enum {};

enum {};

enum {};

struct windsor_iface {};

struct windsor_ctrl_iface {};

struct vpu_enc_yuv_desc {};

struct vpu_enc_calib_params {};

struct vpu_enc_config_params {};

struct vpu_enc_static_params {};

struct vpu_enc_dynamic_params {};

struct vpu_enc_expert_mode_param {};

enum MEDIAIP_ENC_FMT {};

enum MEDIAIP_ENC_PROFILE {};

enum MEDIAIP_ENC_BITRATE_MODE {};

struct vpu_enc_memory_resource {};

struct vpu_enc_param {};

struct vpu_enc_mem_pool {};

struct vpu_enc_encoding_status {};

struct vpu_enc_dsa_status {};

struct vpu_enc_ctrl {};

struct vpu_enc_host_ctrls {};

struct windsor_pic_info {};

u32 vpu_windsor_get_data_size(void)
{}

static struct vpu_enc_yuv_desc *get_yuv_desc(struct vpu_shared_addr *shared,
					     u32 instance)
{}

static struct vpu_enc_mem_pool *get_mem_pool(struct vpu_shared_addr *shared,
					     u32 instance)
{}

static struct vpu_rpc_buffer_desc *get_stream_buf_desc(struct vpu_shared_addr *shared,
						       u32 instance)
{}

static struct vpu_enc_expert_mode_param *get_expert_param(struct vpu_shared_addr *shared,
							  u32 instance)
{}

static struct vpu_enc_param *get_enc_param(struct vpu_shared_addr *shared, u32 instance)
{}

static u32 get_ptr(u32 ptr)
{}

void vpu_windsor_init_rpc(struct vpu_shared_addr *shared,
			  struct vpu_buffer *rpc, dma_addr_t boot_addr)
{}

void vpu_windsor_set_log_buf(struct vpu_shared_addr *shared, struct vpu_buffer *log)
{}

void vpu_windsor_set_system_cfg(struct vpu_shared_addr *shared,
				u32 regs_base, void __iomem *regs, u32 core_id)
{}

int vpu_windsor_get_stream_buffer_size(struct vpu_shared_addr *shared)
{}

static struct vpu_pair windsor_cmds[] =;

static struct vpu_pair windsor_msgs[] =;

int vpu_windsor_pack_cmd(struct vpu_rpc_event *pkt, u32 index, u32 id, void *data)
{}

int vpu_windsor_convert_msg_id(u32 id)
{}

static void vpu_windsor_unpack_pic_info(struct vpu_rpc_event *pkt, void *data)
{}

static void vpu_windsor_unpack_mem_req(struct vpu_rpc_event *pkt, void *data)
{}

int vpu_windsor_unpack_msg_data(struct vpu_rpc_event *pkt, void *data)
{}

static int vpu_windsor_fill_yuv_frame(struct vpu_shared_addr *shared,
				      u32 instance,
				      struct vb2_buffer *vb)
{}

int vpu_windsor_input_frame(struct vpu_shared_addr *shared,
			    struct vpu_inst *inst, struct vb2_buffer *vb)
{}

int vpu_windsor_config_memory_resource(struct vpu_shared_addr *shared,
				       u32 instance,
				       u32 type,
				       u32 index,
				       struct vpu_buffer *buf)
{}

int vpu_windsor_config_stream_buffer(struct vpu_shared_addr *shared,
				     u32 instance,
				     struct vpu_buffer *buf)
{}

int vpu_windsor_update_stream_buffer(struct vpu_shared_addr *shared,
				     u32 instance, u32 ptr, bool write)
{}

int vpu_windsor_get_stream_buffer_desc(struct vpu_shared_addr *shared,
				       u32 instance, struct vpu_rpc_buffer_desc *desc)
{}

u32 vpu_windsor_get_version(struct vpu_shared_addr *shared)
{}

static int vpu_windsor_set_frame_rate(struct vpu_enc_expert_mode_param *expert,
				      struct vpu_encode_params *params)
{}

static int vpu_windsor_set_format(struct vpu_enc_param *param, u32 pixelformat)
{}

static int vpu_windsor_set_profile(struct vpu_enc_param *param, u32 profile)
{}

static const u32 h264_level[] =;

static int vpu_windsor_set_level(struct vpu_enc_param *param, u32 level)
{}

static int vpu_windsor_set_size(struct vpu_enc_param *windsor,
				struct vpu_encode_params *params)
{}

static int vpu_windsor_set_gop(struct vpu_enc_param *param, u32 gop)
{}

static int vpu_windsor_set_bframes(struct vpu_enc_param *param, u32 bframes)
{}

static int vpu_windsor_set_bitrate_mode(struct vpu_enc_param *param, u32 rc_enable, u32 mode)
{}

static u32 vpu_windsor_bitrate(u32 bitrate)
{}

static int vpu_windsor_set_bitrate(struct vpu_enc_param *windsor,
				   struct vpu_encode_params *params)
{}

static int vpu_windsor_set_qp(struct vpu_enc_expert_mode_param *expert,
			      struct vpu_encode_params *params)
{}

static int vpu_windsor_set_sar(struct vpu_enc_expert_mode_param *expert,
			       struct vpu_encode_params *params)
{}

static int vpu_windsor_set_color(struct vpu_enc_expert_mode_param *expert,
				 struct vpu_encode_params *params)
{}

static int vpu_windsor_update_bitrate(struct vpu_shared_addr *shared,
				      u32 instance, struct vpu_encode_params *params)
{}

static int vpu_windsor_set_params(struct vpu_shared_addr *shared,
				  u32 instance, struct vpu_encode_params *params)
{}

static int vpu_windsor_update_params(struct vpu_shared_addr *shared,
				     u32 instance, struct vpu_encode_params *params)
{}

int vpu_windsor_set_encode_params(struct vpu_shared_addr *shared,
				  u32 instance, struct vpu_encode_params *params, u32 update)
{}

u32 vpu_windsor_get_max_instance_count(struct vpu_shared_addr *shared)
{}