#include <linux/clk.h>
#include <linux/irqreturn.h>
#include <linux/kernel.h>
#include <linux/log2.h>
#include <linux/platform_device.h>
#include <linux/ratelimit.h>
#include <linux/reset.h>
#include <linux/slab.h>
#include <linux/videodev2.h>
#include <media/v4l2-common.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-fh.h>
#include <media/v4l2-mem2mem.h>
#include <media/videobuf2-v4l2.h>
#include <media/videobuf2-dma-contig.h>
#include <media/videobuf2-vmalloc.h>
#include "coda.h"
#include "imx-vdoa.h"
#define CREATE_TRACE_POINTS
#include "trace.h"
#define CODA_PARA_BUF_SIZE …
#define CODA7_PS_BUF_SIZE …
#define CODA9_PS_SAVE_SIZE …
#define CODA_DEFAULT_GAMMA …
#define CODA9_DEFAULT_GAMMA …
static void coda_free_bitstream_buffer(struct coda_ctx *ctx);
static inline int coda_is_initialized(struct coda_dev *dev)
{ … }
static inline unsigned long coda_isbusy(struct coda_dev *dev)
{ … }
static int coda_wait_timeout(struct coda_dev *dev)
{ … }
static void coda_command_async(struct coda_ctx *ctx, int cmd)
{ … }
static int coda_command_sync(struct coda_ctx *ctx, int cmd)
{ … }
int coda_hw_reset(struct coda_ctx *ctx)
{ … }
static void coda_kfifo_sync_from_device(struct coda_ctx *ctx)
{ … }
static void coda_kfifo_sync_to_device_full(struct coda_ctx *ctx)
{ … }
static void coda_kfifo_sync_to_device_write(struct coda_ctx *ctx)
{ … }
static int coda_h264_bitstream_pad(struct coda_ctx *ctx, u32 size)
{ … }
int coda_bitstream_flush(struct coda_ctx *ctx)
{ … }
static int coda_bitstream_queue(struct coda_ctx *ctx, const u8 *buf, u32 size)
{ … }
static u32 coda_buffer_parse_headers(struct coda_ctx *ctx,
struct vb2_v4l2_buffer *src_buf,
u32 payload)
{ … }
static bool coda_bitstream_try_queue(struct coda_ctx *ctx,
struct vb2_v4l2_buffer *src_buf)
{ … }
void coda_fill_bitstream(struct coda_ctx *ctx, struct list_head *buffer_list)
{ … }
void coda_bit_stream_end_flag(struct coda_ctx *ctx)
{ … }
static void coda_parabuf_write(struct coda_ctx *ctx, int index, u32 value)
{ … }
static inline int coda_alloc_context_buf(struct coda_ctx *ctx,
struct coda_aux_buf *buf, size_t size,
const char *name)
{ … }
static void coda_free_framebuffers(struct coda_ctx *ctx)
{ … }
static int coda_alloc_framebuffers(struct coda_ctx *ctx,
struct coda_q_data *q_data, u32 fourcc)
{ … }
static void coda_free_context_buffers(struct coda_ctx *ctx)
{ … }
static int coda_alloc_context_buffers(struct coda_ctx *ctx,
struct coda_q_data *q_data)
{ … }
static int coda_encode_header(struct coda_ctx *ctx, struct vb2_v4l2_buffer *buf,
int header_code, u8 *header, int *size)
{ … }
static u32 coda_slice_mode(struct coda_ctx *ctx)
{ … }
static int coda_enc_param_change(struct coda_ctx *ctx)
{ … }
static phys_addr_t coda_iram_alloc(struct coda_iram_info *iram, size_t size)
{ … }
static void coda_setup_iram(struct coda_ctx *ctx)
{ … }
static u32 coda_supported_firmwares[] = …;
static bool coda_firmware_supported(u32 vernum)
{ … }
int coda_check_firmware(struct coda_dev *dev)
{ … }
static void coda9_set_frame_cache(struct coda_ctx *ctx, u32 fourcc)
{ … }
static int coda_encoder_reqbufs(struct coda_ctx *ctx,
struct v4l2_requestbuffers *rb)
{ … }
static int coda_start_encoding(struct coda_ctx *ctx)
{ … }
static int coda_prepare_encode(struct coda_ctx *ctx)
{ … }
static char coda_frame_type_char(u32 flags)
{ … }
static void coda_finish_encode(struct coda_ctx *ctx)
{ … }
static void coda_seq_end_work(struct work_struct *work)
{ … }
static void coda_bit_release(struct coda_ctx *ctx)
{ … }
const struct coda_context_ops coda_bit_encode_ops = …;
static int coda_alloc_bitstream_buffer(struct coda_ctx *ctx,
struct coda_q_data *q_data)
{ … }
static void coda_free_bitstream_buffer(struct coda_ctx *ctx)
{ … }
static int coda_decoder_reqbufs(struct coda_ctx *ctx,
struct v4l2_requestbuffers *rb)
{ … }
static bool coda_reorder_enable(struct coda_ctx *ctx)
{ … }
static void coda_decoder_drop_used_metas(struct coda_ctx *ctx)
{ … }
static int __coda_decoder_seq_init(struct coda_ctx *ctx)
{ … }
static void coda_dec_seq_init_work(struct work_struct *work)
{ … }
static int __coda_start_decoding(struct coda_ctx *ctx)
{ … }
static int coda_start_decoding(struct coda_ctx *ctx)
{ … }
static int coda_prepare_decode(struct coda_ctx *ctx)
{ … }
static void coda_finish_decode(struct coda_ctx *ctx)
{ … }
static void coda_decode_timeout(struct coda_ctx *ctx)
{ … }
const struct coda_context_ops coda_bit_decode_ops = …;
irqreturn_t coda_irq_handler(int irq, void *data)
{ … }