xref: /linux/drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.h (revision df9c299371054cb725eef730fd0f1d0fe2ed6bb0)
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3  * Copyright (c) 2022 MediaTek Inc.
4  * Author: Ping-Hsun Wu <ping-hsun.wu@mediatek.com>
5  */
6 
7 #ifndef __MTK_MDP3_CMDQ_H__
8 #define __MTK_MDP3_CMDQ_H__
9 
10 #include <linux/platform_device.h>
11 #include <linux/videodev2.h>
12 #include <linux/soc/mediatek/mtk-cmdq.h>
13 #include "mtk-img-ipi.h"
14 
15 struct mdp_cmdq_param {
16 	struct img_config *config;
17 	struct img_ipi_frameparam *param;
18 	const struct v4l2_rect *composes[IMG_MAX_HW_OUTPUTS];
19 
20 	void (*cmdq_cb)(struct cmdq_cb_data data);
21 	void *cb_data;
22 	void *mdp_ctx;
23 };
24 
25 struct mdp_cmdq_cmd {
26 	struct work_struct auto_release_work;
27 	struct cmdq_pkt pkt;
28 	s32 *event;
29 	struct mdp_dev *mdp;
30 	struct cmdq_cb_data *data;
31 	void (*user_cmdq_cb)(struct cmdq_cb_data data);
32 	void *user_cb_data;
33 	struct mdp_comp *comps;
34 	void *mdp_ctx;
35 	u8 num_comps;
36 	u8 pp_idx;
37 };
38 
39 struct mdp_dev;
40 
41 int mdp_cmdq_send(struct mdp_dev *mdp, struct mdp_cmdq_param *param);
42 
43 #endif  /* __MTK_MDP3_CMDQ_H__ */
44