Media:Wave5: Add contiguous planes format support (YUV420/NV12/NV21)
[platform/kernel/linux-starfive.git] / drivers / media / platform / chips-media / wave5 / wave5-helper.h
1 /* SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) */
2 /*
3  * Wave5 series multi-standard codec IP - basic types
4  *
5  * Copyright (C) 2021 CHIPS&MEDIA INC
6  */
7
8 #ifndef __WAVE_HELPER_H__
9 #define __WAVE_HELPER_H__
10
11 #include "wave5-vpu.h"
12
13 #define FMT_TYPES       2
14 #define MAX_FMTS        6
15
16 void wave5_cleanup_instance(struct vpu_instance *inst);
17 int wave5_vpu_release_device(struct file *filp,
18                              int (*close_func)(struct vpu_instance *inst, u32 *fail_res),
19                              char *name);
20 int wave5_vpu_queue_init(void *priv, struct vb2_queue *src_vq, struct vb2_queue *dst_vq,
21                          const struct vb2_ops *ops);
22 int wave5_vpu_subscribe_event(struct v4l2_fh *fh, const struct v4l2_event_subscription *sub);
23 int wave5_vpu_g_fmt_out(struct file *file, void *fh, struct v4l2_format *f);
24 const struct vpu_format *wave5_find_vpu_fmt(unsigned int v4l2_pix_fmt,
25                                             const struct vpu_format fmt_list[MAX_FMTS]);
26 const struct vpu_format *wave5_find_vpu_fmt_by_idx(unsigned int idx,
27                                                    const struct vpu_format fmt_list[MAX_FMTS]);
28 #endif