msm_media_info.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607
  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. /*
  3. * Copyright (c) 2020-2021,, The Linux Foundation. All rights reserved.
  4. */
  5. #ifndef __MSM_MEDIA_INFO_H__
  6. #define __MSM_MEDIA_INFO_H__
  7. #include <media/v4l2_vidc_extensions.h>
  8. #include <linux/videodev2.h>
  9. /* Width and Height should be multiple of 16 */
  10. #define INTERLACE_WIDTH_MAX 1920
  11. #define INTERLACE_HEIGHT_MAX 1920
  12. #define INTERLACE_MB_PER_FRAME_MAX ((1920*1088)/256)
  13. #ifndef MSM_MEDIA_ALIGN
  14. #define MSM_MEDIA_ALIGN(__sz, __align) (((__align) & ((__align) - 1)) ?\
  15. ((((__sz) + (__align) - 1) / (__align)) * (__align)) :\
  16. (((__sz) + (__align) - 1) & (~((__align) - 1))))
  17. #endif
  18. #ifndef MSM_MEDIA_ROUNDUP
  19. #define MSM_MEDIA_ROUNDUP(__sz, __r) (((__sz) + ((__r) - 1)) / (__r))
  20. #endif
  21. /*
  22. * Function arguments:
  23. * @v4l2_fmt
  24. * @width
  25. * Progressive: width
  26. * Interlaced: width
  27. */
  28. static inline unsigned int VIDEO_Y_STRIDE_BYTES(unsigned int v4l2_fmt,
  29. unsigned int width)
  30. {
  31. unsigned int alignment, stride = 0;
  32. if (!width)
  33. goto invalid_input;
  34. switch (v4l2_fmt) {
  35. case V4L2_PIX_FMT_NV12:
  36. case V4L2_PIX_FMT_NV21:
  37. case V4L2_PIX_FMT_VIDC_NV12C:
  38. alignment = 128;
  39. stride = MSM_MEDIA_ALIGN(width, alignment);
  40. break;
  41. case V4L2_PIX_FMT_VIDC_TP10C:
  42. alignment = 256;
  43. stride = MSM_MEDIA_ALIGN(width, 192);
  44. stride = MSM_MEDIA_ALIGN(stride * 4/3, alignment);
  45. break;
  46. case V4L2_PIX_FMT_VIDC_P010:
  47. alignment = 256;
  48. stride = MSM_MEDIA_ALIGN(width * 2, alignment);
  49. break;
  50. default:
  51. break;
  52. }
  53. invalid_input:
  54. return stride;
  55. }
  56. /*
  57. * Function arguments:
  58. * @v4l2_fmt
  59. * @width
  60. * Progressive: width
  61. * Interlaced: width
  62. */
  63. static inline unsigned int VIDEO_Y_STRIDE_PIX(unsigned int v4l2_fmt,
  64. unsigned int width)
  65. {
  66. unsigned int alignment, stride = 0;
  67. if (!width)
  68. goto invalid_input;
  69. switch (v4l2_fmt) {
  70. case V4L2_PIX_FMT_NV12:
  71. case V4L2_PIX_FMT_NV21:
  72. case V4L2_PIX_FMT_VIDC_NV12C:
  73. alignment = 128;
  74. stride = MSM_MEDIA_ALIGN(width, alignment);
  75. break;
  76. case V4L2_PIX_FMT_VIDC_TP10C:
  77. alignment = 192;
  78. stride = MSM_MEDIA_ALIGN(width, alignment);
  79. break;
  80. case V4L2_PIX_FMT_VIDC_P010:
  81. alignment = 256;
  82. stride = MSM_MEDIA_ALIGN(width, alignment);
  83. break;
  84. default:
  85. break;
  86. }
  87. invalid_input:
  88. return stride;
  89. }
  90. /*
  91. * Function arguments:
  92. * @v4l2_fmt
  93. * @width
  94. * Progressive: width
  95. * Interlaced: width
  96. */
  97. static inline unsigned int VIDEO_UV_STRIDE_BYTES(unsigned int v4l2_fmt,
  98. unsigned int width)
  99. {
  100. unsigned int alignment, stride = 0;
  101. if (!width)
  102. goto invalid_input;
  103. switch (v4l2_fmt) {
  104. case V4L2_PIX_FMT_NV21:
  105. case V4L2_PIX_FMT_NV12:
  106. case V4L2_PIX_FMT_VIDC_NV12C:
  107. alignment = 128;
  108. stride = MSM_MEDIA_ALIGN(width, alignment);
  109. break;
  110. case V4L2_PIX_FMT_VIDC_TP10C:
  111. alignment = 256;
  112. stride = MSM_MEDIA_ALIGN(width, 192);
  113. stride = MSM_MEDIA_ALIGN(stride * 4/3, alignment);
  114. break;
  115. case V4L2_PIX_FMT_VIDC_P010:
  116. alignment = 256;
  117. stride = MSM_MEDIA_ALIGN(width * 2, alignment);
  118. break;
  119. default:
  120. break;
  121. }
  122. invalid_input:
  123. return stride;
  124. }
  125. /*
  126. * Function arguments:
  127. * @v4l2_fmt
  128. * @width
  129. * Progressive: width
  130. * Interlaced: width
  131. */
  132. static inline unsigned int VIDEO_UV_STRIDE_PIX(unsigned int v4l2_fmt,
  133. unsigned int width)
  134. {
  135. unsigned int alignment, stride = 0;
  136. if (!width)
  137. goto invalid_input;
  138. switch (v4l2_fmt) {
  139. case V4L2_PIX_FMT_NV21:
  140. case V4L2_PIX_FMT_NV12:
  141. case V4L2_PIX_FMT_VIDC_NV12C:
  142. alignment = 128;
  143. stride = MSM_MEDIA_ALIGN(width, alignment);
  144. break;
  145. case V4L2_PIX_FMT_VIDC_TP10C:
  146. alignment = 192;
  147. stride = MSM_MEDIA_ALIGN(width, alignment);
  148. break;
  149. case V4L2_PIX_FMT_VIDC_P010:
  150. alignment = 256;
  151. stride = MSM_MEDIA_ALIGN(width, alignment);
  152. break;
  153. default:
  154. break;
  155. }
  156. invalid_input:
  157. return stride;
  158. }
  159. /*
  160. * Function arguments:
  161. * @v4l2_fmt
  162. * @height
  163. * Progressive: height
  164. * Interlaced: (height+1)>>1
  165. */
  166. static inline unsigned int VIDEO_Y_SCANLINES(unsigned int v4l2_fmt,
  167. unsigned int height)
  168. {
  169. unsigned int alignment, sclines = 0;
  170. if (!height)
  171. goto invalid_input;
  172. switch (v4l2_fmt) {
  173. case V4L2_PIX_FMT_NV12:
  174. case V4L2_PIX_FMT_NV21:
  175. case V4L2_PIX_FMT_VIDC_NV12C:
  176. case V4L2_PIX_FMT_VIDC_P010:
  177. alignment = 32;
  178. break;
  179. case V4L2_PIX_FMT_VIDC_TP10C:
  180. alignment = 16;
  181. break;
  182. default:
  183. return 0;
  184. }
  185. sclines = MSM_MEDIA_ALIGN(height, alignment);
  186. invalid_input:
  187. return sclines;
  188. }
  189. /*
  190. * Function arguments:
  191. * @v4l2_fmt
  192. * @height
  193. * Progressive: height
  194. * Interlaced: (height+1)>>1
  195. */
  196. static inline unsigned int VIDEO_UV_SCANLINES(unsigned int v4l2_fmt,
  197. unsigned int height)
  198. {
  199. unsigned int alignment, sclines = 0;
  200. if (!height)
  201. goto invalid_input;
  202. switch (v4l2_fmt) {
  203. case V4L2_PIX_FMT_NV21:
  204. case V4L2_PIX_FMT_NV12:
  205. case V4L2_PIX_FMT_VIDC_TP10C:
  206. case V4L2_PIX_FMT_VIDC_P010:
  207. alignment = 16;
  208. break;
  209. case V4L2_PIX_FMT_VIDC_NV12C:
  210. alignment = 32;
  211. break;
  212. default:
  213. goto invalid_input;
  214. }
  215. sclines = MSM_MEDIA_ALIGN((height+1)>>1, alignment);
  216. invalid_input:
  217. return sclines;
  218. }
  219. /*
  220. * Function arguments:
  221. * @v4l2_fmt
  222. * @width
  223. * Progressive: width
  224. * Interlaced: width
  225. */
  226. static inline unsigned int VIDEO_Y_META_STRIDE(unsigned int v4l2_fmt,
  227. unsigned int width)
  228. {
  229. int y_tile_width = 0, y_meta_stride = 0;
  230. if (!width)
  231. goto invalid_input;
  232. switch (v4l2_fmt) {
  233. case V4L2_PIX_FMT_VIDC_NV12C:
  234. y_tile_width = 32;
  235. break;
  236. case V4L2_PIX_FMT_VIDC_TP10C:
  237. y_tile_width = 48;
  238. break;
  239. default:
  240. goto invalid_input;
  241. }
  242. y_meta_stride = MSM_MEDIA_ROUNDUP(width, y_tile_width);
  243. y_meta_stride = MSM_MEDIA_ALIGN(y_meta_stride, 64);
  244. invalid_input:
  245. return y_meta_stride;
  246. }
  247. /*
  248. * Function arguments:
  249. * @v4l2_fmt
  250. * @height
  251. * Progressive: height
  252. * Interlaced: (height+1)>>1
  253. */
  254. static inline unsigned int VIDEO_Y_META_SCANLINES(unsigned int v4l2_fmt,
  255. unsigned int height)
  256. {
  257. int y_tile_height = 0, y_meta_scanlines = 0;
  258. if (!height)
  259. goto invalid_input;
  260. switch (v4l2_fmt) {
  261. case V4L2_PIX_FMT_VIDC_NV12C:
  262. y_tile_height = 8;
  263. break;
  264. case V4L2_PIX_FMT_VIDC_TP10C:
  265. y_tile_height = 4;
  266. break;
  267. default:
  268. goto invalid_input;
  269. }
  270. y_meta_scanlines = MSM_MEDIA_ROUNDUP(height, y_tile_height);
  271. y_meta_scanlines = MSM_MEDIA_ALIGN(y_meta_scanlines, 16);
  272. invalid_input:
  273. return y_meta_scanlines;
  274. }
  275. /*
  276. * Function arguments:
  277. * @v4l2_fmt
  278. * @width
  279. * Progressive: width
  280. * Interlaced: width
  281. */
  282. static inline unsigned int VIDEO_UV_META_STRIDE(unsigned int v4l2_fmt,
  283. unsigned int width)
  284. {
  285. int uv_tile_width = 0, uv_meta_stride = 0;
  286. if (!width)
  287. goto invalid_input;
  288. switch (v4l2_fmt) {
  289. case V4L2_PIX_FMT_VIDC_NV12C:
  290. uv_tile_width = 16;
  291. break;
  292. case V4L2_PIX_FMT_VIDC_TP10C:
  293. uv_tile_width = 24;
  294. break;
  295. default:
  296. goto invalid_input;
  297. }
  298. uv_meta_stride = MSM_MEDIA_ROUNDUP((width+1)>>1, uv_tile_width);
  299. uv_meta_stride = MSM_MEDIA_ALIGN(uv_meta_stride, 64);
  300. invalid_input:
  301. return uv_meta_stride;
  302. }
  303. /*
  304. * Function arguments:
  305. * @v4l2_fmt
  306. * @height
  307. * Progressive: height
  308. * Interlaced: (height+1)>>1
  309. */
  310. static inline unsigned int VIDEO_UV_META_SCANLINES(unsigned int v4l2_fmt,
  311. unsigned int height)
  312. {
  313. int uv_tile_height = 0, uv_meta_scanlines = 0;
  314. if (!height)
  315. goto invalid_input;
  316. switch (v4l2_fmt) {
  317. case V4L2_PIX_FMT_VIDC_NV12C:
  318. uv_tile_height = 8;
  319. break;
  320. case V4L2_PIX_FMT_VIDC_TP10C:
  321. uv_tile_height = 4;
  322. break;
  323. default:
  324. goto invalid_input;
  325. }
  326. uv_meta_scanlines = MSM_MEDIA_ROUNDUP((height+1)>>1, uv_tile_height);
  327. uv_meta_scanlines = MSM_MEDIA_ALIGN(uv_meta_scanlines, 16);
  328. invalid_input:
  329. return uv_meta_scanlines;
  330. }
  331. static inline unsigned int VIDEO_RGB_STRIDE_BYTES(unsigned int v4l2_fmt,
  332. unsigned int width)
  333. {
  334. unsigned int alignment = 0, stride = 0, bpp = 4;
  335. if (!width)
  336. goto invalid_input;
  337. switch (v4l2_fmt) {
  338. case V4L2_PIX_FMT_VIDC_ARGB32C:
  339. case V4L2_PIX_FMT_RGBA32:
  340. alignment = 256;
  341. break;
  342. default:
  343. goto invalid_input;
  344. }
  345. stride = MSM_MEDIA_ALIGN(width * bpp, alignment);
  346. invalid_input:
  347. return stride;
  348. }
  349. static inline unsigned int VIDEO_RGB_STRIDE_PIX(unsigned int v4l2_fmt,
  350. unsigned int width)
  351. {
  352. unsigned int bpp = 4;
  353. return VIDEO_RGB_STRIDE_BYTES(v4l2_fmt, width) / bpp;
  354. }
  355. static inline unsigned int VIDEO_RGB_SCANLINES(unsigned int v4l2_fmt,
  356. unsigned int height)
  357. {
  358. unsigned int alignment = 0, scanlines = 0;
  359. if (!height)
  360. goto invalid_input;
  361. switch (v4l2_fmt) {
  362. case V4L2_PIX_FMT_VIDC_ARGB32C:
  363. case V4L2_PIX_FMT_RGBA32:
  364. alignment = 16;
  365. break;
  366. default:
  367. goto invalid_input;
  368. }
  369. scanlines = MSM_MEDIA_ALIGN(height, alignment);
  370. invalid_input:
  371. return scanlines;
  372. }
  373. static inline unsigned int VIDEO_RGB_META_STRIDE(unsigned int v4l2_fmt,
  374. unsigned int width)
  375. {
  376. int rgb_tile_width = 0, rgb_meta_stride = 0;
  377. if (!width)
  378. goto invalid_input;
  379. switch (v4l2_fmt) {
  380. case V4L2_PIX_FMT_VIDC_ARGB32C:
  381. case V4L2_PIX_FMT_RGBA32:
  382. rgb_tile_width = 16;
  383. break;
  384. default:
  385. goto invalid_input;
  386. }
  387. rgb_meta_stride = MSM_MEDIA_ROUNDUP(width, rgb_tile_width);
  388. rgb_meta_stride = MSM_MEDIA_ALIGN(rgb_meta_stride, 64);
  389. invalid_input:
  390. return rgb_meta_stride;
  391. }
  392. static inline unsigned int VIDEO_RGB_META_SCANLINES(unsigned int v4l2_fmt,
  393. unsigned int height)
  394. {
  395. int rgb_tile_height = 0, rgb_meta_scanlines = 0;
  396. if (!height)
  397. goto invalid_input;
  398. switch (v4l2_fmt) {
  399. case V4L2_PIX_FMT_VIDC_ARGB32C:
  400. case V4L2_PIX_FMT_RGBA32:
  401. rgb_tile_height = 4;
  402. break;
  403. default:
  404. goto invalid_input;
  405. }
  406. rgb_meta_scanlines = MSM_MEDIA_ROUNDUP(height, rgb_tile_height);
  407. rgb_meta_scanlines = MSM_MEDIA_ALIGN(rgb_meta_scanlines, 16);
  408. invalid_input:
  409. return rgb_meta_scanlines;
  410. }
  411. static inline unsigned int VIDEO_RAW_BUFFER_SIZE(unsigned int v4l2_fmt,
  412. unsigned int pix_width, unsigned int pix_height, unsigned int interlace)
  413. {
  414. unsigned int size = 0;
  415. unsigned int y_plane, uv_plane, y_stride,
  416. uv_stride, y_sclines, uv_sclines;
  417. unsigned int y_ubwc_plane = 0, uv_ubwc_plane = 0;
  418. unsigned int y_meta_stride = 0, y_meta_scanlines = 0;
  419. unsigned int uv_meta_stride = 0, uv_meta_scanlines = 0;
  420. unsigned int y_meta_plane = 0, uv_meta_plane = 0;
  421. unsigned int rgb_stride = 0, rgb_scanlines = 0;
  422. unsigned int rgb_plane = 0, rgb_ubwc_plane = 0, rgb_meta_plane = 0;
  423. unsigned int rgb_meta_stride = 0, rgb_meta_scanlines = 0;
  424. if (!pix_width || !pix_height)
  425. goto invalid_input;
  426. y_stride = VIDEO_Y_STRIDE_BYTES(v4l2_fmt, pix_width);
  427. uv_stride = VIDEO_UV_STRIDE_BYTES(v4l2_fmt, pix_width);
  428. y_sclines = VIDEO_Y_SCANLINES(v4l2_fmt, pix_height);
  429. uv_sclines = VIDEO_UV_SCANLINES(v4l2_fmt, pix_height);
  430. rgb_stride = VIDEO_RGB_STRIDE_BYTES(v4l2_fmt, pix_width);
  431. rgb_scanlines = VIDEO_RGB_SCANLINES(v4l2_fmt, pix_height);
  432. switch (v4l2_fmt) {
  433. case V4L2_PIX_FMT_NV21:
  434. case V4L2_PIX_FMT_NV12:
  435. case V4L2_PIX_FMT_VIDC_P010:
  436. y_plane = y_stride * y_sclines;
  437. uv_plane = uv_stride * uv_sclines;
  438. size = y_plane + uv_plane;
  439. break;
  440. case V4L2_PIX_FMT_VIDC_NV12C:
  441. y_meta_stride = VIDEO_Y_META_STRIDE(v4l2_fmt, pix_width);
  442. uv_meta_stride = VIDEO_UV_META_STRIDE(v4l2_fmt, pix_width);
  443. if (!interlace && v4l2_fmt == V4L2_PIX_FMT_VIDC_NV12C) {
  444. y_ubwc_plane = MSM_MEDIA_ALIGN(y_stride * y_sclines, 4096);
  445. uv_ubwc_plane = MSM_MEDIA_ALIGN(uv_stride * uv_sclines, 4096);
  446. y_meta_scanlines =
  447. VIDEO_Y_META_SCANLINES(v4l2_fmt, pix_height);
  448. y_meta_plane = MSM_MEDIA_ALIGN(
  449. y_meta_stride * y_meta_scanlines, 4096);
  450. uv_meta_scanlines =
  451. VIDEO_UV_META_SCANLINES(v4l2_fmt, pix_height);
  452. uv_meta_plane = MSM_MEDIA_ALIGN(uv_meta_stride *
  453. uv_meta_scanlines, 4096);
  454. size = (y_ubwc_plane + uv_ubwc_plane + y_meta_plane +
  455. uv_meta_plane);
  456. size = MSM_MEDIA_ALIGN(size, 4096);
  457. } else {
  458. if (pix_width <= INTERLACE_WIDTH_MAX &&
  459. pix_height <= INTERLACE_HEIGHT_MAX &&
  460. (pix_height * pix_width) / 256 <= INTERLACE_MB_PER_FRAME_MAX) {
  461. y_sclines =
  462. VIDEO_Y_SCANLINES(v4l2_fmt, (pix_height+1)>>1);
  463. y_ubwc_plane =
  464. MSM_MEDIA_ALIGN(y_stride * y_sclines, 4096);
  465. uv_sclines =
  466. VIDEO_UV_SCANLINES(v4l2_fmt, (pix_height+1)>>1);
  467. uv_ubwc_plane =
  468. MSM_MEDIA_ALIGN(uv_stride * uv_sclines, 4096);
  469. y_meta_scanlines =
  470. VIDEO_Y_META_SCANLINES(v4l2_fmt, (pix_height+1)>>1);
  471. y_meta_plane = MSM_MEDIA_ALIGN(
  472. y_meta_stride * y_meta_scanlines, 4096);
  473. uv_meta_scanlines =
  474. VIDEO_UV_META_SCANLINES(v4l2_fmt, (pix_height+1)>>1);
  475. uv_meta_plane = MSM_MEDIA_ALIGN(uv_meta_stride *
  476. uv_meta_scanlines, 4096);
  477. size = (y_ubwc_plane + uv_ubwc_plane + y_meta_plane +
  478. uv_meta_plane)*2;
  479. } else {
  480. y_sclines = VIDEO_Y_SCANLINES(v4l2_fmt, pix_height);
  481. y_ubwc_plane =
  482. MSM_MEDIA_ALIGN(y_stride * y_sclines, 4096);
  483. uv_sclines = VIDEO_UV_SCANLINES(v4l2_fmt, pix_height);
  484. uv_ubwc_plane =
  485. MSM_MEDIA_ALIGN(uv_stride * uv_sclines, 4096);
  486. y_meta_scanlines =
  487. VIDEO_Y_META_SCANLINES(v4l2_fmt, pix_height);
  488. y_meta_plane = MSM_MEDIA_ALIGN(
  489. y_meta_stride * y_meta_scanlines, 4096);
  490. uv_meta_scanlines =
  491. VIDEO_UV_META_SCANLINES(v4l2_fmt, pix_height);
  492. uv_meta_plane = MSM_MEDIA_ALIGN(uv_meta_stride *
  493. uv_meta_scanlines, 4096);
  494. size = (y_ubwc_plane + uv_ubwc_plane + y_meta_plane +
  495. uv_meta_plane);
  496. }
  497. }
  498. break;
  499. case V4L2_PIX_FMT_VIDC_TP10C:
  500. y_ubwc_plane = MSM_MEDIA_ALIGN(y_stride * y_sclines, 4096);
  501. uv_ubwc_plane = MSM_MEDIA_ALIGN(uv_stride * uv_sclines, 4096);
  502. y_meta_stride = VIDEO_Y_META_STRIDE(v4l2_fmt, pix_width);
  503. y_meta_scanlines = VIDEO_Y_META_SCANLINES(v4l2_fmt, pix_height);
  504. y_meta_plane = MSM_MEDIA_ALIGN(
  505. y_meta_stride * y_meta_scanlines, 4096);
  506. uv_meta_stride = VIDEO_UV_META_STRIDE(v4l2_fmt, pix_width);
  507. uv_meta_scanlines = VIDEO_UV_META_SCANLINES(v4l2_fmt, pix_height);
  508. uv_meta_plane = MSM_MEDIA_ALIGN(uv_meta_stride *
  509. uv_meta_scanlines, 4096);
  510. size = y_ubwc_plane + uv_ubwc_plane + y_meta_plane +
  511. uv_meta_plane;
  512. break;
  513. case V4L2_PIX_FMT_VIDC_ARGB32C:
  514. rgb_ubwc_plane = MSM_MEDIA_ALIGN(rgb_stride * rgb_scanlines,
  515. 4096);
  516. rgb_meta_stride = VIDEO_RGB_META_STRIDE(v4l2_fmt, pix_width);
  517. rgb_meta_scanlines = VIDEO_RGB_META_SCANLINES(v4l2_fmt,
  518. pix_height);
  519. rgb_meta_plane = MSM_MEDIA_ALIGN(rgb_meta_stride *
  520. rgb_meta_scanlines, 4096);
  521. size = rgb_ubwc_plane + rgb_meta_plane;
  522. break;
  523. case V4L2_PIX_FMT_RGBA32:
  524. rgb_plane = MSM_MEDIA_ALIGN(rgb_stride * rgb_scanlines, 4096);
  525. size = rgb_plane;
  526. break;
  527. default:
  528. break;
  529. }
  530. invalid_input:
  531. return size;
  532. }
  533. #endif