ddp_manager.c 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968
  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_manager.h>
  35. #include <platform/ddp_log.h>
  36. #include <platform/ddp_dump.h>
  37. #include <string.h>//For memcpy, memset
  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[DDP_SCENARIO_MAX];
  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_UNKNOWN : modules[i - 1];
  245. int next = i == module_num - 1 ? DISP_MODULE_UNKNOWN : 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_UNKNOWN : modules[i - 1];
  261. int next = i == module_num - 1 ? DISP_MODULE_UNKNOWN : 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 s = 0;
  271. int module_name ;
  272. ddp_path_handle path_handle = NULL;
  273. unsigned int *modules = ddp_get_scenario_list(scenario);
  274. int module_num = ddp_get_module_num(scenario);
  275. DDP_MANAGER_CONTEXT *content = _get_context();
  276. //path_handle = kzalloc(sizeof(uint8_t*) * sizeof(ddp_path_handle_t), GFP_KERNEL);
  277. if (scenario == DDP_SCENARIO_PRIMARY_DISP)
  278. s = 0;
  279. else if (scenario == DDP_SCENARIO_SUB_DISP)
  280. s = 1;
  281. memset((void *)(&g_handle[s]), 0, sizeof(ddp_path_handle_t));
  282. path_handle = &g_handle[s];
  283. if (NULL != path_handle) {
  284. path_handle->cmdqhandle = cmdq_handle;
  285. path_handle->scenario = scenario;
  286. path_handle->hwmutexid = acquire_mutex(scenario);
  287. assign_default_irqs_table(scenario,path_handle->irq_event_map);
  288. DISP_LOG_I("create handle 0x%p on scenario %s\n",path_handle,ddp_get_scenario_name(scenario));
  289. for (i=0; i< module_num; i++) {
  290. module_name = modules[i];
  291. content->module_usage_table[module_name]++;
  292. content->module_path_table[module_name] = path_handle;
  293. }
  294. content->handle_cnt++;
  295. content->handle_pool[path_handle->hwmutexid] = path_handle;
  296. } else {
  297. DISP_LOG_E("Fail to create handle on scenario %s\n",ddp_get_scenario_name(scenario));
  298. }
  299. return path_handle;
  300. }
  301. int dpmgr_destroy_path(disp_path_handle dp_handle)
  302. {
  303. int i =0;
  304. int module_name ;
  305. ASSERT(dp_handle != NULL);
  306. ddp_path_handle handle = (ddp_path_handle)dp_handle;
  307. unsigned int * modules = ddp_get_scenario_list(handle->scenario);
  308. int module_num = ddp_get_module_num(handle->scenario);
  309. DDP_MANAGER_CONTEXT * content = _get_context();
  310. DISP_LOG_I("destroy path handle 0x%p on scenario %s\n",handle,ddp_get_scenario_name(handle->scenario));
  311. if (handle != NULL) {
  312. release_mutex(handle->hwmutexid);
  313. _dpmgr_path_disconnect(handle->scenario,handle->cmdqhandle);
  314. for ( i=0; i< module_num; i++) {
  315. module_name = modules[i];
  316. content->module_usage_table[module_name]--;
  317. content->module_path_table[module_name] = NULL;
  318. }
  319. content->handle_cnt --;
  320. ASSERT(content->handle_cnt >=0);
  321. content->handle_pool[handle->hwmutexid] = NULL;
  322. // kfree(handle);
  323. }
  324. return 0;
  325. }
  326. int dpmgr_path_add_dump(disp_path_handle dp_handle, ENGINE_DUMP engine,int encmdq )
  327. {
  328. ASSERT(dp_handle != NULL);
  329. ddp_path_handle handle = (ddp_path_handle)dp_handle;
  330. ASSERT(handle->scenario ==DDP_SCENARIO_PRIMARY_DISP || handle->scenario ==DDP_SCENARIO_SUB_DISP);
  331. cmdqRecHandle cmdqHandle = encmdq ? handle->cmdqhandle : NULL;
  332. DISP_MODULE_ENUM wdma = ddp_is_scenario_on_primary(handle->scenario) ? DISP_MODULE_WDMA0: DISP_MODULE_WDMA0;
  333. // update contxt
  334. DDP_MANAGER_CONTEXT * context = _get_context();
  335. context->module_usage_table[wdma]++;
  336. context->module_path_table[wdma] = handle;
  337. handle->scenario = DDP_SCENARIO_PRIMARY_ALL;
  338. // update connected
  339. _dpmgr_path_connect(handle->scenario,cmdqHandle);
  340. ddp_mutex_set(handle->hwmutexid, handle->scenario, handle->mode, cmdqHandle);
  341. //wdma just need start.
  342. if (ddp_modules_driver[wdma] != 0) {
  343. if (ddp_modules_driver[wdma]->init!= 0) {
  344. ddp_modules_driver[wdma]->init(wdma, cmdqHandle);
  345. }
  346. if (ddp_modules_driver[wdma]->start!= 0) {
  347. ddp_modules_driver[wdma]->start(wdma, cmdqHandle);
  348. }
  349. }
  350. return 0;
  351. }
  352. int dpmgr_path_remove_dump(disp_path_handle dp_handle, int encmdq )
  353. {
  354. /*int ret = 0;*/
  355. ASSERT(dp_handle != NULL);
  356. ddp_path_handle handle = (ddp_path_handle)dp_handle;
  357. ASSERT(handle->scenario ==DDP_SCENARIO_PRIMARY_DISP || handle->scenario ==DDP_SCENARIO_PRIMARY_ALL
  358. || handle->scenario ==DDP_SCENARIO_SUB_DISP || handle->scenario ==DDP_SCENARIO_SUB_ALL);
  359. cmdqRecHandle cmdqHandle = encmdq ? handle->cmdqhandle : NULL;
  360. DISP_MODULE_ENUM wdma = ddp_is_scenario_on_primary(handle->scenario) ? DISP_MODULE_WDMA0: DISP_MODULE_WDMA0;
  361. // update contxt
  362. DDP_MANAGER_CONTEXT * context = _get_context();
  363. context->module_usage_table[wdma]--;
  364. context->module_path_table[wdma] = 0;
  365. //wdma just need stop
  366. if (ddp_modules_driver[wdma] != 0) {
  367. if (ddp_modules_driver[wdma]->stop!= 0) {
  368. ddp_modules_driver[wdma]->stop(wdma, cmdqHandle);
  369. }
  370. if (ddp_modules_driver[wdma]->deinit!= 0) {
  371. ddp_modules_driver[wdma]->deinit(wdma, cmdqHandle);
  372. }
  373. }
  374. _dpmgr_path_disconnect(DDP_SCENARIO_PRIMARY_OVL_MEMOUT,cmdqHandle);
  375. handle->scenario = DDP_SCENARIO_PRIMARY_DISP;
  376. // update connected
  377. _dpmgr_path_connect(handle->scenario,cmdqHandle);
  378. ddp_mutex_set(handle->hwmutexid, handle->scenario, handle->mode, cmdqHandle);
  379. return 0;
  380. }
  381. int dpmgr_path_set_dst_module(disp_path_handle dp_handle,DISP_MODULE_ENUM dst_module)
  382. {
  383. ASSERT(dp_handle != NULL);
  384. ddp_path_handle handle = (ddp_path_handle)dp_handle;
  385. ASSERT((handle->scenario >= 0 && handle->scenario < DDP_SCENARIO_MAX));
  386. DISP_LOG_I("set dst module on scenario %s, module %s\n",
  387. ddp_get_scenario_name(handle->scenario),ddp_get_module_name(dst_module));
  388. return ddp_set_dst_module(handle->scenario, dst_module);
  389. }
  390. DISP_MODULE_ENUM dpmgr_path_get_dst_module(disp_path_handle dp_handle)
  391. {
  392. ASSERT(dp_handle != NULL);
  393. ddp_path_handle handle = (ddp_path_handle)dp_handle;
  394. ASSERT((handle->scenario >= 0 && handle->scenario < DDP_SCENARIO_MAX));
  395. DISP_MODULE_ENUM dst_module = ddp_get_dst_module(handle->scenario);
  396. DISP_LOG_I("get dst module on scenario %s, module %s\n",
  397. ddp_get_scenario_name(handle->scenario),ddp_get_module_name(dst_module));
  398. return dst_module;
  399. }
  400. int dpmgr_path_init(disp_path_handle dp_handle, int encmdq)
  401. {
  402. int i=0;
  403. int module_name;
  404. ASSERT(dp_handle != NULL);
  405. ddp_path_handle handle = (ddp_path_handle)dp_handle;
  406. unsigned int *modules = ddp_get_scenario_list(handle->scenario);
  407. int module_num = ddp_get_module_num(handle->scenario);
  408. cmdqRecHandle cmdqHandle = encmdq ? handle->cmdqhandle : NULL;
  409. DISP_LOG_I("path init on scenario %s\n",ddp_get_scenario_name(handle->scenario));
  410. //open top clock
  411. path_top_clock_on();
  412. //turn off m4u
  413. ddp_path_m4u_off();
  414. //init ddp_path structure
  415. ddp_path_init();
  416. /* now we start to init this path */
  417. //seting mutex
  418. ddp_mutex_set(handle->hwmutexid,
  419. handle->scenario,
  420. handle->mode,
  421. cmdqHandle);
  422. //connect path;
  423. _dpmgr_path_connect(handle->scenario, cmdqHandle);
  424. // each module init
  425. for (i=0; i< module_num; i++) {
  426. module_name = modules[i];
  427. if (ddp_modules_driver[module_name] != 0) {
  428. if (ddp_modules_driver[module_name]->init!= 0) {
  429. ddp_modules_driver[module_name]->init(module_name, cmdqHandle);
  430. }
  431. if (ddp_modules_driver[module_name]->set_listener!= 0) {
  432. ddp_modules_driver[module_name]->set_listener(module_name,dpmgr_module_notify);
  433. }
  434. }
  435. }
  436. //after init this path will power on;
  437. handle->power_sate = 1;
  438. return 0;
  439. }
  440. int dpmgr_path_deinit(disp_path_handle dp_handle, int encmdq)
  441. {
  442. int i=0;
  443. int module_name ;
  444. ASSERT(dp_handle != NULL);
  445. ddp_path_handle handle = (ddp_path_handle)dp_handle;
  446. unsigned int * modules = ddp_get_scenario_list(handle->scenario);
  447. int module_num = ddp_get_module_num(handle->scenario);
  448. cmdqRecHandle cmdqHandle = encmdq ? handle->cmdqhandle : NULL;
  449. DISP_LOG_I("path deinit on scenario %s\n",ddp_get_scenario_name(handle->scenario));
  450. ddp_mutex_clear(handle->hwmutexid,cmdqHandle);
  451. _dpmgr_path_disconnect(handle->scenario, cmdqHandle);
  452. for ( i=0; i< module_num; i++) {
  453. module_name = modules[i];
  454. if (ddp_modules_driver[module_name] != 0) {
  455. if (ddp_modules_driver[module_name]->deinit!= 0) {
  456. DISP_LOG_V("scenario %s deinit module %s\n",ddp_get_scenario_name(handle->scenario),
  457. ddp_get_module_name(module_name));
  458. ddp_modules_driver[module_name]->deinit(module_name, cmdqHandle);
  459. }
  460. if (ddp_modules_driver[module_name]->set_listener!= 0) {
  461. ddp_modules_driver[module_name]->set_listener(module_name,NULL);
  462. }
  463. }
  464. }
  465. handle->power_sate = 0;
  466. //close top clock when last path init
  467. path_top_clock_off();
  468. return 0;
  469. }
  470. int dpmgr_path_start(disp_path_handle dp_handle, int encmdq)
  471. {
  472. int i=0;
  473. int module_name;
  474. ASSERT(dp_handle != NULL);
  475. ddp_path_handle handle = (ddp_path_handle)dp_handle;
  476. unsigned int *modules = ddp_get_scenario_list(handle->scenario);
  477. int module_num = ddp_get_module_num(handle->scenario);
  478. cmdqRecHandle cmdqHandle = encmdq ? handle->cmdqhandle : NULL;
  479. DISP_LOG_V("path start on scenario %s\n",ddp_get_scenario_name(handle->scenario));
  480. for ( i=0; i< module_num; i++) {
  481. module_name = modules[i];
  482. if (ddp_modules_driver[module_name] != 0) {
  483. if (ddp_modules_driver[module_name]->start!= 0) {
  484. ddp_modules_driver[module_name]->start(module_name, cmdqHandle);
  485. }
  486. }
  487. }
  488. return 0;
  489. }
  490. int dpmgr_path_stop(disp_path_handle dp_handle, int encmdq)
  491. {
  492. int i=0;
  493. int module_name ;
  494. ASSERT(dp_handle != NULL);
  495. ddp_path_handle handle = (ddp_path_handle)dp_handle;
  496. unsigned int * modules = ddp_get_scenario_list(handle->scenario);
  497. int module_num = ddp_get_module_num(handle->scenario);
  498. cmdqRecHandle cmdqHandle = encmdq ? handle->cmdqhandle : NULL;
  499. DISP_LOG_I("path stop on scenario %s\n",ddp_get_scenario_name(handle->scenario));
  500. for ( i=0; i< module_num; i++) {
  501. module_name = modules[i];
  502. if (ddp_modules_driver[module_name] != 0) {
  503. if (ddp_modules_driver[module_name]->stop!= 0) {
  504. DISP_LOG_V("scenario %s stop module %s \n",ddp_get_scenario_name(handle->scenario),
  505. ddp_get_module_name(module_name));
  506. ddp_modules_driver[module_name]->stop(module_name, cmdqHandle);
  507. }
  508. }
  509. }
  510. return 0;
  511. }
  512. int dpmgr_path_reset(disp_path_handle dp_handle, int encmdq)
  513. {
  514. int i=0;
  515. int module_name ;
  516. ASSERT(dp_handle != NULL);
  517. ddp_path_handle handle = (ddp_path_handle)dp_handle;
  518. unsigned int * modules = ddp_get_scenario_list(handle->scenario);
  519. int module_num = ddp_get_module_num(handle->scenario);
  520. cmdqRecHandle cmdqHandle = encmdq ? handle->cmdqhandle : NULL;
  521. DISP_LOG_I("path reset on scenario %s\n",ddp_get_scenario_name(handle->scenario));
  522. for ( i=0; i< module_num; i++) {
  523. module_name = modules[i];
  524. if (ddp_modules_driver[module_name] != 0) {
  525. if (ddp_modules_driver[module_name]->reset != 0) {
  526. DISP_LOG_V("scenario %s reset module %s \n",ddp_get_scenario_name(handle->scenario),
  527. ddp_get_module_name(module_name));
  528. ddp_modules_driver[module_name]->reset(module_name, cmdqHandle);
  529. }
  530. }
  531. }
  532. return 0;
  533. }
  534. static unsigned int dpmgr_is_PQ(DISP_MODULE_ENUM module)
  535. {
  536. unsigned int isPQ = 0;
  537. switch (module) {
  538. case DISP_MODULE_COLOR0:
  539. case DISP_MODULE_CCORR0:
  540. case DISP_MODULE_AAL0:
  541. case DISP_MODULE_GAMMA0:
  542. case DISP_MODULE_DITHER0:
  543. isPQ = 1;
  544. break;
  545. default:
  546. isPQ = 0;
  547. }
  548. return isPQ;
  549. }
  550. int dpmgr_path_config(disp_path_handle dp_handle, disp_ddp_path_config *config, int encmdq)
  551. {
  552. int i=0;
  553. int module_name;
  554. ASSERT(dp_handle != NULL);
  555. ddp_path_handle handle = (ddp_path_handle)dp_handle;
  556. unsigned int *modules = ddp_get_scenario_list(handle->scenario);
  557. int module_num = ddp_get_module_num(handle->scenario);
  558. cmdqRecHandle cmdqHandle = encmdq ? handle->cmdqhandle : NULL;
  559. DISP_LOG_V("path config ovl %d, rdma %d, wdma %d, dst %d on handle 0x%p scenario %s \n",
  560. config->ovl_dirty,
  561. config->rdma_dirty,
  562. config->wdma_dirty,
  563. config->dst_dirty,
  564. handle,
  565. ddp_get_scenario_name(handle->scenario));
  566. memcpy(&handle->last_config, config, sizeof(disp_ddp_path_config));
  567. for (i=0; i< module_num; i++) {
  568. module_name = modules[i];
  569. if (ddp_modules_driver[module_name] != 0) {
  570. if (ddp_modules_driver[module_name]->config!= 0) {
  571. ddp_modules_driver[module_name]->config(module_name, config, cmdqHandle);
  572. }
  573. /* now all PQ modules are bypassed by itself in LK, don't need this, just for future using */
  574. if (dpmgr_is_PQ(module_name) == 1) {
  575. if (ddp_modules_driver[module_name]->bypass != NULL)
  576. ddp_modules_driver[module_name]->bypass(module_name, 1);
  577. }
  578. }
  579. }
  580. return 0;
  581. }
  582. disp_ddp_path_config *dpmgr_path_get_last_config(disp_path_handle dp_handle)
  583. {
  584. ASSERT(dp_handle != NULL);
  585. ddp_path_handle handle = (ddp_path_handle)dp_handle;
  586. handle->last_config.ovl_dirty =0;
  587. handle->last_config.rdma_dirty =0;
  588. handle->last_config.wdma_dirty =0;
  589. handle->last_config.dst_dirty =0;
  590. return &handle->last_config;
  591. }
  592. int dpmgr_path_build_cmdq(disp_path_handle dp_handle, void *trigger_loop_handle, CMDQ_STATE state)
  593. {
  594. int i=0;
  595. int module_name ;
  596. ASSERT(dp_handle != NULL);
  597. ddp_path_handle handle = (ddp_path_handle)dp_handle;
  598. unsigned int * modules = ddp_get_scenario_list(handle->scenario);
  599. int module_num = ddp_get_module_num(handle->scenario);
  600. DISP_LOG_D("path build cmdq on scenario %s\n",ddp_get_scenario_name(handle->scenario));
  601. for ( i=0; i< module_num; i++) {
  602. module_name = modules[i];
  603. if (ddp_modules_driver[module_name] != 0) {
  604. if (ddp_modules_driver[module_name]->build_cmdq!= 0) {
  605. DISP_LOG_D("%s build cmdq, state=%d\n",ddp_get_module_name(module_name), state);
  606. ddp_modules_driver[module_name]->build_cmdq(module_name, trigger_loop_handle, state); // now just 0;
  607. }
  608. }
  609. }
  610. return 0;
  611. }
  612. int dpmgr_path_trigger(disp_path_handle dp_handle, void *trigger_loop_handle, int encmdq)
  613. {
  614. ASSERT(dp_handle != NULL);
  615. ddp_path_handle handle = (ddp_path_handle)dp_handle;
  616. DISP_LOG_V("dpmgr_path_trigger on scenario %s\n",ddp_get_scenario_name(handle->scenario));
  617. /*cmdqRecHandle cmdqHandle = encmdq ? handle->cmdqhandle : NULL;*/
  618. int i=0;
  619. unsigned int *modules = ddp_get_scenario_list(handle->scenario);
  620. int module_num = ddp_get_module_num(handle->scenario);
  621. int module_name;
  622. ddp_mutex_enable(handle->hwmutexid,handle->scenario,trigger_loop_handle);
  623. for (i=0; i< module_num; i++) {
  624. module_name = modules[i];
  625. if (ddp_modules_driver[module_name] != 0) {
  626. if (ddp_modules_driver[module_name]->trigger!= 0) {
  627. ddp_modules_driver[module_name]->trigger(module_name, trigger_loop_handle);
  628. }
  629. }
  630. }
  631. return 0;
  632. }
  633. int dpmgr_path_flush(disp_path_handle dp_handle,int encmdq)
  634. {
  635. ASSERT(dp_handle != NULL);
  636. ddp_path_handle handle = (ddp_path_handle)dp_handle;
  637. cmdqRecHandle cmdqHandle = encmdq ? handle->cmdqhandle : NULL;
  638. DISP_LOG_I("path flush on scenario %s\n",ddp_get_scenario_name(handle->scenario));
  639. return ddp_mutex_enable(handle->hwmutexid,handle->scenario,cmdqHandle);
  640. }
  641. int dpmgr_path_power_off(disp_path_handle dp_handle, CMDQ_SWITCH encmdq)
  642. {
  643. int i=0;
  644. int module_name ;
  645. ASSERT(dp_handle != NULL);
  646. ddp_path_handle handle = (ddp_path_handle)dp_handle;
  647. unsigned int * modules = ddp_get_scenario_list(handle->scenario);
  648. int module_num = ddp_get_module_num(handle->scenario);
  649. DISP_LOG_I("path power off on scenario %s\n",ddp_get_scenario_name(handle->scenario));
  650. for ( i=0; i< module_num; i++) {
  651. module_name = modules[i];
  652. if (ddp_modules_driver[module_name] != 0) {
  653. if (ddp_modules_driver[module_name]->power_off!= 0) {
  654. DISP_LOG_I(" %s power off\n",ddp_get_module_name(module_name));
  655. ddp_modules_driver[module_name]->power_off(module_name, encmdq?handle->cmdqhandle:NULL); // now just 0;
  656. }
  657. }
  658. }
  659. handle->power_sate = 0;
  660. path_top_clock_off();
  661. return 0;
  662. }
  663. int dpmgr_path_power_on(disp_path_handle dp_handle, CMDQ_SWITCH encmdq)
  664. {
  665. int i=0;
  666. int module_name ;
  667. ASSERT(dp_handle != NULL);
  668. ddp_path_handle handle = (ddp_path_handle)dp_handle;
  669. unsigned int * modules = ddp_get_scenario_list(handle->scenario);
  670. int module_num = ddp_get_module_num(handle->scenario);
  671. DISP_LOG_I("path power on scenario %s\n",ddp_get_scenario_name(handle->scenario));
  672. path_top_clock_on();
  673. for ( i=0; i< module_num; i++) {
  674. module_name = modules[i];
  675. if (ddp_modules_driver[module_name] != 0) {
  676. if (ddp_modules_driver[module_name]->power_on!= 0) {
  677. DISP_LOG_I("%s power on\n",ddp_get_module_name(module_name));
  678. ddp_modules_driver[module_name]->power_on(module_name, encmdq?handle->cmdqhandle:NULL); // now just 0;
  679. }
  680. }
  681. }
  682. //modules on this path will resume power on;
  683. handle->power_sate = 1;
  684. return 0;
  685. }
  686. int dpmgr_path_set_parameter(disp_path_handle dp_handle, int io_evnet, void * data)
  687. {
  688. return 0;
  689. }
  690. int dpmgr_path_get_parameter(disp_path_handle dp_handle,int io_evnet, void * data )
  691. {
  692. return 0;
  693. }
  694. int dpmgr_path_is_idle(disp_path_handle dp_handle)
  695. {
  696. ASSERT(dp_handle != NULL);
  697. return !dpmgr_path_is_busy(dp_handle);
  698. }
  699. int dpmgr_path_is_busy(disp_path_handle dp_handle)
  700. {
  701. int i=0;
  702. int module_name;
  703. ASSERT(dp_handle != NULL);
  704. ddp_path_handle handle = (ddp_path_handle)dp_handle;
  705. unsigned int *modules = ddp_get_scenario_list(handle->scenario);
  706. int module_num = ddp_get_module_num(handle->scenario);
  707. DISP_LOG_V("path check busy on scenario %s\n",ddp_get_scenario_name(handle->scenario));
  708. for (i=module_num-1; i>=0; i--) {
  709. module_name = modules[i];
  710. if (ddp_modules_driver[module_name] != 0) {
  711. if (ddp_modules_driver[module_name]->is_busy!= 0) {
  712. if (ddp_modules_driver[module_name]->is_busy(module_name)) {
  713. DISP_LOG_V("%s is busy\n", ddp_get_module_name(module_name));
  714. return 1;
  715. }
  716. }
  717. }
  718. }
  719. return 0;
  720. }
  721. int dpmgr_set_lcm_utils(disp_path_handle dp_handle, void *lcm_drv)
  722. {
  723. unsigned int i=0;
  724. int module_name;
  725. ASSERT(dp_handle != NULL);
  726. ddp_path_handle handle = (ddp_path_handle)dp_handle;
  727. unsigned int *modules = ddp_get_scenario_list(handle->scenario);
  728. unsigned int module_num = ddp_get_module_num(handle->scenario);
  729. DISP_LOG_V("path set lcm drv handle 0x%p\n",handle);
  730. for ( i=0; i< module_num; i++) {
  731. module_name = modules[i];
  732. if (ddp_modules_driver[module_name] != 0) {
  733. if ((ddp_modules_driver[module_name]->set_lcm_utils!= 0)&&lcm_drv) {
  734. DISP_LOG_I("%s set lcm utils\n",ddp_get_module_name(module_name));
  735. ddp_modules_driver[module_name]->set_lcm_utils(module_name, lcm_drv); // now just 0;
  736. }
  737. }
  738. }
  739. return 0;
  740. }
  741. int dpmgr_enable_event(disp_path_handle dp_handle, DISP_PATH_EVENT event)
  742. {
  743. ASSERT(dp_handle != NULL);
  744. ddp_path_handle handle = (ddp_path_handle)dp_handle;
  745. DPMGR_WQ_HANDLE *wq_handle = &handle->wq_list[event];
  746. DISP_LOG_I("enable event on scenario %s, event %d, irtbit 0x%x\n",
  747. ddp_get_scenario_name(handle->scenario),
  748. event,
  749. handle->irq_event_map[event].irq_bit);
  750. if (!wq_handle->init) {
  751. //init_waitqueue_head(&(wq_handle->wq));
  752. wq_handle->init = 1;
  753. wq_handle->data= 0;
  754. wq_handle->event = event;
  755. }
  756. return 0;
  757. }
  758. int dpmgr_map_event_to_irq(disp_path_handle dp_handle, DISP_PATH_EVENT event, DDP_IRQ_BIT irq_bit)
  759. {
  760. ASSERT(dp_handle != NULL);
  761. ddp_path_handle handle = (ddp_path_handle)dp_handle;
  762. DDP_IRQ_EVENT_MAPPING *irq_table = handle->irq_event_map;
  763. if (event < DISP_PATH_EVENT_NUM) {
  764. DISP_LOG_I("map event %d to irq 0x%x on scenario %s\n",event,irq_bit,ddp_get_scenario_name(handle->scenario));
  765. irq_table[event].irq_bit= irq_bit;
  766. return 0;
  767. }
  768. 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));
  769. return -1;
  770. }
  771. int dpmgr_disable_event(disp_path_handle dp_handle, DISP_PATH_EVENT event)
  772. {
  773. ASSERT(dp_handle != NULL);
  774. ddp_path_handle handle = (ddp_path_handle)dp_handle;
  775. DISP_LOG_I("disable event %d on scenario %s \n",event,ddp_get_scenario_name(handle->scenario));
  776. DPMGR_WQ_HANDLE *wq_handle = &handle->wq_list[event];
  777. wq_handle->init = 0;
  778. wq_handle->data= 0;
  779. return 0;
  780. }
  781. int dpmgr_check_status(disp_path_handle dp_handle)
  782. {
  783. unsigned int i =0;
  784. int module_name ;
  785. ASSERT(dp_handle != NULL);
  786. ddp_path_handle handle = (ddp_path_handle)dp_handle;
  787. unsigned int * modules = ddp_get_scenario_list(handle->scenario);
  788. unsigned int module_num = ddp_get_module_num(handle->scenario);
  789. DISP_LOG_I("check status on scenario %s, module_num %d \n",
  790. ddp_get_scenario_name(handle->scenario),module_num);
  791. ddp_check_path(handle->scenario);
  792. ddp_check_mutex(handle->hwmutexid,handle->scenario,
  793. handle->mode);
  794. //ddp_check_signal(handle->scenario);
  795. for ( i=0; i< module_num; i++) {
  796. module_name = modules[i];
  797. ddp_dump_analysis(module_name);
  798. if (i == DISP_MODULE_DSI0 || i == DISP_MODULE_DSI1 || i == DISP_MODULE_DSIDUAL) {
  799. if (ddp_modules_driver[i] != 0) {
  800. if (ddp_modules_driver[i]->dump_info!= 0) {
  801. ddp_modules_driver[i]->dump_info(i, 1);
  802. }
  803. }
  804. }
  805. }
  806. ddp_dump_analysis(DISP_MODULE_CONFIG);
  807. ddp_dump_analysis(DISP_MODULE_MUTEX);
  808. for ( i=0; i< module_num; i++) {
  809. module_name = modules[i];
  810. ddp_dump_reg(module_name);
  811. }
  812. ddp_dump_reg(DISP_MODULE_CONFIG);
  813. ddp_dump_reg(DISP_MODULE_MUTEX);
  814. return 0;
  815. }
  816. int dpmgr_wait_event_timeout(disp_path_handle dp_handle, DISP_PATH_EVENT event, int timeout)
  817. {
  818. int ret = -1;
  819. ASSERT(dp_handle != NULL);
  820. ddp_path_handle handle = (ddp_path_handle)dp_handle;
  821. DPMGR_WQ_HANDLE *wq_handle = &handle->wq_list[event];
  822. DDP_IRQ_EVENT_MAPPING *irqmap = handle->irq_event_map;
  823. DISP_MODULE_ENUM module = IRQBIT_MODULE(irqmap[event].irq_bit);
  824. int q_bit = IRQBIT_BIT(irqmap[event].irq_bit);
  825. if (wq_handle->init) {
  826. //DISP_LOG_V("wait event %d timeout %d on scenario %s\n", event,timeout,ddp_get_scenario_name(handle->scenario));
  827. //should poling
  828. if (ddp_modules_driver[module] !=0 && ddp_modules_driver[module]->polling_irq != 0) {
  829. ret = ddp_modules_driver[module]->polling_irq(module, q_bit, timeout);
  830. }
  831. if (ret > 0) {
  832. //DISP_LOG_V("received event %d left time %d on scenario %s \n", event, ret,ddp_get_scenario_name(handle->scenario));
  833. } else {
  834. DISP_LOG_E("wait %d timeout ret %d on scenario %d \n", event, ret, handle->scenario);
  835. dpmgr_check_status(handle);
  836. }
  837. return ret;
  838. }
  839. DISP_LOG_E("wait event %d not initialized on scenario %s\n", event,ddp_get_scenario_name(handle->scenario));
  840. return ret;
  841. }
  842. int dpmgr_wait_event(disp_path_handle dp_handle, DISP_PATH_EVENT event)
  843. {
  844. int ret = -1;
  845. ASSERT(dp_handle != NULL);
  846. ddp_path_handle handle = (ddp_path_handle)dp_handle;
  847. DPMGR_WQ_HANDLE *wq_handle = & handle->wq_list[event];
  848. DDP_IRQ_EVENT_MAPPING *irqmap = handle->irq_event_map;
  849. DISP_MODULE_ENUM module = IRQBIT_MODULE(irqmap[event].irq_bit);
  850. int q_bit = IRQBIT_BIT(irqmap[event].irq_bit);
  851. if (wq_handle->init) {
  852. DISP_LOG_V("wait event %d on scenario %s\n", event,ddp_get_scenario_name(handle->scenario));
  853. if (ddp_modules_driver[module] !=0 && ddp_modules_driver[module]->polling_irq != 0) {
  854. ret = ddp_modules_driver[module]->polling_irq(module,q_bit,-1);
  855. }
  856. DISP_LOG_V("received event %d on scenario %s \n", event, ddp_get_scenario_name(handle->scenario));
  857. return ret;
  858. }
  859. DISP_LOG_E("wait event %d not initialized on scenario %s\n", event,ddp_get_scenario_name(handle->scenario));
  860. return ret;
  861. }
  862. int dpmgr_signal_event(disp_path_handle dp_handle, DISP_PATH_EVENT event)
  863. {
  864. ASSERT(dp_handle != NULL);
  865. ddp_path_handle handle = (ddp_path_handle)dp_handle;
  866. /*DPMGR_WQ_HANDLE *wq_handle = &handle->wq_list[event];*/
  867. if (handle->wq_list[event].init) {
  868. //wq_handle->data = sched_clock();
  869. DISP_LOG_V("wake up evnet %d on scenario %s\n", event,ddp_get_scenario_name(handle->scenario));
  870. //wake_up_interruptible(&(handle->wq_list[event].wq));
  871. }
  872. return 0;
  873. }
  874. int dpmgr_init(void)
  875. {
  876. DISP_LOG_I("ddp manager init\n");
  877. return 0;
  878. }