linux/drivers/media/platform/mediatek/mdp/mtk_mdp_m2m.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2015-2016 MediaTek Inc.
 * Author: Houlong Wei <[email protected]>
 *         Ming Hsiu Tsai <[email protected]>
 */

#include <linux/device.h>
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/pm_runtime.h>
#include <linux/slab.h>
#include <linux/workqueue.h>
#include <media/v4l2-event.h>
#include <media/v4l2-ioctl.h>

#include "mtk_mdp_core.h"
#include "mtk_mdp_m2m.h"
#include "mtk_mdp_regs.h"
#include "mtk_vpu.h"


/**
 *  struct mtk_mdp_pix_limit - image pixel size limits
 *  @org_w: source pixel width
 *  @org_h: source pixel height
 *  @target_rot_dis_w: pixel dst scaled width with the rotator is off
 *  @target_rot_dis_h: pixel dst scaled height with the rotator is off
 *  @target_rot_en_w: pixel dst scaled width with the rotator is on
 *  @target_rot_en_h: pixel dst scaled height with the rotator is on
 */
struct mtk_mdp_pix_limit {};

static struct mtk_mdp_pix_align mtk_mdp_size_align =;

static const struct mtk_mdp_fmt mtk_mdp_formats[] =;

static struct mtk_mdp_pix_limit mtk_mdp_size_max =;

static struct mtk_mdp_pix_limit mtk_mdp_size_min =;

/* align size for normal raster scan pixel format */
static struct mtk_mdp_pix_align mtk_mdp_rs_align =;

static struct mtk_mdp_variant mtk_mdp_default_variant =;

static const struct mtk_mdp_fmt *mtk_mdp_find_fmt(u32 pixelformat, u32 type)
{}

static const struct mtk_mdp_fmt *mtk_mdp_find_fmt_by_index(u32 index, u32 type)
{}

static void mtk_mdp_bound_align_image(u32 *w, unsigned int wmin,
				      unsigned int wmax, unsigned int align_w,
				      u32 *h, unsigned int hmin,
				      unsigned int hmax, unsigned int align_h)
{}

static const struct mtk_mdp_fmt *mtk_mdp_try_fmt_mplane(struct mtk_mdp_ctx *ctx,
							struct v4l2_format *f)
{}

static struct mtk_mdp_frame *mtk_mdp_ctx_get_frame(struct mtk_mdp_ctx *ctx,
					    enum v4l2_buf_type type)
{}

static void mtk_mdp_check_crop_change(u32 new_w, u32 new_h, u32 *w, u32 *h)
{}

static int mtk_mdp_try_crop(struct mtk_mdp_ctx *ctx, u32 type,
			    struct v4l2_rect *r)
{}

static inline struct mtk_mdp_ctx *fh_to_ctx(struct v4l2_fh *fh)
{}

static inline struct mtk_mdp_ctx *ctrl_to_ctx(struct v4l2_ctrl *ctrl)
{}

void mtk_mdp_ctx_state_lock_set(struct mtk_mdp_ctx *ctx, u32 state)
{}

static bool mtk_mdp_ctx_state_is_set(struct mtk_mdp_ctx *ctx, u32 mask)
{}

static void mtk_mdp_set_frame_size(struct mtk_mdp_frame *frame, int width,
				   int height)
{}

static int mtk_mdp_m2m_start_streaming(struct vb2_queue *q, unsigned int count)
{}

static void *mtk_mdp_m2m_buf_remove(struct mtk_mdp_ctx *ctx,
				    enum v4l2_buf_type type)
{}

static void mtk_mdp_m2m_stop_streaming(struct vb2_queue *q)
{}

/* The color format (num_planes) must be already configured. */
static void mtk_mdp_prepare_addr(struct mtk_mdp_ctx *ctx,
				 struct vb2_buffer *vb,
				 struct mtk_mdp_frame *frame,
				 struct mtk_mdp_addr *addr)
{}

static void mtk_mdp_m2m_get_bufs(struct mtk_mdp_ctx *ctx)
{}

static void mtk_mdp_process_done(void *priv, int vb_state)
{}

static void mtk_mdp_m2m_worker(struct work_struct *work)
{}

static void mtk_mdp_m2m_device_run(void *priv)
{}

static int mtk_mdp_m2m_queue_setup(struct vb2_queue *vq,
			unsigned int *num_buffers, unsigned int *num_planes,
			unsigned int sizes[], struct device *alloc_devs[])
{}

static int mtk_mdp_m2m_buf_prepare(struct vb2_buffer *vb)
{}

static void mtk_mdp_m2m_buf_queue(struct vb2_buffer *vb)
{}

static const struct vb2_ops mtk_mdp_m2m_qops =;

static int mtk_mdp_m2m_querycap(struct file *file, void *fh,
				struct v4l2_capability *cap)
{}

static int mtk_mdp_enum_fmt(struct v4l2_fmtdesc *f, u32 type)
{}

static int mtk_mdp_m2m_enum_fmt_vid_cap(struct file *file, void *priv,
					struct v4l2_fmtdesc *f)
{}

static int mtk_mdp_m2m_enum_fmt_vid_out(struct file *file, void *priv,
					struct v4l2_fmtdesc *f)
{}

static int mtk_mdp_m2m_g_fmt_mplane(struct file *file, void *fh,
				    struct v4l2_format *f)
{}

static int mtk_mdp_m2m_try_fmt_mplane(struct file *file, void *fh,
				      struct v4l2_format *f)
{}

static int mtk_mdp_m2m_s_fmt_mplane(struct file *file, void *fh,
				    struct v4l2_format *f)
{}

static int mtk_mdp_m2m_reqbufs(struct file *file, void *fh,
			       struct v4l2_requestbuffers *reqbufs)
{}

static int mtk_mdp_m2m_streamon(struct file *file, void *fh,
				enum v4l2_buf_type type)
{}

static inline bool mtk_mdp_is_target_compose(u32 target)
{}

static inline bool mtk_mdp_is_target_crop(u32 target)
{}

static int mtk_mdp_m2m_g_selection(struct file *file, void *fh,
				       struct v4l2_selection *s)
{}

static int mtk_mdp_check_scaler_ratio(struct mtk_mdp_variant *var, int src_w,
				      int src_h, int dst_w, int dst_h, int rot)
{}

static int mtk_mdp_m2m_s_selection(struct file *file, void *fh,
				   struct v4l2_selection *s)
{}

static const struct v4l2_ioctl_ops mtk_mdp_m2m_ioctl_ops =;

static int mtk_mdp_m2m_queue_init(void *priv, struct vb2_queue *src_vq,
				  struct vb2_queue *dst_vq)
{}

static int mtk_mdp_s_ctrl(struct v4l2_ctrl *ctrl)
{}

static const struct v4l2_ctrl_ops mtk_mdp_ctrl_ops =;

static int mtk_mdp_ctrls_create(struct mtk_mdp_ctx *ctx)
{}

static void mtk_mdp_set_default_params(struct mtk_mdp_ctx *ctx)
{}

static int mtk_mdp_m2m_open(struct file *file)
{}

static int mtk_mdp_m2m_release(struct file *file)
{}

static const struct v4l2_file_operations mtk_mdp_m2m_fops =;

static const struct v4l2_m2m_ops mtk_mdp_m2m_ops =;

int mtk_mdp_register_m2m_device(struct mtk_mdp_dev *mdp)
{}

void mtk_mdp_unregister_m2m_device(struct mtk_mdp_dev *mdp)
{}