@@ -52,6 +52,7 @@ enum mtk_ovl_adaptor_comp_id {
5252
5353struct ovl_adaptor_comp_match {
5454 enum mtk_ovl_adaptor_comp_type type ;
55+ enum mtk_ddp_comp_id comp_id ;
5556 int alias_id ;
5657};
5758
@@ -68,19 +69,19 @@ static const char * const private_comp_stem[OVL_ADAPTOR_TYPE_NUM] = {
6869};
6970
7071static const struct ovl_adaptor_comp_match comp_matches [OVL_ADAPTOR_ID_MAX ] = {
71- [OVL_ADAPTOR_MDP_RDMA0 ] = { OVL_ADAPTOR_TYPE_MDP_RDMA , 0 },
72- [OVL_ADAPTOR_MDP_RDMA1 ] = { OVL_ADAPTOR_TYPE_MDP_RDMA , 1 },
73- [OVL_ADAPTOR_MDP_RDMA2 ] = { OVL_ADAPTOR_TYPE_MDP_RDMA , 2 },
74- [OVL_ADAPTOR_MDP_RDMA3 ] = { OVL_ADAPTOR_TYPE_MDP_RDMA , 3 },
75- [OVL_ADAPTOR_MDP_RDMA4 ] = { OVL_ADAPTOR_TYPE_MDP_RDMA , 4 },
76- [OVL_ADAPTOR_MDP_RDMA5 ] = { OVL_ADAPTOR_TYPE_MDP_RDMA , 5 },
77- [OVL_ADAPTOR_MDP_RDMA6 ] = { OVL_ADAPTOR_TYPE_MDP_RDMA , 6 },
78- [OVL_ADAPTOR_MDP_RDMA7 ] = { OVL_ADAPTOR_TYPE_MDP_RDMA , 7 },
79- [OVL_ADAPTOR_MERGE0 ] = { OVL_ADAPTOR_TYPE_MERGE , 1 },
80- [OVL_ADAPTOR_MERGE1 ] = { OVL_ADAPTOR_TYPE_MERGE , 2 },
81- [OVL_ADAPTOR_MERGE2 ] = { OVL_ADAPTOR_TYPE_MERGE , 3 },
82- [OVL_ADAPTOR_MERGE3 ] = { OVL_ADAPTOR_TYPE_MERGE , 4 },
83- [OVL_ADAPTOR_ETHDR0 ] = { OVL_ADAPTOR_TYPE_ETHDR , 0 },
72+ [OVL_ADAPTOR_MDP_RDMA0 ] = { OVL_ADAPTOR_TYPE_MDP_RDMA , DDP_COMPONENT_MDP_RDMA0 , 0 },
73+ [OVL_ADAPTOR_MDP_RDMA1 ] = { OVL_ADAPTOR_TYPE_MDP_RDMA , DDP_COMPONENT_MDP_RDMA1 , 1 },
74+ [OVL_ADAPTOR_MDP_RDMA2 ] = { OVL_ADAPTOR_TYPE_MDP_RDMA , DDP_COMPONENT_MDP_RDMA2 , 2 },
75+ [OVL_ADAPTOR_MDP_RDMA3 ] = { OVL_ADAPTOR_TYPE_MDP_RDMA , DDP_COMPONENT_MDP_RDMA3 , 3 },
76+ [OVL_ADAPTOR_MDP_RDMA4 ] = { OVL_ADAPTOR_TYPE_MDP_RDMA , DDP_COMPONENT_MDP_RDMA4 , 4 },
77+ [OVL_ADAPTOR_MDP_RDMA5 ] = { OVL_ADAPTOR_TYPE_MDP_RDMA , DDP_COMPONENT_MDP_RDMA5 , 5 },
78+ [OVL_ADAPTOR_MDP_RDMA6 ] = { OVL_ADAPTOR_TYPE_MDP_RDMA , DDP_COMPONENT_MDP_RDMA6 , 6 },
79+ [OVL_ADAPTOR_MDP_RDMA7 ] = { OVL_ADAPTOR_TYPE_MDP_RDMA , DDP_COMPONENT_MDP_RDMA7 , 7 },
80+ [OVL_ADAPTOR_MERGE0 ] = { OVL_ADAPTOR_TYPE_MERGE , DDP_COMPONENT_MERGE1 , 1 },
81+ [OVL_ADAPTOR_MERGE1 ] = { OVL_ADAPTOR_TYPE_MERGE , DDP_COMPONENT_MERGE2 , 2 },
82+ [OVL_ADAPTOR_MERGE2 ] = { OVL_ADAPTOR_TYPE_MERGE , DDP_COMPONENT_MERGE3 , 3 },
83+ [OVL_ADAPTOR_MERGE3 ] = { OVL_ADAPTOR_TYPE_MERGE , DDP_COMPONENT_MERGE4 , 4 },
84+ [OVL_ADAPTOR_ETHDR0 ] = { OVL_ADAPTOR_TYPE_ETHDR , DDP_COMPONENT_ETHDR_MIXER , 0 },
8485};
8586
8687void mtk_ovl_adaptor_layer_config (struct device * dev , unsigned int idx ,
@@ -314,36 +315,26 @@ size_t mtk_ovl_adaptor_get_num_formats(struct device *dev)
314315
315316void mtk_ovl_adaptor_add_comp (struct device * dev , struct mtk_mutex * mutex )
316317{
317- mtk_mutex_add_comp (mutex , DDP_COMPONENT_MDP_RDMA0 );
318- mtk_mutex_add_comp (mutex , DDP_COMPONENT_MDP_RDMA1 );
319- mtk_mutex_add_comp (mutex , DDP_COMPONENT_MDP_RDMA2 );
320- mtk_mutex_add_comp (mutex , DDP_COMPONENT_MDP_RDMA3 );
321- mtk_mutex_add_comp (mutex , DDP_COMPONENT_MDP_RDMA4 );
322- mtk_mutex_add_comp (mutex , DDP_COMPONENT_MDP_RDMA5 );
323- mtk_mutex_add_comp (mutex , DDP_COMPONENT_MDP_RDMA6 );
324- mtk_mutex_add_comp (mutex , DDP_COMPONENT_MDP_RDMA7 );
325- mtk_mutex_add_comp (mutex , DDP_COMPONENT_MERGE1 );
326- mtk_mutex_add_comp (mutex , DDP_COMPONENT_MERGE2 );
327- mtk_mutex_add_comp (mutex , DDP_COMPONENT_MERGE3 );
328- mtk_mutex_add_comp (mutex , DDP_COMPONENT_MERGE4 );
329- mtk_mutex_add_comp (mutex , DDP_COMPONENT_ETHDR_MIXER );
318+ int i ;
319+ struct mtk_disp_ovl_adaptor * ovl_adaptor = dev_get_drvdata (dev );
320+
321+ for (i = 0 ; i < OVL_ADAPTOR_ID_MAX ; i ++ ) {
322+ if (!ovl_adaptor -> ovl_adaptor_comp [i ])
323+ continue ;
324+ mtk_mutex_add_comp (mutex , comp_matches [i ].comp_id );
325+ }
330326}
331327
332328void mtk_ovl_adaptor_remove_comp (struct device * dev , struct mtk_mutex * mutex )
333329{
334- mtk_mutex_remove_comp (mutex , DDP_COMPONENT_MDP_RDMA0 );
335- mtk_mutex_remove_comp (mutex , DDP_COMPONENT_MDP_RDMA1 );
336- mtk_mutex_remove_comp (mutex , DDP_COMPONENT_MDP_RDMA2 );
337- mtk_mutex_remove_comp (mutex , DDP_COMPONENT_MDP_RDMA3 );
338- mtk_mutex_remove_comp (mutex , DDP_COMPONENT_MDP_RDMA4 );
339- mtk_mutex_remove_comp (mutex , DDP_COMPONENT_MDP_RDMA5 );
340- mtk_mutex_remove_comp (mutex , DDP_COMPONENT_MDP_RDMA6 );
341- mtk_mutex_remove_comp (mutex , DDP_COMPONENT_MDP_RDMA7 );
342- mtk_mutex_remove_comp (mutex , DDP_COMPONENT_MERGE1 );
343- mtk_mutex_remove_comp (mutex , DDP_COMPONENT_MERGE2 );
344- mtk_mutex_remove_comp (mutex , DDP_COMPONENT_MERGE3 );
345- mtk_mutex_remove_comp (mutex , DDP_COMPONENT_MERGE4 );
346- mtk_mutex_remove_comp (mutex , DDP_COMPONENT_ETHDR_MIXER );
330+ int i ;
331+ struct mtk_disp_ovl_adaptor * ovl_adaptor = dev_get_drvdata (dev );
332+
333+ for (i = 0 ; i < OVL_ADAPTOR_ID_MAX ; i ++ ) {
334+ if (!ovl_adaptor -> ovl_adaptor_comp [i ])
335+ continue ;
336+ mtk_mutex_remove_comp (mutex , comp_matches [i ].comp_id );
337+ }
347338}
348339
349340void mtk_ovl_adaptor_connect (struct device * dev , struct device * mmsys_dev , unsigned int next )
0 commit comments