#include <linux/container_of.h>
#include <linux/device.h>
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/limits.h>
#include <linux/minmax.h>
#include <linux/mutex.h>
#include <linux/pm_runtime.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
#include <linux/string.h>
#include <linux/types.h>
#include <linux/videodev2.h>
#include <media/media-entity.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-device.h>
#include <media/v4l2-event.h>
#include <media/v4l2-fh.h>
#include <media/v4l2-ioctl.h>
#include <media/v4l2-mem2mem.h>
#include <media/videobuf2-core.h>
#include <media/videobuf2-dma-contig.h>
#include "imx8-isi-core.h"
struct mxc_isi_m2m_buffer { … };
struct mxc_isi_m2m_ctx_queue_data { … };
struct mxc_isi_m2m_ctx { … };
static inline struct mxc_isi_m2m_buffer *
to_isi_m2m_buffer(struct vb2_v4l2_buffer *buf)
{ … }
static inline struct mxc_isi_m2m_ctx *to_isi_m2m_ctx(struct v4l2_fh *fh)
{ … }
static inline struct mxc_isi_m2m_ctx_queue_data *
mxc_isi_m2m_ctx_qdata(struct mxc_isi_m2m_ctx *ctx, enum v4l2_buf_type type)
{ … }
static void mxc_isi_m2m_frame_write_done(struct mxc_isi_pipe *pipe, u32 status)
{ … }
static void mxc_isi_m2m_device_run(void *priv)
{ … }
static const struct v4l2_m2m_ops mxc_isi_m2m_ops = …;
static int mxc_isi_m2m_vb2_queue_setup(struct vb2_queue *q,
unsigned int *num_buffers,
unsigned int *num_planes,
unsigned int sizes[],
struct device *alloc_devs[])
{ … }
static int mxc_isi_m2m_vb2_buffer_init(struct vb2_buffer *vb2)
{ … }
static int mxc_isi_m2m_vb2_buffer_prepare(struct vb2_buffer *vb2)
{ … }
static void mxc_isi_m2m_vb2_buffer_queue(struct vb2_buffer *vb2)
{ … }
static int mxc_isi_m2m_vb2_start_streaming(struct vb2_queue *q,
unsigned int count)
{ … }
static void mxc_isi_m2m_vb2_stop_streaming(struct vb2_queue *q)
{ … }
static const struct vb2_ops mxc_isi_m2m_vb2_qops = …;
static int mxc_isi_m2m_queue_init(void *priv, struct vb2_queue *src_vq,
struct vb2_queue *dst_vq)
{ … }
static inline struct mxc_isi_m2m_ctx *
ctrl_to_mxc_isi_m2m_ctx(struct v4l2_ctrl *ctrl)
{ … }
static int mxc_isi_m2m_ctx_s_ctrl(struct v4l2_ctrl *ctrl)
{ … }
static const struct v4l2_ctrl_ops mxc_isi_m2m_ctx_ctrl_ops = …;
static int mxc_isi_m2m_ctx_ctrls_create(struct mxc_isi_m2m_ctx *ctx)
{ … }
static void mxc_isi_m2m_ctx_ctrls_delete(struct mxc_isi_m2m_ctx *ctx)
{ … }
static int mxc_isi_m2m_querycap(struct file *file, void *fh,
struct v4l2_capability *cap)
{ … }
static int mxc_isi_m2m_enum_fmt_vid(struct file *file, void *fh,
struct v4l2_fmtdesc *f)
{ … }
static const struct mxc_isi_format_info *
__mxc_isi_m2m_try_fmt_vid(struct mxc_isi_m2m_ctx *ctx,
struct v4l2_pix_format_mplane *pix,
const enum mxc_isi_video_type type)
{ … }
static int mxc_isi_m2m_try_fmt_vid(struct file *file, void *fh,
struct v4l2_format *f)
{ … }
static int mxc_isi_m2m_g_fmt_vid(struct file *file, void *fh,
struct v4l2_format *f)
{ … }
static int mxc_isi_m2m_s_fmt_vid(struct file *file, void *fh,
struct v4l2_format *f)
{ … }
static int mxc_isi_m2m_streamon(struct file *file, void *fh,
enum v4l2_buf_type type)
{ … }
static int mxc_isi_m2m_streamoff(struct file *file, void *fh,
enum v4l2_buf_type type)
{ … }
static const struct v4l2_ioctl_ops mxc_isi_m2m_ioctl_ops = …;
static void mxc_isi_m2m_init_format(struct mxc_isi_m2m_ctx *ctx,
struct mxc_isi_m2m_ctx_queue_data *qdata,
enum mxc_isi_video_type type)
{ … }
static int mxc_isi_m2m_open(struct file *file)
{ … }
static int mxc_isi_m2m_release(struct file *file)
{ … }
static const struct v4l2_file_operations mxc_isi_m2m_fops = …;
int mxc_isi_m2m_register(struct mxc_isi_dev *isi, struct v4l2_device *v4l2_dev)
{ … }
int mxc_isi_m2m_unregister(struct mxc_isi_dev *isi)
{ … }