#include <linux/math64.h>
#include <media/v4l2-common.h>
#include <media/videobuf2-v4l2.h>
#include <media/videobuf2-dma-contig.h>
#include "mtk-mdp3-core.h"
#include "mtk-mdp3-regs.h"
#include "mtk-mdp3-m2m.h"
static const struct mdp_format *mdp_find_fmt(const struct mtk_mdp_driver_data *mdp_data,
u32 pixelformat, u32 type)
{ … }
static const struct mdp_format *mdp_find_fmt_by_index(const struct mtk_mdp_driver_data *mdp_data,
u32 index, u32 type)
{ … }
enum mdp_ycbcr_profile mdp_map_ycbcr_prof_mplane(struct v4l2_format *f,
u32 mdp_color)
{ … }
static void mdp_bound_align_image(u32 *w, u32 *h,
struct v4l2_frmsize_stepwise *s,
unsigned int salign)
{ … }
static int mdp_clamp_align(s32 *x, int min, int max, unsigned int align)
{ … }
int mdp_enum_fmt_mplane(struct mdp_dev *mdp, struct v4l2_fmtdesc *f)
{ … }
const struct mdp_format *mdp_try_fmt_mplane(struct mdp_dev *mdp,
struct v4l2_format *f,
struct mdp_frameparam *param,
u32 ctx_id)
{ … }
static int mdp_clamp_start(s32 *x, int min, int max, unsigned int align,
u32 flags)
{ … }
static int mdp_clamp_end(s32 *x, int min, int max, unsigned int align,
u32 flags)
{ … }
int mdp_try_crop(struct mdp_m2m_ctx *ctx, struct v4l2_rect *r,
const struct v4l2_selection *s, struct mdp_frame *frame)
{ … }
int mdp_check_scaling_ratio(const struct v4l2_rect *crop,
const struct v4l2_rect *compose, s32 rotation,
const struct mdp_limit *limit)
{ … }
bool mdp_check_pp_enable(struct mdp_dev *mdp, struct mdp_frame *frame)
{ … }
static u32 mdp_fmt_get_stride(const struct mdp_format *fmt,
u32 bytesperline, unsigned int plane)
{ … }
static u32 mdp_fmt_get_stride_contig(const struct mdp_format *fmt,
u32 pix_stride, unsigned int plane)
{ … }
static u32 mdp_fmt_get_plane_size(const struct mdp_format *fmt,
u32 stride, u32 height, unsigned int plane)
{ … }
static void mdp_prepare_buffer(struct img_image_buffer *b,
struct mdp_frame *frame, struct vb2_buffer *vb)
{ … }
void mdp_set_src_config(struct img_input *in,
struct mdp_frame *frame, struct vb2_buffer *vb)
{ … }
static u32 mdp_to_fixed(u32 *r, struct v4l2_fract *f)
{ … }
static void mdp_set_src_crop(struct img_crop *c, struct mdp_crop *crop)
{ … }
static void mdp_set_orientation(struct img_output *out,
s32 rotation, bool hflip, bool vflip)
{ … }
void mdp_set_dst_config(struct img_output *out,
struct mdp_frame *frame, struct vb2_buffer *vb)
{ … }
int mdp_frameparam_init(struct mdp_dev *mdp, struct mdp_frameparam *param)
{ … }