msm8x84: update msm_media_info.h

update media-info to accommodate extradata-size in bufer-size

Change-Id: I9907845444c63ceaa9e7812c5d7629338c5476c1
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 @@
 	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 @@
 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 @@
 	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 @@
 	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 @@
 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;