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_M2M_H__ 8 #define __MTK_MDP3_M2M_H__ 9 10 #include <media/v4l2-ctrls.h> 11 #include "mtk-mdp3-core.h" 12 #include "mtk-mdp3-vpu.h" 13 #include "mtk-mdp3-regs.h" 14 15 #define MDP_MAX_CTRLS 10 16 17 enum { 18 MDP_M2M_SRC = 0, 19 MDP_M2M_DST = 1, 20 MDP_M2M_MAX, 21 }; 22 23 struct mdp_m2m_ctrls { 24 struct v4l2_ctrl *hflip; 25 struct v4l2_ctrl *vflip; 26 struct v4l2_ctrl *rotate; 27 }; 28 29 struct mdp_m2m_ctx { 30 u32 id; 31 struct mdp_dev *mdp_dev; 32 struct v4l2_fh fh; 33 struct v4l2_ctrl_handler ctrl_handler; 34 struct mdp_m2m_ctrls ctrls; 35 struct v4l2_m2m_ctx *m2m_ctx; 36 u32 frame_count[MDP_M2M_MAX]; 37 38 struct mdp_frameparam curr_param; 39 /* synchronization protect for mdp m2m context */ 40 struct mutex ctx_lock; 41 }; 42 43 int mdp_m2m_device_register(struct mdp_dev *mdp); 44 void mdp_m2m_device_unregister(struct mdp_dev *mdp); 45 void mdp_m2m_job_finish(struct mdp_m2m_ctx *ctx); 46 47 #endif /* __MTK_MDP3_M2M_H__ */ 48