1/**************************************************************************** 2 **************************************************************************** 3 *** 4 *** This header was automatically generated from a Linux kernel header 5 *** of the same name, to make information necessary for userspace to 6 *** call into the kernel available to libc. It contains only constants, 7 *** structures, and macros generated from the original header, and thus, 8 *** contains no copyrightable information. 9 *** 10 *** To edit the content of this header, modify the corresponding 11 *** source file (e.g. under external/kernel-headers/original/) then 12 *** run bionic/libc/kernel/tools/update_all.py 13 *** 14 *** Any manual change here will be lost the next time this script will 15 *** be run. You've been warned! 16 *** 17 **************************************************************************** 18 ****************************************************************************/ 19#ifndef __MEDIA_INFO_H__ 20#define __MEDIA_INFO_H__ 21#ifndef MSM_MEDIA_ALIGN 22#define MSM_MEDIA_ALIGN(__sz, __align) (((__sz) + (__align-1)) & (~(__align-1))) 23/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 24#endif 25enum color_fmts { 26 COLOR_FMT_NV12, 27 COLOR_FMT_NV21, 28/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 29}; 30#define VENUS_Y_STRIDE(__color_fmt, __width) ({ unsigned int __alignment, __stride = 0; if (__width) { switch (__color_fmt) { case COLOR_FMT_NV12: __alignment = 128; __stride = MSM_MEDIA_ALIGN(__width, __alignment); break; default: break; } } __stride; }) 31#define VENUS_UV_STRIDE(__color_fmt, __width) ({ unsigned int __alignment, __stride = 0; if (__width) { switch (__color_fmt) { case COLOR_FMT_NV12: __alignment = 128; __stride = MSM_MEDIA_ALIGN(__width, __alignment); break; default: break; } } __stride; }) 32#define VENUS_Y_SCANLINES(__color_fmt, __height) ({ unsigned int __alignment, __sclines = 0; if (__height) { switch (__color_fmt) { case COLOR_FMT_NV12: __alignment = 32; __sclines = MSM_MEDIA_ALIGN(__height, __alignment); break; default: break; } } __sclines; }) 33/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 34#define VENUS_UV_SCANLINES(__color_fmt, __height) ({ unsigned int __alignment, __sclines = 0; if (__height) { switch (__color_fmt) { case COLOR_FMT_NV12: __alignment = 16; __sclines = MSM_MEDIA_ALIGN(((__height + 1) >> 1), __alignment); break; default: break; } } __sclines; }) 35#define VENUS_BUFFER_SIZE( __color_fmt, __width, __height) ({ unsigned int __uv_alignment; unsigned int __size = 0; unsigned int __y_plane, __uv_plane, __y_stride, __uv_stride, __y_sclines, __uv_sclines; if (__width && __height) { __y_stride = VENUS_Y_STRIDE(__color_fmt, __width); __uv_stride = VENUS_UV_STRIDE(__color_fmt, __width); __y_sclines = VENUS_Y_SCANLINES(__color_fmt, __height); __uv_sclines = VENUS_UV_SCANLINES(__color_fmt, __height); switch (__color_fmt) { case COLOR_FMT_NV12: __uv_alignment = 4096; __y_plane = __y_stride * __y_sclines; __uv_plane = __uv_stride * __uv_sclines + __uv_alignment; __size = __y_plane + __uv_plane; __size = MSM_MEDIA_ALIGN(__size, 4096); break; default: break; } } __size; }) 36#endif 37 38