Revert "uapi/media: Update yuv buffer size based on hardware requirement"
This reverts commit e265d46203a6a01abb9824933dee5641f4aff428.
Issue: FP3-A11#89
Test: run cts -m CtsMediaTestCases -t android.media.cts.VideoEncoderTest#testGoogVP9*
Change-Id: If32289e81e4eb825cbcbadb785b2da8fb7b5874e
Signed-off-by: Paras Nagda <pnagda@codeaurora.org>
diff --git a/include/uapi/media/msm_media_info.h b/include/uapi/media/msm_media_info.h
index d784d71..19ea812 100644
--- a/include/uapi/media/msm_media_info.h
+++ b/include/uapi/media/msm_media_info.h
@@ -1276,6 +1276,7 @@
static inline unsigned int VENUS_BUFFER_SIZE(
int color_fmt, int width, int height)
{
+ const unsigned int extra_size = VENUS_EXTRADATA_SIZE(width, height);
unsigned int uv_alignment = 0, size = 0;
unsigned int w_alignment = 512;
unsigned int y_plane, uv_plane, y_stride,
@@ -1304,7 +1305,8 @@
uv_alignment = 4096;
y_plane = y_stride * y_sclines;
uv_plane = uv_stride * uv_sclines + uv_alignment;
- size = y_plane + uv_plane;
+ size = y_plane + uv_plane +
+ MSM_MEDIA_MAX(extra_size, 8 * y_stride);
size = MSM_MEDIA_ALIGN(size, 4096);
/* Additional size to cover last row of non-aligned frame */
@@ -1319,7 +1321,8 @@
uv_alignment = 4096;
y_plane = y_stride * y_sclines;
uv_plane = uv_stride * uv_sclines + uv_alignment;
- size = y_plane + uv_plane;
+ size = y_plane + uv_plane +
+ MSM_MEDIA_MAX(extra_size, 8 * y_stride);
size = MSM_MEDIA_ALIGN(size, 4096);
break;
case COLOR_FMT_NV12_MVTB:
@@ -1327,7 +1330,7 @@
y_plane = y_stride * y_sclines;
uv_plane = uv_stride * uv_sclines + uv_alignment;
size = y_plane + uv_plane;
- size = 2 * size;
+ size = 2 * size + extra_size;
size = MSM_MEDIA_ALIGN(size, 4096);
break;
case COLOR_FMT_NV12_UBWC:
@@ -1347,7 +1350,8 @@
uv_meta_scanlines, 4096);
size = (y_ubwc_plane + uv_ubwc_plane + y_meta_plane +
- uv_meta_plane)*2;
+ uv_meta_plane)*2 +
+ MSM_MEDIA_MAX(extra_size + 8192, 48 * y_stride);
size = MSM_MEDIA_ALIGN(size, 4096);
/* Additional size to cover last row of non-aligned frame */
@@ -1370,7 +1374,8 @@
uv_meta_scanlines, 4096);
size = y_ubwc_plane + uv_ubwc_plane + y_meta_plane +
- uv_meta_plane;
+ uv_meta_plane +
+ MSM_MEDIA_MAX(extra_size + 8192, 48 * y_stride);
size = MSM_MEDIA_ALIGN(size, 4096);
break;
case COLOR_FMT_P010_UBWC: