#include <linux/errno.h>
#include <linux/interrupt.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/pm_runtime.h>
#include <linux/slab.h>
#include <media/v4l2-event.h>
#include <media/v4l2-ioctl.h>
#include "bdisp.h"
#define BDISP_MAX_CTRL_NUM …
#define BDISP_WORK_TIMEOUT …
#define BDISP_PARAMS …
#define BDISP_SRC_FMT …
#define BDISP_DST_FMT …
#define BDISP_CTX_STOP_REQ …
#define BDISP_CTX_ABORT …
#define BDISP_MIN_W …
#define BDISP_MAX_W …
#define BDISP_MIN_H …
#define BDISP_MAX_H …
#define fh_to_ctx(__fh) …
enum bdisp_dev_flags { … };
static const struct bdisp_fmt bdisp_formats[] = …;
#define BDISP_DEF_WIDTH …
#define BDISP_DEF_HEIGHT …
static const struct bdisp_frame bdisp_dflt_fmt = …;
static inline void bdisp_ctx_state_lock_set(u32 state, struct bdisp_ctx *ctx)
{ … }
static inline void bdisp_ctx_state_lock_clear(u32 state, struct bdisp_ctx *ctx)
{ … }
static inline bool bdisp_ctx_state_is_set(u32 mask, struct bdisp_ctx *ctx)
{ … }
static const struct bdisp_fmt *bdisp_find_fmt(u32 pixelformat)
{ … }
static struct bdisp_frame *ctx_get_frame(struct bdisp_ctx *ctx,
enum v4l2_buf_type type)
{ … }
static void bdisp_job_finish(struct bdisp_ctx *ctx, int vb_state)
{ … }
static int bdisp_ctx_stop_req(struct bdisp_ctx *ctx)
{ … }
static void __bdisp_job_abort(struct bdisp_ctx *ctx)
{ … }
static void bdisp_job_abort(void *priv)
{ … }
static int bdisp_get_addr(struct bdisp_ctx *ctx, struct vb2_buffer *vb,
struct bdisp_frame *frame, dma_addr_t *paddr)
{ … }
static int bdisp_get_bufs(struct bdisp_ctx *ctx)
{ … }
static void bdisp_device_run(void *priv)
{ … }
static const struct v4l2_m2m_ops bdisp_m2m_ops = …;
static int __bdisp_s_ctrl(struct bdisp_ctx *ctx, struct v4l2_ctrl *ctrl)
{ … }
static int bdisp_s_ctrl(struct v4l2_ctrl *ctrl)
{ … }
static const struct v4l2_ctrl_ops bdisp_c_ops = …;
static int bdisp_ctrls_create(struct bdisp_ctx *ctx)
{ … }
static void bdisp_ctrls_delete(struct bdisp_ctx *ctx)
{ … }
static int bdisp_queue_setup(struct vb2_queue *vq,
unsigned int *nb_buf, unsigned int *nb_planes,
unsigned int sizes[], struct device *alloc_devs[])
{ … }
static int bdisp_buf_prepare(struct vb2_buffer *vb)
{ … }
static void bdisp_buf_queue(struct vb2_buffer *vb)
{ … }
static int bdisp_start_streaming(struct vb2_queue *q, unsigned int count)
{ … }
static void bdisp_stop_streaming(struct vb2_queue *q)
{ … }
static const struct vb2_ops bdisp_qops = …;
static int queue_init(void *priv,
struct vb2_queue *src_vq, struct vb2_queue *dst_vq)
{ … }
static int bdisp_open(struct file *file)
{ … }
static int bdisp_release(struct file *file)
{ … }
static const struct v4l2_file_operations bdisp_fops = …;
static int bdisp_querycap(struct file *file, void *fh,
struct v4l2_capability *cap)
{ … }
static int bdisp_enum_fmt(struct file *file, void *fh, struct v4l2_fmtdesc *f)
{ … }
static int bdisp_g_fmt(struct file *file, void *fh, struct v4l2_format *f)
{ … }
static int bdisp_try_fmt(struct file *file, void *fh, struct v4l2_format *f)
{ … }
static int bdisp_s_fmt(struct file *file, void *fh, struct v4l2_format *f)
{ … }
static int bdisp_g_selection(struct file *file, void *fh,
struct v4l2_selection *s)
{ … }
static int is_rect_enclosed(struct v4l2_rect *a, struct v4l2_rect *b)
{ … }
static int bdisp_s_selection(struct file *file, void *fh,
struct v4l2_selection *s)
{ … }
static int bdisp_streamon(struct file *file, void *fh, enum v4l2_buf_type type)
{ … }
static const struct v4l2_ioctl_ops bdisp_ioctl_ops = …;
static int bdisp_register_device(struct bdisp_dev *bdisp)
{ … }
static void bdisp_unregister_device(struct bdisp_dev *bdisp)
{ … }
static irqreturn_t bdisp_irq_thread(int irq, void *priv)
{ … }
static irqreturn_t bdisp_irq_handler(int irq, void *priv)
{ … }
static void bdisp_irq_timeout(struct work_struct *ptr)
{ … }
static int bdisp_m2m_suspend(struct bdisp_dev *bdisp)
{ … }
static int bdisp_m2m_resume(struct bdisp_dev *bdisp)
{ … }
static int bdisp_runtime_resume(struct device *dev)
{ … }
static int bdisp_runtime_suspend(struct device *dev)
{ … }
static int bdisp_resume(struct device *dev)
{ … }
static int bdisp_suspend(struct device *dev)
{ … }
static const struct dev_pm_ops bdisp_pm_ops = …;
static void bdisp_remove(struct platform_device *pdev)
{ … }
static int bdisp_probe(struct platform_device *pdev)
{ … }
static const struct of_device_id bdisp_match_types[] = …;
MODULE_DEVICE_TABLE(of, bdisp_match_types);
static struct platform_driver bdisp_driver = …;
module_platform_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;