xref: /linux/drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.h (revision 0526b56cbc3c489642bd6a5fe4b718dea7ef0ee8)
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 	void (*user_cmdq_cb)(struct cmdq_cb_data data);
33 	void *user_cb_data;
34 	struct mdp_comp *comps;
35 	void *mdp_ctx;
36 	u8 num_comps;
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