overlay.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701
  1. /*
  2. * linux/drivers/video/omap2/dss/overlay.c
  3. *
  4. * Copyright (C) 2009 Nokia Corporation
  5. * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com>
  6. *
  7. * Some code and ideas taken from drivers/video/omap/ driver
  8. * by Imre Deak.
  9. *
  10. * This program is free software; you can redistribute it and/or modify it
  11. * under the terms of the GNU General Public License version 2 as published by
  12. * the Free Software Foundation.
  13. *
  14. * This program is distributed in the hope that it will be useful, but WITHOUT
  15. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  16. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  17. * more details.
  18. *
  19. * You should have received a copy of the GNU General Public License along with
  20. * this program. If not, see <http://www.gnu.org/licenses/>.
  21. */
  22. #define DSS_SUBSYS_NAME "OVERLAY"
  23. #include <linux/kernel.h>
  24. #include <linux/module.h>
  25. #include <linux/err.h>
  26. #include <linux/sysfs.h>
  27. #include <linux/kobject.h>
  28. #include <linux/platform_device.h>
  29. #include <linux/delay.h>
  30. #include <linux/slab.h>
  31. #include <video/omapdss.h>
  32. #include "dss.h"
  33. #include "dss_features.h"
  34. static int num_overlays;
  35. static struct omap_overlay *overlays;
  36. static ssize_t overlay_name_show(struct omap_overlay *ovl, char *buf)
  37. {
  38. return snprintf(buf, PAGE_SIZE, "%s\n", ovl->name);
  39. }
  40. static ssize_t overlay_manager_show(struct omap_overlay *ovl, char *buf)
  41. {
  42. return snprintf(buf, PAGE_SIZE, "%s\n",
  43. ovl->manager ? ovl->manager->name : "<none>");
  44. }
  45. static ssize_t overlay_manager_store(struct omap_overlay *ovl, const char *buf,
  46. size_t size)
  47. {
  48. int i, r;
  49. struct omap_overlay_manager *mgr = NULL;
  50. struct omap_overlay_manager *old_mgr;
  51. int len = size;
  52. if (buf[size-1] == '\n')
  53. --len;
  54. if (len > 0) {
  55. for (i = 0; i < omap_dss_get_num_overlay_managers(); ++i) {
  56. mgr = omap_dss_get_overlay_manager(i);
  57. if (sysfs_streq(buf, mgr->name))
  58. break;
  59. mgr = NULL;
  60. }
  61. }
  62. if (len > 0 && mgr == NULL)
  63. return -EINVAL;
  64. if (mgr)
  65. DSSDBG("manager %s found\n", mgr->name);
  66. if (mgr == ovl->manager)
  67. return size;
  68. old_mgr = ovl->manager;
  69. r = dispc_runtime_get();
  70. if (r)
  71. return r;
  72. /* detach old manager */
  73. if (old_mgr) {
  74. r = ovl->unset_manager(ovl);
  75. if (r) {
  76. DSSERR("detach failed\n");
  77. goto err;
  78. }
  79. r = old_mgr->apply(old_mgr);
  80. if (r)
  81. goto err;
  82. }
  83. if (mgr) {
  84. r = ovl->set_manager(ovl, mgr);
  85. if (r) {
  86. DSSERR("Failed to attach overlay\n");
  87. goto err;
  88. }
  89. r = mgr->apply(mgr);
  90. if (r)
  91. goto err;
  92. }
  93. dispc_runtime_put();
  94. return size;
  95. err:
  96. dispc_runtime_put();
  97. return r;
  98. }
  99. static ssize_t overlay_input_size_show(struct omap_overlay *ovl, char *buf)
  100. {
  101. struct omap_overlay_info info;
  102. ovl->get_overlay_info(ovl, &info);
  103. return snprintf(buf, PAGE_SIZE, "%d,%d\n",
  104. info.width, info.height);
  105. }
  106. static ssize_t overlay_screen_width_show(struct omap_overlay *ovl, char *buf)
  107. {
  108. struct omap_overlay_info info;
  109. ovl->get_overlay_info(ovl, &info);
  110. return snprintf(buf, PAGE_SIZE, "%d\n", info.screen_width);
  111. }
  112. static ssize_t overlay_position_show(struct omap_overlay *ovl, char *buf)
  113. {
  114. struct omap_overlay_info info;
  115. ovl->get_overlay_info(ovl, &info);
  116. return snprintf(buf, PAGE_SIZE, "%d,%d\n",
  117. info.pos_x, info.pos_y);
  118. }
  119. static ssize_t overlay_position_store(struct omap_overlay *ovl,
  120. const char *buf, size_t size)
  121. {
  122. int r;
  123. char *last;
  124. struct omap_overlay_info info;
  125. ovl->get_overlay_info(ovl, &info);
  126. info.pos_x = simple_strtoul(buf, &last, 10);
  127. ++last;
  128. if (last - buf >= size)
  129. return -EINVAL;
  130. info.pos_y = simple_strtoul(last, &last, 10);
  131. r = ovl->set_overlay_info(ovl, &info);
  132. if (r)
  133. return r;
  134. if (ovl->manager) {
  135. r = ovl->manager->apply(ovl->manager);
  136. if (r)
  137. return r;
  138. }
  139. return size;
  140. }
  141. static ssize_t overlay_output_size_show(struct omap_overlay *ovl, char *buf)
  142. {
  143. struct omap_overlay_info info;
  144. ovl->get_overlay_info(ovl, &info);
  145. return snprintf(buf, PAGE_SIZE, "%d,%d\n",
  146. info.out_width, info.out_height);
  147. }
  148. static ssize_t overlay_output_size_store(struct omap_overlay *ovl,
  149. const char *buf, size_t size)
  150. {
  151. int r;
  152. char *last;
  153. struct omap_overlay_info info;
  154. ovl->get_overlay_info(ovl, &info);
  155. info.out_width = simple_strtoul(buf, &last, 10);
  156. ++last;
  157. if (last - buf >= size)
  158. return -EINVAL;
  159. info.out_height = simple_strtoul(last, &last, 10);
  160. r = ovl->set_overlay_info(ovl, &info);
  161. if (r)
  162. return r;
  163. if (ovl->manager) {
  164. r = ovl->manager->apply(ovl->manager);
  165. if (r)
  166. return r;
  167. }
  168. return size;
  169. }
  170. static ssize_t overlay_enabled_show(struct omap_overlay *ovl, char *buf)
  171. {
  172. return snprintf(buf, PAGE_SIZE, "%d\n", ovl->is_enabled(ovl));
  173. }
  174. static ssize_t overlay_enabled_store(struct omap_overlay *ovl, const char *buf,
  175. size_t size)
  176. {
  177. int r;
  178. bool enable;
  179. r = strtobool(buf, &enable);
  180. if (r)
  181. return r;
  182. if (enable)
  183. r = ovl->enable(ovl);
  184. else
  185. r = ovl->disable(ovl);
  186. if (r)
  187. return r;
  188. return size;
  189. }
  190. static ssize_t overlay_global_alpha_show(struct omap_overlay *ovl, char *buf)
  191. {
  192. struct omap_overlay_info info;
  193. ovl->get_overlay_info(ovl, &info);
  194. return snprintf(buf, PAGE_SIZE, "%d\n",
  195. info.global_alpha);
  196. }
  197. static ssize_t overlay_global_alpha_store(struct omap_overlay *ovl,
  198. const char *buf, size_t size)
  199. {
  200. int r;
  201. u8 alpha;
  202. struct omap_overlay_info info;
  203. if ((ovl->caps & OMAP_DSS_OVL_CAP_GLOBAL_ALPHA) == 0)
  204. return -ENODEV;
  205. r = kstrtou8(buf, 0, &alpha);
  206. if (r)
  207. return r;
  208. ovl->get_overlay_info(ovl, &info);
  209. info.global_alpha = alpha;
  210. r = ovl->set_overlay_info(ovl, &info);
  211. if (r)
  212. return r;
  213. if (ovl->manager) {
  214. r = ovl->manager->apply(ovl->manager);
  215. if (r)
  216. return r;
  217. }
  218. return size;
  219. }
  220. static ssize_t overlay_pre_mult_alpha_show(struct omap_overlay *ovl,
  221. char *buf)
  222. {
  223. struct omap_overlay_info info;
  224. ovl->get_overlay_info(ovl, &info);
  225. return snprintf(buf, PAGE_SIZE, "%d\n",
  226. info.pre_mult_alpha);
  227. }
  228. static ssize_t overlay_pre_mult_alpha_store(struct omap_overlay *ovl,
  229. const char *buf, size_t size)
  230. {
  231. int r;
  232. u8 alpha;
  233. struct omap_overlay_info info;
  234. if ((ovl->caps & OMAP_DSS_OVL_CAP_PRE_MULT_ALPHA) == 0)
  235. return -ENODEV;
  236. r = kstrtou8(buf, 0, &alpha);
  237. if (r)
  238. return r;
  239. ovl->get_overlay_info(ovl, &info);
  240. info.pre_mult_alpha = alpha;
  241. r = ovl->set_overlay_info(ovl, &info);
  242. if (r)
  243. return r;
  244. if (ovl->manager) {
  245. r = ovl->manager->apply(ovl->manager);
  246. if (r)
  247. return r;
  248. }
  249. return size;
  250. }
  251. static ssize_t overlay_zorder_show(struct omap_overlay *ovl, char *buf)
  252. {
  253. struct omap_overlay_info info;
  254. ovl->get_overlay_info(ovl, &info);
  255. return snprintf(buf, PAGE_SIZE, "%d\n", info.zorder);
  256. }
  257. static ssize_t overlay_zorder_store(struct omap_overlay *ovl,
  258. const char *buf, size_t size)
  259. {
  260. int r;
  261. u8 zorder;
  262. struct omap_overlay_info info;
  263. if ((ovl->caps & OMAP_DSS_OVL_CAP_ZORDER) == 0)
  264. return -ENODEV;
  265. r = kstrtou8(buf, 0, &zorder);
  266. if (r)
  267. return r;
  268. ovl->get_overlay_info(ovl, &info);
  269. info.zorder = zorder;
  270. r = ovl->set_overlay_info(ovl, &info);
  271. if (r)
  272. return r;
  273. if (ovl->manager) {
  274. r = ovl->manager->apply(ovl->manager);
  275. if (r)
  276. return r;
  277. }
  278. return size;
  279. }
  280. struct overlay_attribute {
  281. struct attribute attr;
  282. ssize_t (*show)(struct omap_overlay *, char *);
  283. ssize_t (*store)(struct omap_overlay *, const char *, size_t);
  284. };
  285. #define OVERLAY_ATTR(_name, _mode, _show, _store) \
  286. struct overlay_attribute overlay_attr_##_name = \
  287. __ATTR(_name, _mode, _show, _store)
  288. static OVERLAY_ATTR(name, S_IRUGO, overlay_name_show, NULL);
  289. static OVERLAY_ATTR(manager, S_IRUGO|S_IWUSR,
  290. overlay_manager_show, overlay_manager_store);
  291. static OVERLAY_ATTR(input_size, S_IRUGO, overlay_input_size_show, NULL);
  292. static OVERLAY_ATTR(screen_width, S_IRUGO, overlay_screen_width_show, NULL);
  293. static OVERLAY_ATTR(position, S_IRUGO|S_IWUSR,
  294. overlay_position_show, overlay_position_store);
  295. static OVERLAY_ATTR(output_size, S_IRUGO|S_IWUSR,
  296. overlay_output_size_show, overlay_output_size_store);
  297. static OVERLAY_ATTR(enabled, S_IRUGO|S_IWUSR,
  298. overlay_enabled_show, overlay_enabled_store);
  299. static OVERLAY_ATTR(global_alpha, S_IRUGO|S_IWUSR,
  300. overlay_global_alpha_show, overlay_global_alpha_store);
  301. static OVERLAY_ATTR(pre_mult_alpha, S_IRUGO|S_IWUSR,
  302. overlay_pre_mult_alpha_show,
  303. overlay_pre_mult_alpha_store);
  304. static OVERLAY_ATTR(zorder, S_IRUGO|S_IWUSR,
  305. overlay_zorder_show, overlay_zorder_store);
  306. static struct attribute *overlay_sysfs_attrs[] = {
  307. &overlay_attr_name.attr,
  308. &overlay_attr_manager.attr,
  309. &overlay_attr_input_size.attr,
  310. &overlay_attr_screen_width.attr,
  311. &overlay_attr_position.attr,
  312. &overlay_attr_output_size.attr,
  313. &overlay_attr_enabled.attr,
  314. &overlay_attr_global_alpha.attr,
  315. &overlay_attr_pre_mult_alpha.attr,
  316. &overlay_attr_zorder.attr,
  317. NULL
  318. };
  319. static ssize_t overlay_attr_show(struct kobject *kobj, struct attribute *attr,
  320. char *buf)
  321. {
  322. struct omap_overlay *overlay;
  323. struct overlay_attribute *overlay_attr;
  324. overlay = container_of(kobj, struct omap_overlay, kobj);
  325. overlay_attr = container_of(attr, struct overlay_attribute, attr);
  326. if (!overlay_attr->show)
  327. return -ENOENT;
  328. return overlay_attr->show(overlay, buf);
  329. }
  330. static ssize_t overlay_attr_store(struct kobject *kobj, struct attribute *attr,
  331. const char *buf, size_t size)
  332. {
  333. struct omap_overlay *overlay;
  334. struct overlay_attribute *overlay_attr;
  335. overlay = container_of(kobj, struct omap_overlay, kobj);
  336. overlay_attr = container_of(attr, struct overlay_attribute, attr);
  337. if (!overlay_attr->store)
  338. return -ENOENT;
  339. return overlay_attr->store(overlay, buf, size);
  340. }
  341. static const struct sysfs_ops overlay_sysfs_ops = {
  342. .show = overlay_attr_show,
  343. .store = overlay_attr_store,
  344. };
  345. static struct kobj_type overlay_ktype = {
  346. .sysfs_ops = &overlay_sysfs_ops,
  347. .default_attrs = overlay_sysfs_attrs,
  348. };
  349. int omap_dss_get_num_overlays(void)
  350. {
  351. return num_overlays;
  352. }
  353. EXPORT_SYMBOL(omap_dss_get_num_overlays);
  354. struct omap_overlay *omap_dss_get_overlay(int num)
  355. {
  356. if (num >= num_overlays)
  357. return NULL;
  358. return &overlays[num];
  359. }
  360. EXPORT_SYMBOL(omap_dss_get_overlay);
  361. void dss_init_overlays(struct platform_device *pdev)
  362. {
  363. int i, r;
  364. num_overlays = dss_feat_get_num_ovls();
  365. overlays = kzalloc(sizeof(struct omap_overlay) * num_overlays,
  366. GFP_KERNEL);
  367. BUG_ON(overlays == NULL);
  368. for (i = 0; i < num_overlays; ++i) {
  369. struct omap_overlay *ovl = &overlays[i];
  370. switch (i) {
  371. case 0:
  372. ovl->name = "gfx";
  373. ovl->id = OMAP_DSS_GFX;
  374. break;
  375. case 1:
  376. ovl->name = "vid1";
  377. ovl->id = OMAP_DSS_VIDEO1;
  378. break;
  379. case 2:
  380. ovl->name = "vid2";
  381. ovl->id = OMAP_DSS_VIDEO2;
  382. break;
  383. case 3:
  384. ovl->name = "vid3";
  385. ovl->id = OMAP_DSS_VIDEO3;
  386. break;
  387. }
  388. ovl->is_enabled = &dss_ovl_is_enabled;
  389. ovl->enable = &dss_ovl_enable;
  390. ovl->disable = &dss_ovl_disable;
  391. ovl->set_manager = &dss_ovl_set_manager;
  392. ovl->unset_manager = &dss_ovl_unset_manager;
  393. ovl->set_overlay_info = &dss_ovl_set_info;
  394. ovl->get_overlay_info = &dss_ovl_get_info;
  395. ovl->wait_for_go = &dss_mgr_wait_for_go_ovl;
  396. ovl->caps = dss_feat_get_overlay_caps(ovl->id);
  397. ovl->supported_modes =
  398. dss_feat_get_supported_color_modes(ovl->id);
  399. r = kobject_init_and_add(&ovl->kobj, &overlay_ktype,
  400. &pdev->dev.kobj, "overlay%d", i);
  401. if (r)
  402. DSSERR("failed to create sysfs file\n");
  403. }
  404. }
  405. /* connect overlays to the new device, if not already connected. if force
  406. * selected, connect always. */
  407. void dss_recheck_connections(struct omap_dss_device *dssdev, bool force)
  408. {
  409. int i;
  410. struct omap_overlay_manager *lcd_mgr;
  411. struct omap_overlay_manager *tv_mgr;
  412. struct omap_overlay_manager *lcd2_mgr = NULL;
  413. struct omap_overlay_manager *lcd3_mgr = NULL;
  414. struct omap_overlay_manager *mgr = NULL;
  415. lcd_mgr = omap_dss_get_overlay_manager(OMAP_DSS_CHANNEL_LCD);
  416. tv_mgr = omap_dss_get_overlay_manager(OMAP_DSS_CHANNEL_DIGIT);
  417. if (dss_has_feature(FEAT_MGR_LCD3))
  418. lcd3_mgr = omap_dss_get_overlay_manager(OMAP_DSS_CHANNEL_LCD3);
  419. if (dss_has_feature(FEAT_MGR_LCD2))
  420. lcd2_mgr = omap_dss_get_overlay_manager(OMAP_DSS_CHANNEL_LCD2);
  421. if (dssdev->channel == OMAP_DSS_CHANNEL_LCD3) {
  422. if (!lcd3_mgr->device || force) {
  423. if (lcd3_mgr->device)
  424. lcd3_mgr->unset_device(lcd3_mgr);
  425. lcd3_mgr->set_device(lcd3_mgr, dssdev);
  426. mgr = lcd3_mgr;
  427. }
  428. } else if (dssdev->channel == OMAP_DSS_CHANNEL_LCD2) {
  429. if (!lcd2_mgr->device || force) {
  430. if (lcd2_mgr->device)
  431. lcd2_mgr->unset_device(lcd2_mgr);
  432. lcd2_mgr->set_device(lcd2_mgr, dssdev);
  433. mgr = lcd2_mgr;
  434. }
  435. } else if (dssdev->type != OMAP_DISPLAY_TYPE_VENC
  436. && dssdev->type != OMAP_DISPLAY_TYPE_HDMI) {
  437. if (!lcd_mgr->device || force) {
  438. if (lcd_mgr->device)
  439. lcd_mgr->unset_device(lcd_mgr);
  440. lcd_mgr->set_device(lcd_mgr, dssdev);
  441. mgr = lcd_mgr;
  442. }
  443. }
  444. if (dssdev->type == OMAP_DISPLAY_TYPE_VENC
  445. || dssdev->type == OMAP_DISPLAY_TYPE_HDMI) {
  446. if (!tv_mgr->device || force) {
  447. if (tv_mgr->device)
  448. tv_mgr->unset_device(tv_mgr);
  449. tv_mgr->set_device(tv_mgr, dssdev);
  450. mgr = tv_mgr;
  451. }
  452. }
  453. if (mgr) {
  454. dispc_runtime_get();
  455. for (i = 0; i < dss_feat_get_num_ovls(); i++) {
  456. struct omap_overlay *ovl;
  457. ovl = omap_dss_get_overlay(i);
  458. if (!ovl->manager || force) {
  459. if (ovl->manager)
  460. ovl->unset_manager(ovl);
  461. ovl->set_manager(ovl, mgr);
  462. }
  463. }
  464. dispc_runtime_put();
  465. }
  466. }
  467. void dss_uninit_overlays(struct platform_device *pdev)
  468. {
  469. int i;
  470. for (i = 0; i < num_overlays; ++i) {
  471. struct omap_overlay *ovl = &overlays[i];
  472. kobject_del(&ovl->kobj);
  473. kobject_put(&ovl->kobj);
  474. }
  475. kfree(overlays);
  476. overlays = NULL;
  477. num_overlays = 0;
  478. }
  479. int dss_ovl_simple_check(struct omap_overlay *ovl,
  480. const struct omap_overlay_info *info)
  481. {
  482. if (info->paddr == 0) {
  483. DSSERR("check_overlay: paddr cannot be 0\n");
  484. return -EINVAL;
  485. }
  486. if ((ovl->caps & OMAP_DSS_OVL_CAP_SCALE) == 0) {
  487. if (info->out_width != 0 && info->width != info->out_width) {
  488. DSSERR("check_overlay: overlay %d doesn't support "
  489. "scaling\n", ovl->id);
  490. return -EINVAL;
  491. }
  492. if (info->out_height != 0 && info->height != info->out_height) {
  493. DSSERR("check_overlay: overlay %d doesn't support "
  494. "scaling\n", ovl->id);
  495. return -EINVAL;
  496. }
  497. }
  498. if ((ovl->supported_modes & info->color_mode) == 0) {
  499. DSSERR("check_overlay: overlay %d doesn't support mode %d\n",
  500. ovl->id, info->color_mode);
  501. return -EINVAL;
  502. }
  503. if (info->zorder >= omap_dss_get_num_overlays()) {
  504. DSSERR("check_overlay: zorder %d too high\n", info->zorder);
  505. return -EINVAL;
  506. }
  507. if (dss_feat_rotation_type_supported(info->rotation_type) == 0) {
  508. DSSERR("check_overlay: rotation type %d not supported\n",
  509. info->rotation_type);
  510. return -EINVAL;
  511. }
  512. return 0;
  513. }
  514. int dss_ovl_check(struct omap_overlay *ovl, struct omap_overlay_info *info,
  515. const struct omap_video_timings *mgr_timings)
  516. {
  517. u16 outw, outh;
  518. u16 dw, dh;
  519. dw = mgr_timings->x_res;
  520. dh = mgr_timings->y_res;
  521. if ((ovl->caps & OMAP_DSS_OVL_CAP_SCALE) == 0) {
  522. outw = info->width;
  523. outh = info->height;
  524. } else {
  525. if (info->out_width == 0)
  526. outw = info->width;
  527. else
  528. outw = info->out_width;
  529. if (info->out_height == 0)
  530. outh = info->height;
  531. else
  532. outh = info->out_height;
  533. }
  534. if (dw < info->pos_x + outw) {
  535. DSSERR("overlay %d horizontally not inside the display area "
  536. "(%d + %d >= %d)\n",
  537. ovl->id, info->pos_x, outw, dw);
  538. return -EINVAL;
  539. }
  540. if (dh < info->pos_y + outh) {
  541. DSSERR("overlay %d vertically not inside the display area "
  542. "(%d + %d >= %d)\n",
  543. ovl->id, info->pos_y, outh, dh);
  544. return -EINVAL;
  545. }
  546. return 0;
  547. }
  548. /*
  549. * Checks if replication logic should be used. Only use when overlay is in
  550. * RGB12U or RGB16 mode, and video port width interface is 18bpp or 24bpp
  551. */
  552. bool dss_ovl_use_replication(struct dss_lcd_mgr_config config,
  553. enum omap_color_mode mode)
  554. {
  555. if (mode != OMAP_DSS_COLOR_RGB12U && mode != OMAP_DSS_COLOR_RGB16)
  556. return false;
  557. return config.video_port_width > 16;
  558. }