diff options
-rw-r--r-- | kernel-headers/media/msm_media_info.h | 16 | ||||
-rw-r--r-- | original-kernel-headers/media/msm_media_info.h | 14 |
2 files changed, 27 insertions, 3 deletions
diff --git a/kernel-headers/media/msm_media_info.h b/kernel-headers/media/msm_media_info.h index 3efb8ca..9891531 100644 --- a/kernel-headers/media/msm_media_info.h +++ b/kernel-headers/media/msm_media_info.h @@ -137,6 +137,18 @@ enum color_fmts { COLOR_FMT_NV12_MVTB, }; +static inline unsigned int VENUS_EXTRADATA_SIZE(int width, int height) +{ + (void)height; + (void)width; + + /* + * In the future, calculate the size based on the w/h but just + * hardcode it for now since 8K satisfies all current usecases. + */ + return 8 * 1024; +} + static inline unsigned int VENUS_Y_STRIDE(int color_fmt, int width) { unsigned int alignment, stride = 0; @@ -220,7 +232,7 @@ invalid_input: static inline unsigned int VENUS_BUFFER_SIZE( int color_fmt, int width, int height) { - const unsigned int extra_size = 8*1024; + const unsigned int extra_size = VENUS_EXTRADATA_SIZE(width, height); unsigned int uv_alignment = 0, size = 0; unsigned int y_plane, uv_plane, y_stride, uv_stride, y_sclines, uv_sclines; @@ -243,7 +255,7 @@ static inline unsigned int VENUS_BUFFER_SIZE( case COLOR_FMT_NV12_MVTB: uv_alignment = 4096; y_plane = y_stride * y_sclines; - uv_plane = uv_stride * uv_sclines; + uv_plane = uv_stride * uv_sclines + uv_alignment; size = y_plane + uv_plane; size = 2 * size + extra_size; size = MSM_MEDIA_ALIGN(size, 4096); diff --git a/original-kernel-headers/media/msm_media_info.h b/original-kernel-headers/media/msm_media_info.h index 0591ae4..9891531 100644 --- a/original-kernel-headers/media/msm_media_info.h +++ b/original-kernel-headers/media/msm_media_info.h @@ -137,6 +137,18 @@ enum color_fmts { COLOR_FMT_NV12_MVTB, }; +static inline unsigned int VENUS_EXTRADATA_SIZE(int width, int height) +{ + (void)height; + (void)width; + + /* + * In the future, calculate the size based on the w/h but just + * hardcode it for now since 8K satisfies all current usecases. + */ + return 8 * 1024; +} + static inline unsigned int VENUS_Y_STRIDE(int color_fmt, int width) { unsigned int alignment, stride = 0; @@ -220,7 +232,7 @@ invalid_input: static inline unsigned int VENUS_BUFFER_SIZE( int color_fmt, int width, int height) { - const unsigned int extra_size = 8*1024; + const unsigned int extra_size = VENUS_EXTRADATA_SIZE(width, height); unsigned int uv_alignment = 0, size = 0; unsigned int y_plane, uv_plane, y_stride, uv_stride, y_sclines, uv_sclines; |