xref: /linux/drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.h (revision 79790b6818e96c58fe2bffee1b418c16e64e7b80)
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 platform_device *mdp_get_plat_device(struct platform_device *pdev);
16 
17 struct mdp_cmdq_param {
18 	struct img_config *config;
19 	struct img_ipi_frameparam *param;
20 	const struct v4l2_rect *composes[IMG_MAX_HW_OUTPUTS];
21 
22 	void (*cmdq_cb)(struct cmdq_cb_data data);
23 	void *cb_data;
24 	void *mdp_ctx;
25 };
26 
27 struct mdp_cmdq_cmd {
28 	struct work_struct auto_release_work;
29 	struct cmdq_pkt pkt;
30 	s32 *event;
31 	struct mdp_dev *mdp;
32 	struct cmdq_cb_data *data;
33 	void (*user_cmdq_cb)(struct cmdq_cb_data data);
34 	void *user_cb_data;
35 	struct mdp_comp *comps;
36 	void *mdp_ctx;
37 	u8 num_comps;
38 };
39 
40 struct mdp_dev;
41 
42 int mdp_cmdq_send(struct mdp_dev *mdp, struct mdp_cmdq_param *param);
43 
44 #endif  /* __MTK_MDP3_CMDQ_H__ */
45