#include <linux/of.h>
#include <linux/clk.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/mfd/syscon.h>
#include <linux/slab.h>
#include <linux/interrupt.h>
#include <linux/kthread.h>
#include <media/v4l2-ioctl.h>
#include <media/v4l2-event.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-mem2mem.h>
#include <media/v4l2-dev.h>
#include <media/videobuf2-dma-contig.h>
#include "vdec.h"
#include "esparser.h"
#include "vdec_helpers.h"
struct dummy_buf { … };
#define SIZE_VIFIFO …
static u32 get_output_size(u32 width, u32 height)
{ … }
u32 amvdec_get_output_size(struct amvdec_session *sess)
{ … }
EXPORT_SYMBOL_GPL(…);
static int vdec_codec_needs_recycle(struct amvdec_session *sess)
{ … }
static int vdec_recycle_thread(void *data)
{ … }
static int vdec_poweron(struct amvdec_session *sess)
{ … }
static void vdec_wait_inactive(struct amvdec_session *sess)
{ … }
static void vdec_poweroff(struct amvdec_session *sess)
{ … }
static void
vdec_queue_recycle(struct amvdec_session *sess, struct vb2_buffer *vb)
{ … }
static void vdec_m2m_device_run(void *priv)
{ … }
static void vdec_m2m_job_abort(void *priv)
{ … }
static const struct v4l2_m2m_ops vdec_m2m_ops = …;
static void process_num_buffers(struct vb2_queue *q,
struct amvdec_session *sess,
unsigned int *num_buffers,
bool is_reqbufs)
{ … }
static int vdec_queue_setup(struct vb2_queue *q, unsigned int *num_buffers,
unsigned int *num_planes, unsigned int sizes[],
struct device *alloc_devs[])
{ … }
static void vdec_vb2_buf_queue(struct vb2_buffer *vb)
{ … }
static int vdec_start_streaming(struct vb2_queue *q, unsigned int count)
{ … }
static void vdec_free_canvas(struct amvdec_session *sess)
{ … }
static void vdec_reset_timestamps(struct amvdec_session *sess)
{ … }
static void vdec_reset_bufs_recycle(struct amvdec_session *sess)
{ … }
static void vdec_stop_streaming(struct vb2_queue *q)
{ … }
static int vdec_vb2_buf_prepare(struct vb2_buffer *vb)
{ … }
static const struct vb2_ops vdec_vb2_ops = …;
static int
vdec_querycap(struct file *file, void *fh, struct v4l2_capability *cap)
{ … }
static const struct amvdec_format *
find_format(const struct amvdec_format *fmts, u32 size, u32 pixfmt)
{ … }
static unsigned int
vdec_supports_pixfmt_cap(const struct amvdec_format *fmt_out, u32 pixfmt_cap)
{ … }
static const struct amvdec_format *
vdec_try_fmt_common(struct amvdec_session *sess, u32 size,
struct v4l2_format *f)
{ … }
static int vdec_try_fmt(struct file *file, void *fh, struct v4l2_format *f)
{ … }
static int vdec_g_fmt(struct file *file, void *fh, struct v4l2_format *f)
{ … }
static int vdec_s_fmt(struct file *file, void *fh, struct v4l2_format *f)
{ … }
static int vdec_enum_fmt(struct file *file, void *fh, struct v4l2_fmtdesc *f)
{ … }
static int vdec_enum_framesizes(struct file *file, void *fh,
struct v4l2_frmsizeenum *fsize)
{ … }
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 int vdec_g_pixelaspect(struct file *file, void *fh, int type,
struct v4l2_fract *f)
{ … }
static const struct v4l2_ioctl_ops vdec_ioctl_ops = …;
static int m2m_queue_init(void *priv, struct vb2_queue *src_vq,
struct vb2_queue *dst_vq)
{ … }
static int vdec_init_ctrls(struct amvdec_session *sess)
{ … }
static int vdec_open(struct file *file)
{ … }
static int vdec_close(struct file *file)
{ … }
static const struct v4l2_file_operations vdec_fops = …;
static irqreturn_t vdec_isr(int irq, void *data)
{ … }
static irqreturn_t vdec_threaded_isr(int irq, void *data)
{ … }
static const struct of_device_id vdec_dt_match[] = …;
MODULE_DEVICE_TABLE(of, vdec_dt_match);
static int vdec_probe(struct platform_device *pdev)
{ … }
static void vdec_remove(struct platform_device *pdev)
{ … }
static struct platform_driver meson_vdec_driver = …;
module_platform_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;