ddp_manager.c 32 KB

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