ddp_manager.c 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967
  1. /* Copyright Statement:
  2. *
  3. * This software/firmware and related documentation ("MediaTek Software") are
  4. * protected under relevant copyright laws. The information contained herein
  5. * is confidential and proprietary to MediaTek Inc. and/or its licensors.
  6. * Without the prior written permission of MediaTek inc. and/or its licensors,
  7. * any reproduction, modification, use or disclosure of MediaTek Software,
  8. * and information contained herein, in whole or in part, shall be strictly prohibited.
  9. */
  10. /* MediaTek Inc. (C) 2015. All rights reserved.
  11. *
  12. * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
  13. * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
  14. * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON
  15. * AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
  16. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
  17. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
  18. * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
  19. * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
  20. * SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH
  21. * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES
  22. * THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES
  23. * CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK
  24. * SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
  25. * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND
  26. * CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
  27. * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
  28. * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO
  29. * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
  30. */
  31. #define LOG_TAG "ddp_manager"
  32. #include <platform/ddp_reg.h>
  33. #include <platform/ddp_path.h>
  34. #include <platform/ddp_dump.h>
  35. #include <platform/ddp_manager.h>
  36. #include <platform/ddp_log.h>
  37. #include <platform/mtk_wdt.h>
  38. #define DDP_MAX_MANAGER_HANDLE (DISP_MUTEX_DDP_COUNT+DISP_MUTEX_DDP_FIRST)
  39. #define DEFAULT_IRQ_EVENT_SCENARIO (3)
  40. typedef struct {
  41. unsigned int init;
  42. DISP_PATH_EVENT event;
  43. //wait_queue_head_t wq;
  44. unsigned long long data;
  45. } DPMGR_WQ_HANDLE;
  46. typedef struct {
  47. DDP_IRQ_BIT irq_bit;
  48. } DDP_IRQ_EVENT_MAPPING;
  49. typedef struct {
  50. cmdqRecHandle cmdqhandle;
  51. int hwmutexid;
  52. int power_sate;
  53. DDP_MODE mode;
  54. //struct mutex mutex_lock;
  55. DDP_IRQ_EVENT_MAPPING irq_event_map[DISP_PATH_EVENT_NUM];
  56. DPMGR_WQ_HANDLE wq_list[DISP_PATH_EVENT_NUM];
  57. DDP_SCENARIO_ENUM scenario;
  58. disp_ddp_path_config last_config;
  59. } ddp_path_handle_t, *ddp_path_handle;
  60. typedef struct {
  61. int handle_cnt;
  62. int mutex_idx;
  63. int power_sate;
  64. //struct mutex mutex_lock;
  65. DISP_MODULE_ENUM module_usage_table[DISP_MODULE_NUM];
  66. ddp_path_handle module_path_table[DISP_MODULE_NUM];
  67. ddp_path_handle handle_pool[DDP_MAX_MANAGER_HANDLE];
  68. } DDP_MANAGER_CONTEXT;
  69. extern DDP_MODULE_DRIVER * ddp_modules_driver[DISP_MODULE_NUM];
  70. static ddp_path_handle_t g_handle;
  71. static DDP_IRQ_EVENT_MAPPING ddp_irq_event_list[DEFAULT_IRQ_EVENT_SCENARIO][DISP_PATH_EVENT_NUM] = {
  72. {
  73. //ovl0 path
  74. {DDP_IRQ_RDMA0_START }, /*FRAME_START*/
  75. {DDP_IRQ_RDMA0_DONE }, /*FRAME_DONE*/
  76. {DDP_IRQ_RDMA0_REG_UPDATE }, /*FRAME_REG_UPDATE*/
  77. {DDP_IRQ_RDMA0_TARGET_LINE }, /*FRAME_TARGET_LINE*/
  78. {DDP_IRQ_WDMA0_FRAME_COMPLETE}, /*FRAME_COMPLETE*/
  79. {DDP_IRQ_RDMA0_TARGET_LINE }, /*FRAME_STOP*/
  80. {DDP_IRQ_RDMA0_REG_UPDATE }, /*IF_CMD_DONE*/
  81. {DDP_IRQ_DSI0_EXT_TE }, /*IF_VSYNC*/
  82. {DDP_IRQ_UNKNOW }, /*AAL_TRIGER*/
  83. {DDP_IRQ_UNKNOW }, /*COLOR_TRIGER*/
  84. },
  85. {
  86. //ovl1 path
  87. {DDP_IRQ_RDMA1_START }, /*FRAME_START*/
  88. {DDP_IRQ_RDMA1_DONE }, /*FRAME_DONE*/
  89. {DDP_IRQ_RDMA1_REG_UPDATE }, /*FRAME_REG_UPDATE*/
  90. {DDP_IRQ_RDMA1_TARGET_LINE }, /*FRAME_TARGET_LINE*/
  91. {DDP_IRQ_WDMA1_FRAME_COMPLETE}, /*FRAME_COMPLETE*/
  92. {DDP_IRQ_RDMA1_TARGET_LINE }, /*FRAME_STOP*/
  93. {DDP_IRQ_RDMA1_REG_UPDATE }, /*IF_CMD_DONE*/
  94. {DDP_IRQ_RDMA1_TARGET_LINE }, /*IF_VSYNC*/
  95. {DDP_IRQ_UNKNOW }, /*AAL_TRIGER*/
  96. {DDP_IRQ_UNKNOW }, /*COLOR_TRIGER*/
  97. },
  98. {
  99. // rdma path
  100. {DDP_IRQ_RDMA2_START }, /*FRAME_START*/
  101. {DDP_IRQ_RDMA2_DONE }, /*FRAME_DONE*/
  102. {DDP_IRQ_RDMA2_REG_UPDATE }, /*FRAME_REG_UPDATE*/
  103. {DDP_IRQ_RDMA2_TARGET_LINE }, /*FRAME_TARGET_LINE*/
  104. {DDP_IRQ_UNKNOW }, /*FRAME_COMPLETE*/
  105. {DDP_IRQ_RDMA2_TARGET_LINE }, /*FRAME_STOP*/
  106. {DDP_IRQ_RDMA2_REG_UPDATE }, /*IF_CMD_DONE*/
  107. {DDP_IRQ_RDMA2_TARGET_LINE }, /*IF_VSYNC*/
  108. {DDP_IRQ_UNKNOW }, /*AAL_TRIGER*/
  109. {DDP_IRQ_UNKNOW }, /*COLOR_TRIGER*/
  110. },
  111. };
  112. static DDP_MANAGER_CONTEXT* _get_context(void)
  113. {
  114. static int is_context_inited = 0;
  115. static DDP_MANAGER_CONTEXT context;
  116. if (!is_context_inited) {
  117. memset((void*)&context, 0, sizeof(DDP_MANAGER_CONTEXT));
  118. context.mutex_idx = (1<<DISP_MUTEX_DDP_COUNT) - 1;
  119. //mutex_init(&context.mutex_lock);
  120. is_context_inited = 1;
  121. }
  122. return &context;
  123. }
  124. static int path_top_clock_off()
  125. {
  126. int i =0;
  127. DDP_MANAGER_CONTEXT * context = _get_context();
  128. if (context->power_sate) {
  129. for (i=0; i< DDP_MAX_MANAGER_HANDLE; i++) {
  130. if (context->handle_pool[i] != NULL && context->handle_pool[i]->power_sate !=0) {
  131. return 0;
  132. }
  133. }
  134. context->power_sate = 0;
  135. ddp_path_top_clock_off();
  136. }
  137. return 0;
  138. }
  139. static int path_top_clock_on()
  140. {
  141. DDP_MANAGER_CONTEXT * context = _get_context();
  142. if (!context->power_sate) {
  143. context->power_sate = 1;
  144. ddp_path_top_clock_on();
  145. }
  146. return 0;
  147. }
  148. static ddp_path_handle find_handle_by_module(DISP_MODULE_ENUM module)
  149. {
  150. return _get_context()->module_path_table[module];
  151. }
  152. static int dpmgr_module_notify(DISP_MODULE_ENUM module, DISP_PATH_EVENT event)
  153. {
  154. ddp_path_handle handle = find_handle_by_module(module);
  155. return dpmgr_signal_event(handle,event);
  156. }
  157. static int assign_default_irqs_table(DDP_SCENARIO_ENUM scenario,DDP_IRQ_EVENT_MAPPING * irq_events)
  158. {
  159. int idx = 0;
  160. switch (scenario) {
  161. case DDP_SCENARIO_PRIMARY_DISP:
  162. case DDP_SCENARIO_PRIMARY_RDMA0_COLOR0_DISP:
  163. case DDP_SCENARIO_PRIMARY_RDMA0_DISP:
  164. case DDP_SCENARIO_PRIMARY_ALL:
  165. idx = 0;
  166. break;
  167. case DDP_SCENARIO_SUB_DISP:
  168. case DDP_SCENARIO_SUB_RDMA1_DISP:
  169. case DDP_SCENARIO_SUB_OVL_MEMOUT:
  170. case DDP_SCENARIO_SUB_ALL:
  171. idx = 1;
  172. break;
  173. case DDP_SCENARIO_PRIMARY_OVL_MEMOUT:
  174. idx = 3;
  175. break;
  176. default:
  177. DISP_LOG_E("unknown scenario %d\n", scenario);
  178. }
  179. DISP_LOG_I("assign default irqs table index %d\n",idx);
  180. memcpy(irq_events,ddp_irq_event_list[idx],sizeof(ddp_irq_event_list[idx]));
  181. return 0;
  182. }
  183. static int acquire_free_bit(unsigned int total)
  184. {
  185. int free_id =0 ;
  186. while (total) {
  187. if (total & 0x1) {
  188. return free_id;
  189. }
  190. total>>=1;
  191. ++free_id;
  192. }
  193. return -1;
  194. }
  195. static int acquire_mutex(DDP_SCENARIO_ENUM scenario)
  196. {
  197. ///: primay use mutex 0
  198. int mutex_id =0 ;
  199. DDP_MANAGER_CONTEXT * content = _get_context();
  200. int mutex_idx_free = content->mutex_idx;
  201. ASSERT(scenario >= 0 && scenario < DDP_SCENARIO_MAX);
  202. while (mutex_idx_free) {
  203. if (mutex_idx_free & 0x1) {
  204. content->mutex_idx &= (~(0x1<<mutex_id));
  205. mutex_id += DISP_MUTEX_DDP_FIRST;
  206. break;
  207. }
  208. mutex_idx_free>>=1;
  209. ++mutex_id;
  210. }
  211. ASSERT(mutex_id < (DISP_MUTEX_DDP_FIRST+DISP_MUTEX_DDP_COUNT));
  212. DISP_LOG_I("scenario %s acquire mutex %d , left mutex 0x%x!\n",
  213. ddp_get_scenario_name(scenario), mutex_id, content->mutex_idx);
  214. return mutex_id;
  215. }
  216. static int release_mutex(int mutex_idx)
  217. {
  218. DDP_MANAGER_CONTEXT * content = _get_context();
  219. ASSERT(mutex_idx < (DISP_MUTEX_DDP_FIRST+DISP_MUTEX_DDP_COUNT));
  220. content->mutex_idx |= 1<< (mutex_idx-DISP_MUTEX_DDP_FIRST);
  221. DISP_LOG_I("release mutex %d , left mutex 0x%x!\n",
  222. mutex_idx, content->mutex_idx);
  223. return 0;
  224. }
  225. int dpmgr_path_set_video_mode(disp_path_handle dp_handle, int is_vdo_mode)
  226. {
  227. ddp_path_handle handle = NULL;
  228. ASSERT(dp_handle != NULL);
  229. handle = (ddp_path_handle)dp_handle;
  230. handle->mode = is_vdo_mode ? DDP_VIDEO_MODE : DDP_CMD_MODE;
  231. DISP_LOG_I("set scenario %s mode %s\n",ddp_get_scenario_name(handle->scenario),
  232. is_vdo_mode ? "Video Mode":"Cmd Mode");
  233. return 0;
  234. }
  235. static int _dpmgr_path_connect(DDP_SCENARIO_ENUM scenario, void *handle)
  236. {
  237. int i = 0, module;
  238. unsigned int *modules = ddp_get_scenario_list(scenario);
  239. int module_num = ddp_get_module_num(scenario);
  240. ddp_connect_path(scenario, handle);
  241. for (i = 0; i < module_num; i++) {
  242. module = modules[i];
  243. if (ddp_modules_driver[module] && ddp_modules_driver[module]->connect) {
  244. int prev = i == 0 ? DISP_MODULE_NONE: modules[i - 1];
  245. int next = i == module_num - 1 ? DISP_MODULE_NONE : modules[i + 1];
  246. ddp_modules_driver[module]->connect(module, prev, next, 1, handle);
  247. }
  248. }
  249. return 0;
  250. }
  251. static int _dpmgr_path_disconnect(DDP_SCENARIO_ENUM scenario, void *handle)
  252. {
  253. int i = 0, module;
  254. unsigned int *modules = ddp_get_scenario_list(scenario);
  255. int module_num = ddp_get_module_num(scenario);
  256. ddp_disconnect_path(scenario, handle);
  257. for (i = 0; i < module_num; i++) {
  258. module = modules[i];
  259. if (ddp_modules_driver[module] && ddp_modules_driver[module]->connect) {
  260. int prev = i == 0 ? DISP_MODULE_NONE : modules[i - 1];
  261. int next = i == module_num - 1 ? DISP_MODULE_NONE : modules[i + 1];
  262. ddp_modules_driver[module]->connect(module, prev, next, 1, handle);
  263. }
  264. }
  265. return 0;
  266. }
  267. disp_path_handle dpmgr_create_path(DDP_SCENARIO_ENUM scenario, cmdqRecHandle cmdq_handle)
  268. {
  269. int i =0;
  270. int module_name ;
  271. ddp_path_handle path_handle = NULL;
  272. unsigned int *modules = ddp_get_scenario_list(scenario);
  273. int module_num = ddp_get_module_num(scenario);
  274. DDP_MANAGER_CONTEXT *content = _get_context();
  275. //path_handle = kzalloc(sizeof(uint8_t*) * sizeof(ddp_path_handle_t), GFP_KERNEL);
  276. memset((void *)(&g_handle), 0, sizeof(ddp_path_handle_t));
  277. path_handle = &g_handle;
  278. if (NULL != path_handle) {
  279. path_handle->cmdqhandle = cmdq_handle;
  280. path_handle->scenario = scenario;
  281. path_handle->hwmutexid = acquire_mutex(scenario);
  282. assign_default_irqs_table(scenario,path_handle->irq_event_map);
  283. DISP_LOG_I("create handle 0x%p on scenario %s\n",path_handle,ddp_get_scenario_name(scenario));
  284. for (i=0; i< module_num; i++) {
  285. module_name = modules[i];
  286. content->module_usage_table[module_name]++;
  287. content->module_path_table[module_name] = path_handle;
  288. }
  289. content->handle_cnt++;
  290. content->handle_pool[path_handle->hwmutexid] = path_handle;
  291. } else {
  292. DISP_LOG_E("Fail to create handle on scenario %s\n",ddp_get_scenario_name(scenario));
  293. }
  294. return path_handle;
  295. }
  296. int dpmgr_destroy_path(disp_path_handle dp_handle)
  297. {
  298. int i =0;
  299. int module_name ;
  300. ASSERT(dp_handle != NULL);
  301. ddp_path_handle handle = (ddp_path_handle)dp_handle;
  302. unsigned int * modules = ddp_get_scenario_list(handle->scenario);
  303. int module_num = ddp_get_module_num(handle->scenario);
  304. DDP_MANAGER_CONTEXT * content = _get_context();
  305. DISP_LOG_I("destroy path handle 0x%p on scenario %s\n",handle,ddp_get_scenario_name(handle->scenario));
  306. if (handle != NULL) {
  307. release_mutex(handle->hwmutexid);
  308. _dpmgr_path_disconnect(handle->scenario,handle->cmdqhandle);
  309. for ( i=0; i< module_num; i++) {
  310. module_name = modules[i];
  311. content->module_usage_table[module_name]--;
  312. content->module_path_table[module_name] = NULL;
  313. }
  314. content->handle_cnt --;
  315. ASSERT(content->handle_cnt >=0);
  316. content->handle_pool[handle->hwmutexid] = NULL;
  317. // kfree(handle);
  318. }
  319. return 0;
  320. }
  321. int dpmgr_path_add_dump(disp_path_handle dp_handle, ENGINE_DUMP engine,int encmdq )
  322. {
  323. ASSERT(dp_handle != NULL);
  324. ddp_path_handle handle = (ddp_path_handle)dp_handle;
  325. ASSERT(handle->scenario ==DDP_SCENARIO_PRIMARY_DISP || handle->scenario ==DDP_SCENARIO_SUB_DISP);
  326. cmdqRecHandle cmdqHandle = encmdq ? handle->cmdqhandle : NULL;
  327. DISP_MODULE_ENUM wdma = ddp_is_scenario_on_primary(handle->scenario) ? DISP_MODULE_WDMA0: DISP_MODULE_WDMA0;
  328. // update contxt
  329. DDP_MANAGER_CONTEXT * context = _get_context();
  330. context->module_usage_table[wdma]++;
  331. context->module_path_table[wdma] = handle;
  332. handle->scenario = DDP_SCENARIO_PRIMARY_ALL;
  333. // update connected
  334. _dpmgr_path_connect(handle->scenario,cmdqHandle);
  335. ddp_mutex_set(handle->hwmutexid, handle->scenario, handle->mode, cmdqHandle);
  336. //wdma just need start.
  337. if (ddp_modules_driver[wdma] != 0) {
  338. if (ddp_modules_driver[wdma]->init!= 0) {
  339. ddp_modules_driver[wdma]->init(wdma, cmdqHandle);
  340. }
  341. if (ddp_modules_driver[wdma]->start!= 0) {
  342. ddp_modules_driver[wdma]->start(wdma, cmdqHandle);
  343. }
  344. }
  345. return 0;
  346. }
  347. int dpmgr_path_remove_dump(disp_path_handle dp_handle, int encmdq )
  348. {
  349. /*int ret = 0;*/
  350. ASSERT(dp_handle != NULL);
  351. ddp_path_handle handle = (ddp_path_handle)dp_handle;
  352. ASSERT(handle->scenario ==DDP_SCENARIO_PRIMARY_DISP || handle->scenario ==DDP_SCENARIO_PRIMARY_ALL
  353. || handle->scenario ==DDP_SCENARIO_SUB_DISP || handle->scenario ==DDP_SCENARIO_SUB_ALL);
  354. cmdqRecHandle cmdqHandle = encmdq ? handle->cmdqhandle : NULL;
  355. DISP_MODULE_ENUM wdma = ddp_is_scenario_on_primary(handle->scenario) ? DISP_MODULE_WDMA0: DISP_MODULE_WDMA0;
  356. // update contxt
  357. DDP_MANAGER_CONTEXT * context = _get_context();
  358. context->module_usage_table[wdma]--;
  359. context->module_path_table[wdma] = 0;
  360. //wdma just need stop
  361. if (ddp_modules_driver[wdma] != 0) {
  362. if (ddp_modules_driver[wdma]->stop!= 0) {
  363. ddp_modules_driver[wdma]->stop(wdma, cmdqHandle);
  364. }
  365. if (ddp_modules_driver[wdma]->deinit!= 0) {
  366. ddp_modules_driver[wdma]->deinit(wdma, cmdqHandle);
  367. }
  368. }
  369. _dpmgr_path_disconnect(DDP_SCENARIO_PRIMARY_OVL_MEMOUT,cmdqHandle);
  370. handle->scenario = DDP_SCENARIO_PRIMARY_DISP;
  371. // update connected
  372. _dpmgr_path_connect(handle->scenario,cmdqHandle);
  373. ddp_mutex_set(handle->hwmutexid, handle->scenario, handle->mode, cmdqHandle);
  374. return 0;
  375. }
  376. int dpmgr_path_set_dst_module(disp_path_handle dp_handle,DISP_MODULE_ENUM dst_module)
  377. {
  378. ASSERT(dp_handle != NULL);
  379. ddp_path_handle handle = (ddp_path_handle)dp_handle;
  380. ASSERT((handle->scenario >= 0 && handle->scenario < DDP_SCENARIO_MAX));
  381. DISP_LOG_I("set dst module on scenario %s, module %s\n",
  382. ddp_get_scenario_name(handle->scenario),ddp_get_module_name(dst_module));
  383. return ddp_set_dst_module(handle->scenario, dst_module);
  384. }
  385. DISP_MODULE_ENUM dpmgr_path_get_dst_module(disp_path_handle dp_handle)
  386. {
  387. ASSERT(dp_handle != NULL);
  388. ddp_path_handle handle = (ddp_path_handle)dp_handle;
  389. ASSERT((handle->scenario >= 0 && handle->scenario < DDP_SCENARIO_MAX));
  390. DISP_MODULE_ENUM dst_module = ddp_get_dst_module(handle->scenario);
  391. DISP_LOG_I("get dst module on scenario %s, module %s\n",
  392. ddp_get_scenario_name(handle->scenario),ddp_get_module_name(dst_module));
  393. return dst_module;
  394. }
  395. int dpmgr_path_init(disp_path_handle dp_handle, int encmdq)
  396. {
  397. int i=0;
  398. int module_name;
  399. ASSERT(dp_handle != NULL);
  400. ddp_path_handle handle = (ddp_path_handle)dp_handle;
  401. unsigned int *modules = ddp_get_scenario_list(handle->scenario);
  402. int module_num = ddp_get_module_num(handle->scenario);
  403. cmdqRecHandle cmdqHandle = encmdq ? handle->cmdqhandle : NULL;
  404. DISP_LOG_I("path init on scenario %s, number = %d\n",ddp_get_scenario_name(handle->scenario),module_num);
  405. //open top clock
  406. ddp_path_top_clock_on();
  407. //turn off m4u
  408. ddp_path_m4u_off();
  409. //init ddp_path structure
  410. ddp_path_init();
  411. /* now we start to init this path */
  412. //seting mutex
  413. ddp_mutex_set(handle->hwmutexid,
  414. handle->scenario,
  415. handle->mode,
  416. cmdqHandle);
  417. //connect path;
  418. _dpmgr_path_connect(handle->scenario, cmdqHandle);
  419. // each module init
  420. for (i=0; i< module_num; i++) {
  421. module_name = modules[i];
  422. if (ddp_modules_driver[module_name] != 0) {
  423. if (ddp_modules_driver[module_name]->init!= 0) {
  424. ddp_modules_driver[module_name]->init(module_name, cmdqHandle);
  425. DDPMSG("ddp init: %s\n", ddp_get_module_name(module_name));
  426. }
  427. if (ddp_modules_driver[module_name]->set_listener!= 0) {
  428. ddp_modules_driver[module_name]->set_listener(module_name,dpmgr_module_notify);
  429. }
  430. }
  431. }
  432. //after init this path will power on;
  433. handle->power_sate = 1;
  434. return 0;
  435. }
  436. int dpmgr_path_deinit(disp_path_handle dp_handle, int encmdq)
  437. {
  438. int i=0;
  439. int module_name ;
  440. ASSERT(dp_handle != NULL);
  441. ddp_path_handle handle = (ddp_path_handle)dp_handle;
  442. unsigned int * modules = ddp_get_scenario_list(handle->scenario);
  443. int module_num = ddp_get_module_num(handle->scenario);
  444. cmdqRecHandle cmdqHandle = encmdq ? handle->cmdqhandle : NULL;
  445. DISP_LOG_I("path deinit on scenario %s\n",ddp_get_scenario_name(handle->scenario));
  446. ddp_mutex_clear(handle->hwmutexid,cmdqHandle);
  447. _dpmgr_path_disconnect(handle->scenario, cmdqHandle);
  448. for ( i=0; i< module_num; i++) {
  449. module_name = modules[i];
  450. if (ddp_modules_driver[module_name] != 0) {
  451. if (ddp_modules_driver[module_name]->deinit!= 0) {
  452. DISP_LOG_V("scenario %s deinit module %s\n",ddp_get_scenario_name(handle->scenario),
  453. ddp_get_module_name(module_name));
  454. ddp_modules_driver[module_name]->deinit(module_name, cmdqHandle);
  455. }
  456. if (ddp_modules_driver[module_name]->set_listener!= 0) {
  457. ddp_modules_driver[module_name]->set_listener(module_name,NULL);
  458. }
  459. }
  460. }
  461. handle->power_sate = 0;
  462. //close top clock when last path init
  463. path_top_clock_off();
  464. return 0;
  465. }
  466. int dpmgr_path_start(disp_path_handle dp_handle, int encmdq)
  467. {
  468. int i=0;
  469. int module_name;
  470. ASSERT(dp_handle != NULL);
  471. ddp_path_handle handle = (ddp_path_handle)dp_handle;
  472. unsigned int *modules = ddp_get_scenario_list(handle->scenario);
  473. int module_num = ddp_get_module_num(handle->scenario);
  474. cmdqRecHandle cmdqHandle = encmdq ? handle->cmdqhandle : NULL;
  475. DISP_LOG_V("path start on scenario %s\n",ddp_get_scenario_name(handle->scenario));
  476. for ( i=0; i< module_num; i++) {
  477. module_name = modules[i];
  478. if (ddp_modules_driver[module_name] != 0) {
  479. if (ddp_modules_driver[module_name]->start!= 0) {
  480. ddp_modules_driver[module_name]->start(module_name, cmdqHandle);
  481. }
  482. }
  483. }
  484. return 0;
  485. }
  486. int dpmgr_path_stop(disp_path_handle dp_handle, int encmdq)
  487. {
  488. int i=0;
  489. int module_name ;
  490. ASSERT(dp_handle != NULL);
  491. ddp_path_handle handle = (ddp_path_handle)dp_handle;
  492. unsigned int * modules = ddp_get_scenario_list(handle->scenario);
  493. int module_num = ddp_get_module_num(handle->scenario);
  494. cmdqRecHandle cmdqHandle = encmdq ? handle->cmdqhandle : NULL;
  495. DISP_LOG_I("path stop on scenario %s\n",ddp_get_scenario_name(handle->scenario));
  496. for ( i=0; i< module_num; i++) {
  497. module_name = modules[i];
  498. if (ddp_modules_driver[module_name] != 0) {
  499. if (ddp_modules_driver[module_name]->stop!= 0) {
  500. DISP_LOG_V("scenario %s stop module %s \n",ddp_get_scenario_name(handle->scenario),
  501. ddp_get_module_name(module_name));
  502. ddp_modules_driver[module_name]->stop(module_name, cmdqHandle);
  503. }
  504. }
  505. }
  506. return 0;
  507. }
  508. int dpmgr_path_reset(disp_path_handle dp_handle, int encmdq)
  509. {
  510. int i=0;
  511. int module_name ;
  512. ASSERT(dp_handle != NULL);
  513. ddp_path_handle handle = (ddp_path_handle)dp_handle;
  514. unsigned int * modules = ddp_get_scenario_list(handle->scenario);
  515. int module_num = ddp_get_module_num(handle->scenario);
  516. cmdqRecHandle cmdqHandle = encmdq ? handle->cmdqhandle : NULL;
  517. DISP_LOG_I("path reset on scenario %s\n",ddp_get_scenario_name(handle->scenario));
  518. for ( i=0; i< module_num; i++) {
  519. module_name = modules[i];
  520. if (ddp_modules_driver[module_name] != 0) {
  521. if (ddp_modules_driver[module_name]->reset != 0) {
  522. DISP_LOG_V("scenario %s reset module %s \n",ddp_get_scenario_name(handle->scenario),
  523. ddp_get_module_name(module_name));
  524. ddp_modules_driver[module_name]->reset(module_name, cmdqHandle);
  525. }
  526. }
  527. }
  528. return 0;
  529. }
  530. static unsigned int dpmgr_is_PQ(DISP_MODULE_ENUM module)
  531. {
  532. unsigned int isPQ = 0;
  533. switch (module) {
  534. case DISP_MODULE_COLOR0:
  535. case DISP_MODULE_CCORR0:
  536. case DISP_MODULE_AAL0:
  537. case DISP_MODULE_GAMMA0:
  538. case DISP_MODULE_DITHER0:
  539. isPQ = 1;
  540. break;
  541. default:
  542. isPQ = 0;
  543. }
  544. return isPQ;
  545. }
  546. int dpmgr_path_config(disp_path_handle dp_handle, disp_ddp_path_config *config, int encmdq)
  547. {
  548. int i=0;
  549. int module_name;
  550. ASSERT(dp_handle != NULL);
  551. ddp_path_handle handle = (ddp_path_handle)dp_handle;
  552. unsigned int *modules = ddp_get_scenario_list(handle->scenario);
  553. int module_num = ddp_get_module_num(handle->scenario);
  554. cmdqRecHandle cmdqHandle = encmdq ? handle->cmdqhandle : NULL;
  555. DISP_LOG_V("path config ovl %d, rdma %d, wdma %d, dst %d on handle 0x%p scenario %s \n",
  556. config->ovl_dirty,
  557. config->rdma_dirty,
  558. config->wdma_dirty,
  559. config->dst_dirty,
  560. handle,
  561. ddp_get_scenario_name(handle->scenario));
  562. memcpy(&handle->last_config, config, sizeof(disp_ddp_path_config));
  563. for (i=0; i< module_num; i++) {
  564. module_name = modules[i];
  565. if (ddp_modules_driver[module_name] != 0) {
  566. if (ddp_modules_driver[module_name]->config!= 0) {
  567. ddp_modules_driver[module_name]->config(module_name, config, cmdqHandle);
  568. }
  569. /* now all PQ modules are bypassed by itself in LK, don't need this, just for future using */
  570. if (dpmgr_is_PQ(module_name) == 1) {
  571. if (ddp_modules_driver[module_name]->bypass != NULL)
  572. ddp_modules_driver[module_name]->bypass(module_name, 1);
  573. }
  574. }
  575. }
  576. return 0;
  577. }
  578. disp_ddp_path_config *dpmgr_path_get_last_config(disp_path_handle dp_handle)
  579. {
  580. ASSERT(dp_handle != NULL);
  581. ddp_path_handle handle = (ddp_path_handle)dp_handle;
  582. handle->last_config.ovl_dirty =0;
  583. handle->last_config.rdma_dirty =0;
  584. handle->last_config.wdma_dirty =0;
  585. handle->last_config.dst_dirty =0;
  586. return &handle->last_config;
  587. }
  588. int dpmgr_path_build_cmdq(disp_path_handle dp_handle, void *trigger_loop_handle, CMDQ_STATE state)
  589. {
  590. int i=0;
  591. int module_name ;
  592. ASSERT(dp_handle != NULL);
  593. ddp_path_handle handle = (ddp_path_handle)dp_handle;
  594. unsigned int * modules = ddp_get_scenario_list(handle->scenario);
  595. int module_num = ddp_get_module_num(handle->scenario);
  596. DISP_LOG_D("path build cmdq on scenario %s\n",ddp_get_scenario_name(handle->scenario));
  597. for ( i=0; i< module_num; i++) {
  598. module_name = modules[i];
  599. if (ddp_modules_driver[module_name] != 0) {
  600. if (ddp_modules_driver[module_name]->build_cmdq!= 0) {
  601. DISP_LOG_D("%s build cmdq, state=%d\n",ddp_get_module_name(module_name), state);
  602. ddp_modules_driver[module_name]->build_cmdq(module_name, trigger_loop_handle, state); // now just 0;
  603. }
  604. }
  605. }
  606. return 0;
  607. }
  608. int dpmgr_path_trigger(disp_path_handle dp_handle, void *trigger_loop_handle, int encmdq)
  609. {
  610. ASSERT(dp_handle != NULL);
  611. ddp_path_handle handle = (ddp_path_handle)dp_handle;
  612. DISP_LOG_V("dpmgr_path_trigger on scenario %s\n",ddp_get_scenario_name(handle->scenario));
  613. int i=0;
  614. unsigned int *modules = ddp_get_scenario_list(handle->scenario);
  615. int module_num = ddp_get_module_num(handle->scenario);
  616. int module_name;
  617. ddp_mutex_enable(handle->hwmutexid,handle->scenario,trigger_loop_handle);
  618. for (i=0; i< module_num; i++) {
  619. module_name = modules[i];
  620. if (ddp_modules_driver[module_name] != 0) {
  621. if (ddp_modules_driver[module_name]->trigger!= 0) {
  622. ddp_modules_driver[module_name]->trigger(module_name, trigger_loop_handle);
  623. }
  624. }
  625. }
  626. return 0;
  627. }
  628. int dpmgr_path_flush(disp_path_handle dp_handle,int encmdq)
  629. {
  630. ASSERT(dp_handle != NULL);
  631. ddp_path_handle handle = (ddp_path_handle)dp_handle;
  632. cmdqRecHandle cmdqHandle = encmdq ? handle->cmdqhandle : NULL;
  633. DISP_LOG_I("path flush on scenario %s\n",ddp_get_scenario_name(handle->scenario));
  634. return ddp_mutex_enable(handle->hwmutexid,handle->scenario,cmdqHandle);
  635. }
  636. int dpmgr_path_power_off(disp_path_handle dp_handle, CMDQ_SWITCH encmdq)
  637. {
  638. int i=0;
  639. int module_name ;
  640. ASSERT(dp_handle != NULL);
  641. ddp_path_handle handle = (ddp_path_handle)dp_handle;
  642. unsigned int * modules = ddp_get_scenario_list(handle->scenario);
  643. int module_num = ddp_get_module_num(handle->scenario);
  644. DISP_LOG_I("path power off on scenario %s\n",ddp_get_scenario_name(handle->scenario));
  645. for ( i=0; i< module_num; i++) {
  646. module_name = modules[i];
  647. if (ddp_modules_driver[module_name] != 0) {
  648. if (ddp_modules_driver[module_name]->power_off!= 0) {
  649. DISP_LOG_I(" %s power off\n",ddp_get_module_name(module_name));
  650. ddp_modules_driver[module_name]->power_off(module_name, encmdq?handle->cmdqhandle:NULL); // now just 0;
  651. }
  652. }
  653. }
  654. handle->power_sate = 0;
  655. path_top_clock_off();
  656. return 0;
  657. }
  658. int dpmgr_path_power_on(disp_path_handle dp_handle, CMDQ_SWITCH encmdq)
  659. {
  660. int i=0;
  661. int module_name ;
  662. ASSERT(dp_handle != NULL);
  663. ddp_path_handle handle = (ddp_path_handle)dp_handle;
  664. unsigned int * modules = ddp_get_scenario_list(handle->scenario);
  665. int module_num = ddp_get_module_num(handle->scenario);
  666. DISP_LOG_I("path power on scenario %s\n",ddp_get_scenario_name(handle->scenario));
  667. path_top_clock_on();
  668. for ( i=0; i< module_num; i++) {
  669. module_name = modules[i];
  670. if (ddp_modules_driver[module_name] != 0) {
  671. if (ddp_modules_driver[module_name]->power_on!= 0) {
  672. DISP_LOG_I("%s power on\n",ddp_get_module_name(module_name));
  673. ddp_modules_driver[module_name]->power_on(module_name, encmdq?handle->cmdqhandle:NULL); // now just 0;
  674. }
  675. }
  676. }
  677. //modules on this path will resume power on;
  678. handle->power_sate = 1;
  679. return 0;
  680. }
  681. int dpmgr_path_set_parameter(disp_path_handle dp_handle, int io_evnet, void * data)
  682. {
  683. return 0;
  684. }
  685. int dpmgr_path_get_parameter(disp_path_handle dp_handle,int io_evnet, void * data )
  686. {
  687. return 0;
  688. }
  689. int dpmgr_path_is_idle(disp_path_handle dp_handle)
  690. {
  691. ASSERT(dp_handle != NULL);
  692. return !dpmgr_path_is_busy(dp_handle);
  693. }
  694. int dpmgr_path_is_busy(disp_path_handle dp_handle)
  695. {
  696. int i=0;
  697. int module_name;
  698. ASSERT(dp_handle != NULL);
  699. ddp_path_handle handle = (ddp_path_handle)dp_handle;
  700. unsigned int *modules = ddp_get_scenario_list(handle->scenario);
  701. int module_num = ddp_get_module_num(handle->scenario);
  702. DISP_LOG_V("path check busy on scenario %s\n",ddp_get_scenario_name(handle->scenario));
  703. for (i=module_num-1; i>=0; i--) {
  704. module_name = modules[i];
  705. if (ddp_modules_driver[module_name] != 0) {
  706. if (ddp_modules_driver[module_name]->is_busy!= 0) {
  707. if (ddp_modules_driver[module_name]->is_busy(module_name)) {
  708. DISP_LOG_V("%s is busy\n", ddp_get_module_name(module_name));
  709. return 1;
  710. }
  711. }
  712. }
  713. }
  714. return 0;
  715. }
  716. int dpmgr_set_lcm_utils(disp_path_handle dp_handle, void *lcm_drv)
  717. {
  718. int i=0;
  719. int module_name;
  720. ASSERT(dp_handle != NULL);
  721. ddp_path_handle handle = (ddp_path_handle)dp_handle;
  722. unsigned int *modules = ddp_get_scenario_list(handle->scenario);
  723. int module_num = ddp_get_module_num(handle->scenario);
  724. DISP_LOG_V("path set lcm drv handle 0x%p\n",handle);
  725. for ( i=0; i< module_num; i++) {
  726. module_name = modules[i];
  727. if (ddp_modules_driver[module_name] != 0) {
  728. if ((ddp_modules_driver[module_name]->set_lcm_utils!= 0)&&lcm_drv) {
  729. DISP_LOG_I("%s set lcm utils\n",ddp_get_module_name(module_name));
  730. ddp_modules_driver[module_name]->set_lcm_utils(module_name, lcm_drv); // now just 0;
  731. }
  732. }
  733. }
  734. return 0;
  735. }
  736. int dpmgr_enable_event(disp_path_handle dp_handle, DISP_PATH_EVENT event)
  737. {
  738. ASSERT(dp_handle != NULL);
  739. ddp_path_handle handle = (ddp_path_handle)dp_handle;
  740. DPMGR_WQ_HANDLE *wq_handle = &handle->wq_list[event];
  741. DISP_LOG_I("enable event on scenario %s, event %d, irtbit 0x%x\n",
  742. ddp_get_scenario_name(handle->scenario),
  743. event,
  744. handle->irq_event_map[event].irq_bit);
  745. if (!wq_handle->init) {
  746. //init_waitqueue_head(&(wq_handle->wq));
  747. wq_handle->init = 1;
  748. wq_handle->data= 0;
  749. wq_handle->event = event;
  750. }
  751. return 0;
  752. }
  753. int dpmgr_map_event_to_irq(disp_path_handle dp_handle, DISP_PATH_EVENT event, DDP_IRQ_BIT irq_bit)
  754. {
  755. ASSERT(dp_handle != NULL);
  756. ddp_path_handle handle = (ddp_path_handle)dp_handle;
  757. DDP_IRQ_EVENT_MAPPING *irq_table = handle->irq_event_map;
  758. if (event < DISP_PATH_EVENT_NUM) {
  759. DISP_LOG_I("map event %d to irq 0x%x on scenario %s\n",event,irq_bit,ddp_get_scenario_name(handle->scenario));
  760. irq_table[event].irq_bit= irq_bit;
  761. return 0;
  762. }
  763. DISP_LOG_E("fail to map event %d to irq 0x%x on scenario %s\n",event,irq_bit,ddp_get_scenario_name(handle->scenario));
  764. return -1;
  765. }
  766. int dpmgr_disable_event(disp_path_handle dp_handle, DISP_PATH_EVENT event)
  767. {
  768. ASSERT(dp_handle != NULL);
  769. ddp_path_handle handle = (ddp_path_handle)dp_handle;
  770. DISP_LOG_I("disable event %d on scenario %s \n",event,ddp_get_scenario_name(handle->scenario));
  771. DPMGR_WQ_HANDLE *wq_handle = &handle->wq_list[event];
  772. wq_handle->init = 0;
  773. wq_handle->data= 0;
  774. return 0;
  775. }
  776. int dpmgr_check_status(disp_path_handle dp_handle)
  777. {
  778. unsigned int i =0;
  779. int module_name ;
  780. ASSERT(dp_handle != NULL);
  781. ddp_path_handle handle = (ddp_path_handle)dp_handle;
  782. unsigned int * modules = ddp_get_scenario_list(handle->scenario);
  783. unsigned int module_num = ddp_get_module_num(handle->scenario);
  784. /*dump log may take a long time, prevent WDT*/
  785. DISP_LOG_E("%s, feed dog in display, prevent WDT\n", __func__);
  786. mtk_wdt_restart();
  787. DISP_LOG_I("check status on scenario %s, module_num %d \n",
  788. ddp_get_scenario_name(handle->scenario),module_num);
  789. ddp_check_path(handle->scenario);
  790. ddp_check_mutex(handle->hwmutexid,handle->scenario,
  791. handle->mode);
  792. //ddp_check_signal(handle->scenario);
  793. for ( i=0; i< module_num; i++) {
  794. module_name = modules[i];
  795. ddp_dump_analysis(module_name);
  796. if (i == DISP_MODULE_DSI0 || i == DISP_MODULE_DSI1 || i == DISP_MODULE_DSIDUAL) {
  797. if (ddp_modules_driver[i] != 0) {
  798. if (ddp_modules_driver[i]->dump_info!= 0) {
  799. ddp_modules_driver[i]->dump_info(i, 1);
  800. }
  801. }
  802. }
  803. }
  804. ddp_dump_analysis(DISP_MODULE_CONFIG);
  805. ddp_dump_analysis(DISP_MODULE_MUTEX);
  806. for ( i=0; i< module_num; i++) {
  807. module_name = modules[i];
  808. ddp_dump_reg(module_name);
  809. }
  810. ddp_dump_reg(DISP_MODULE_CONFIG);
  811. ddp_dump_reg(DISP_MODULE_MUTEX);
  812. return 0;
  813. }
  814. int dpmgr_wait_event_timeout(disp_path_handle dp_handle, DISP_PATH_EVENT event, int timeout)
  815. {
  816. int ret = -1;
  817. ASSERT(dp_handle != NULL);
  818. ddp_path_handle handle = (ddp_path_handle)dp_handle;
  819. DPMGR_WQ_HANDLE *wq_handle = &handle->wq_list[event];
  820. DDP_IRQ_EVENT_MAPPING *irqmap = handle->irq_event_map;
  821. DISP_MODULE_ENUM module = IRQBIT_MODULE(irqmap[event].irq_bit);
  822. int q_bit = IRQBIT_BIT(irqmap[event].irq_bit);
  823. if (wq_handle->init) {
  824. //DISP_LOG_V("wait event %d timeout %d on scenario %s\n", event,timeout,ddp_get_scenario_name(handle->scenario));
  825. //should poling
  826. if (ddp_modules_driver[module] !=0 && ddp_modules_driver[module]->polling_irq != 0) {
  827. ret = ddp_modules_driver[module]->polling_irq(module, q_bit, timeout);
  828. }
  829. if (ret > 0) {
  830. //DISP_LOG_V("received event %d left time %d on scenario %s \n", event, ret,ddp_get_scenario_name(handle->scenario));
  831. } else {
  832. DISP_LOG_E("wait %d timeout ret %d on scenario %d \n", event, ret, handle->scenario);
  833. dpmgr_check_status(handle);
  834. }
  835. return ret;
  836. }
  837. DISP_LOG_E("wait event %d not initialized on scenario %s\n", event,ddp_get_scenario_name(handle->scenario));
  838. return ret;
  839. }
  840. int dpmgr_wait_event(disp_path_handle dp_handle, DISP_PATH_EVENT event)
  841. {
  842. int ret = -1;
  843. ASSERT(dp_handle != NULL);
  844. ddp_path_handle handle = (ddp_path_handle)dp_handle;
  845. DPMGR_WQ_HANDLE *wq_handle = & handle->wq_list[event];
  846. DDP_IRQ_EVENT_MAPPING *irqmap = handle->irq_event_map;
  847. DISP_MODULE_ENUM module = IRQBIT_MODULE(irqmap[event].irq_bit);
  848. int q_bit = IRQBIT_BIT(irqmap[event].irq_bit);
  849. if (wq_handle->init) {
  850. DISP_LOG_V("wait event %d on scenario %s\n", event,ddp_get_scenario_name(handle->scenario));
  851. if (ddp_modules_driver[module] !=0 && ddp_modules_driver[module]->polling_irq != 0) {
  852. ret = ddp_modules_driver[module]->polling_irq(module,q_bit,-1);
  853. }
  854. DISP_LOG_V("received event %d on scenario %s \n", event, ddp_get_scenario_name(handle->scenario));
  855. return ret;
  856. }
  857. DISP_LOG_E("wait event %d not initialized on scenario %s\n", event,ddp_get_scenario_name(handle->scenario));
  858. return ret;
  859. }
  860. int dpmgr_signal_event(disp_path_handle dp_handle, DISP_PATH_EVENT event)
  861. {
  862. ASSERT(dp_handle != NULL);
  863. ddp_path_handle handle = (ddp_path_handle)dp_handle;
  864. /*DPMGR_WQ_HANDLE *wq_handle = &handle->wq_list[event];*/
  865. if (handle->wq_list[event].init) {
  866. //wq_handle->data = sched_clock();
  867. DISP_LOG_V("wake up evnet %d on scenario %s\n", event,ddp_get_scenario_name(handle->scenario));
  868. //wake_up_interruptible(&(handle->wq_list[event].wq));
  869. }
  870. return 0;
  871. }
  872. int dpmgr_init(void)
  873. {
  874. DISP_LOG_I("ddp manager init\n");
  875. return 0;
  876. }