4 #include "DpDataType.h"
14 enum OVL_LAYER_SOURCE
{
15 OVL_LAYER_SOURCE_MEM
= 0,
16 OVL_LAYER_SOURCE_RESERVED
= 1,
17 OVL_LAYER_SOURCE_SCL
= 2,
18 OVL_LAYER_SOURCE_PQ
= 3,
21 enum OVL_LAYER_SECURE_MODE
{
22 OVL_LAYER_NORMAL_BUFFER
= 0,
23 OVL_LAYER_SECURE_BUFFER
= 1,
24 OVL_LAYER_PROTECTED_BUFFER
= 2
27 typedef struct _OVL_CONFIG_STRUCT
30 unsigned int layer_en
;
31 enum OVL_LAYER_SOURCE source
;
39 unsigned int src_pitch
;
43 unsigned int dst_h
; // clip region
55 unsigned int security
;
57 struct ion_handle
*ion_handles
;
58 bool fgIonHandleImport
;
61 struct disp_path_config_struct
63 unsigned int srcModule
; // DISP_MODULE_ENUM
65 // if srcModule=RDMA0, set following value, else do not have to set following value
67 unsigned int inFormat
;
69 struct DISP_REGION srcROI
; // ROI
71 OVL_CONFIG_STRUCT ovl_config
;
73 struct DISP_REGION bgROI
; // background ROI
74 unsigned int bgColor
; // background color
76 unsigned int dstModule
; // DISP_MODULE_ENUM
77 unsigned int outFormat
;
78 unsigned int dstAddr
; // only take effect when dstModule=DISP_MODULE_WDMA or DISP_MODULE_WDMA1
79 unsigned int enableUFOE
;
80 int srcWidth
, srcHeight
;
81 int dstWidth
, dstHeight
;
83 #ifdef CONFIG_MTK_SEC_VIDEO_PATH_SUPPORT
84 unsigned int RDMA0Security
;
85 unsigned int WDMA1Security
;
89 struct disp_path_config_mem_out_struct
93 unsigned int outFormat
;
95 unsigned int dstPitch
;
96 struct DISP_REGION srcROI
; // ROI
97 unsigned int security
;
101 struct disp_path_config_ovl_mode_t
106 unsigned int address
;
107 struct DISP_REGION roi
;
110 enum RDMA_OUTPUT_FORMAT
{
111 RDMA_OUTPUT_FORMAT_ARGB
= 0,
112 RDMA_OUTPUT_FORMAT_YUV444
= 1,
116 RDMA_MODE_DIRECT_LINK
= 0,
117 RDMA_MODE_MEMORY
= 1,
119 typedef struct _RDMA_CONFIG_STRUCT
121 unsigned idx
; // instance index
122 enum RDMA_MODE mode
; // data mode
123 DpColorFormat inputFormat
;
127 enum RDMA_OUTPUT_FORMAT outputFormat
;
133 int disp_wait_timeout(bool flag
, unsigned int timeout
);
134 int disp_path_config(struct disp_path_config_struct
* pConfig
);
135 int disp_path_config_layer(OVL_CONFIG_STRUCT
* pOvlConfig
);
136 int disp_path_config_layer_addr(unsigned int layer
, unsigned int addr
);
137 int disp_path_get_mutex(void);
138 int disp_path_release_mutex(void);
139 int disp_path_wait_reg_update(unsigned int mutexID
);
140 int disp_path_get_mutex_(int mutexId
);
141 int disp_path_release_mutex_(int mutexId
);
142 int disp_path_config_(struct disp_path_config_struct
* pConfig
, int mutexId
);
144 int disp_path_config_mem_out(struct disp_path_config_mem_out_struct
* pConfig
);
146 #ifdef CONFIG_MTK_SEC_VIDEO_PATH_SUPPORT
147 int disp_path_config_mem_out_(struct disp_path_config_mem_out_struct
* pConfig
, int OvlSecure
);
150 int disp_path_config_mem_out_without_lcd(struct disp_path_config_mem_out_struct
* pConfig
);
151 void disp_path_wait_mem_out_done(void);
152 int disp_path_clock_on(char* name
);
153 int disp_path_clock_off(char* name
);
154 int disp_path_change_tdshp_status(unsigned int layer
, unsigned int enable
);
156 int disp_hdmi_path_clock_on(char* name
);
157 int disp_hdmi_path_clock_off(char* name
);
159 void disp_path_clear_mem_out_done_flag(void);
160 int disp_path_query(void); // return different functions according to chip type
161 int disp_bls_set_max_backlight(unsigned int level
);
163 int disp_path_config_rdma (RDMA_CONFIG_STRUCT
* pRdmaConfig
);
164 int disp_path_config_wdma (struct disp_path_config_mem_out_struct
* pConfig
);
165 int disp_path_switch_ovl_mode (struct disp_path_config_ovl_mode_t
*pConfig
);
166 int disp_path_get_mem_read_mutex (void);
167 int disp_path_release_mem_read_mutex (void);
168 int disp_path_get_mem_write_mutex (void);
169 int disp_path_release_mem_write_mutex (void);
170 int disp_path_wait_frame_done(void);
171 #if defined(CONFIG_TRUSTONIC_TEE_SUPPORT) && defined(CONFIG_MTK_SEC_VIDEO_PATH_SUPPORT)
172 int disp_path_update_secure_port(void);
175 #ifdef MTK_OVERLAY_ENGINE_SUPPORT
176 int disp_path_config_layer_ovl_engine_control(int enable
);
177 int disp_path_config_layer_ovl_engine(OVL_CONFIG_STRUCT
* pOvlConfig
,int OvlSecure
);
178 void disp_path_register_ovl_wdma_callback(void (*callback
)(unsigned int param
),unsigned int param
);
179 void disp_path_register_ovl_rdma_callback(void (*callback
)(unsigned int param
),unsigned int param
);
180 void disp_path_unregister_ovl_wdma_callback(void (*callback
)(unsigned int param
),unsigned int param
);
181 void disp_path_unregister_ovl_rdma_callback(void (*callback
)(unsigned int param
),unsigned int param
);
182 int disp_path_config_OVL_WDMA_path(int mutex_id
);
183 int disp_path_config_OVL_WDMA(struct disp_path_config_mem_out_struct
* pConfig
, int OvlSecure
);
184 void disp_path_wait_ovl_wdma_done(void);