Loading include/uapi/media/msm_media_info.h +35 −8 Original line number Diff line number Diff line Loading @@ -2,6 +2,23 @@ #ifndef __MSM_MEDIA_INFO_H__ #define __MSM_MEDIA_INFO_H__ #include <asm/bitsperlong.h> #if __BITS_PER_LONG == 64 #define NV12_STRIDE_ALIGNMENT 512 #define NV12_SCANLINE_ALIGNMENT 512 #else #define NV12_STRIDE_ALIGNMENT 128 #define NV12_SCANLINE_ALIGNMENT 32 #endif #ifdef VENUS_USE_64BIT_ALIGNMENT #undef NV12_STRIDE_ALIGNMENT #undef NV12_SCANLINE_ALIGNMENT #define NV12_STRIDE_ALIGNMENT 512 #define NV12_SCANLINE_ALIGNMENT 512 #endif /* Width and Height should be multiple of 16 */ #define INTERLACE_WIDTH_MAX 1920 #define INTERLACE_HEIGHT_MAX 1920 Loading Loading @@ -45,10 +62,10 @@ enum color_fmts { * . . . . . . . . . . . . . . . . V * . . . . . . . . . . . . . . . . --> Buffer size alignment * * Y_Stride : Width aligned to 512 * UV_Stride : Width aligned to 512 * Y_Scanlines: Height aligned to 512 * UV_Scanlines: Height/2 aligned to 256 * Y_Stride : Width aligned to 512 or 128 * UV_Stride : Width aligned to 512 or 128 * Y_Scanlines: Height aligned to 512 or 32 * UV_Scanlines: Height/2 aligned to 256 or 16 * Total size = align(Y_Stride * Y_Scanlines * + UV_Stride * UV_Scanlines, 4096) */ Loading Loading @@ -80,10 +97,10 @@ enum color_fmts { * . . . . . . . . . . . . . . . . V * . . . . . . . . . . . . . . . . --> Padding & Buffer size alignment * * Y_Stride : Width aligned to 512 * UV_Stride : Width aligned to 512 * Y_Scanlines: Height aligned to 512 * UV_Scanlines: Height/2 aligned to 256 * Y_Stride : Width aligned to 512 or 128 * UV_Stride : Width aligned to 512 or 128 * Y_Scanlines: Height aligned to 512 or 32 * UV_Scanlines: Height/2 aligned to 256 or 16 * Total size = align(Y_Stride * Y_Scanlines * + UV_Stride * UV_Scanlines, 4096) */ Loading Loading @@ -782,6 +799,9 @@ static inline unsigned int VENUS_Y_STRIDE(unsigned int color_fmt, switch (color_fmt) { case COLOR_FMT_NV12: case COLOR_FMT_NV21: alignment = NV12_STRIDE_ALIGNMENT; stride = MSM_MEDIA_ALIGN(width, alignment); break; case COLOR_FMT_NV12_512: alignment = 512; stride = MSM_MEDIA_ALIGN(width, alignment); Loading Loading @@ -825,6 +845,9 @@ static inline unsigned int VENUS_UV_STRIDE(unsigned int color_fmt, switch (color_fmt) { case COLOR_FMT_NV21: case COLOR_FMT_NV12: alignment = NV12_STRIDE_ALIGNMENT; stride = MSM_MEDIA_ALIGN(width, alignment); break; case COLOR_FMT_NV12_512: alignment = 512; stride = MSM_MEDIA_ALIGN(width, alignment); Loading Loading @@ -868,6 +891,8 @@ static inline unsigned int VENUS_Y_SCANLINES(unsigned int color_fmt, switch (color_fmt) { case COLOR_FMT_NV12: case COLOR_FMT_NV21: alignment = NV12_SCANLINE_ALIGNMENT; break; case COLOR_FMT_NV12_512: alignment = 512; break; Loading Loading @@ -905,6 +930,8 @@ static inline unsigned int VENUS_UV_SCANLINES(unsigned int color_fmt, switch (color_fmt) { case COLOR_FMT_NV21: case COLOR_FMT_NV12: alignment = NV12_SCANLINE_ALIGNMENT/2; break; case COLOR_FMT_NV12_512: alignment = 256; break; Loading Loading
include/uapi/media/msm_media_info.h +35 −8 Original line number Diff line number Diff line Loading @@ -2,6 +2,23 @@ #ifndef __MSM_MEDIA_INFO_H__ #define __MSM_MEDIA_INFO_H__ #include <asm/bitsperlong.h> #if __BITS_PER_LONG == 64 #define NV12_STRIDE_ALIGNMENT 512 #define NV12_SCANLINE_ALIGNMENT 512 #else #define NV12_STRIDE_ALIGNMENT 128 #define NV12_SCANLINE_ALIGNMENT 32 #endif #ifdef VENUS_USE_64BIT_ALIGNMENT #undef NV12_STRIDE_ALIGNMENT #undef NV12_SCANLINE_ALIGNMENT #define NV12_STRIDE_ALIGNMENT 512 #define NV12_SCANLINE_ALIGNMENT 512 #endif /* Width and Height should be multiple of 16 */ #define INTERLACE_WIDTH_MAX 1920 #define INTERLACE_HEIGHT_MAX 1920 Loading Loading @@ -45,10 +62,10 @@ enum color_fmts { * . . . . . . . . . . . . . . . . V * . . . . . . . . . . . . . . . . --> Buffer size alignment * * Y_Stride : Width aligned to 512 * UV_Stride : Width aligned to 512 * Y_Scanlines: Height aligned to 512 * UV_Scanlines: Height/2 aligned to 256 * Y_Stride : Width aligned to 512 or 128 * UV_Stride : Width aligned to 512 or 128 * Y_Scanlines: Height aligned to 512 or 32 * UV_Scanlines: Height/2 aligned to 256 or 16 * Total size = align(Y_Stride * Y_Scanlines * + UV_Stride * UV_Scanlines, 4096) */ Loading Loading @@ -80,10 +97,10 @@ enum color_fmts { * . . . . . . . . . . . . . . . . V * . . . . . . . . . . . . . . . . --> Padding & Buffer size alignment * * Y_Stride : Width aligned to 512 * UV_Stride : Width aligned to 512 * Y_Scanlines: Height aligned to 512 * UV_Scanlines: Height/2 aligned to 256 * Y_Stride : Width aligned to 512 or 128 * UV_Stride : Width aligned to 512 or 128 * Y_Scanlines: Height aligned to 512 or 32 * UV_Scanlines: Height/2 aligned to 256 or 16 * Total size = align(Y_Stride * Y_Scanlines * + UV_Stride * UV_Scanlines, 4096) */ Loading Loading @@ -782,6 +799,9 @@ static inline unsigned int VENUS_Y_STRIDE(unsigned int color_fmt, switch (color_fmt) { case COLOR_FMT_NV12: case COLOR_FMT_NV21: alignment = NV12_STRIDE_ALIGNMENT; stride = MSM_MEDIA_ALIGN(width, alignment); break; case COLOR_FMT_NV12_512: alignment = 512; stride = MSM_MEDIA_ALIGN(width, alignment); Loading Loading @@ -825,6 +845,9 @@ static inline unsigned int VENUS_UV_STRIDE(unsigned int color_fmt, switch (color_fmt) { case COLOR_FMT_NV21: case COLOR_FMT_NV12: alignment = NV12_STRIDE_ALIGNMENT; stride = MSM_MEDIA_ALIGN(width, alignment); break; case COLOR_FMT_NV12_512: alignment = 512; stride = MSM_MEDIA_ALIGN(width, alignment); Loading Loading @@ -868,6 +891,8 @@ static inline unsigned int VENUS_Y_SCANLINES(unsigned int color_fmt, switch (color_fmt) { case COLOR_FMT_NV12: case COLOR_FMT_NV21: alignment = NV12_SCANLINE_ALIGNMENT; break; case COLOR_FMT_NV12_512: alignment = 512; break; Loading Loading @@ -905,6 +930,8 @@ static inline unsigned int VENUS_UV_SCANLINES(unsigned int color_fmt, switch (color_fmt) { case COLOR_FMT_NV21: case COLOR_FMT_NV12: alignment = NV12_SCANLINE_ALIGNMENT/2; break; case COLOR_FMT_NV12_512: alignment = 256; break; Loading