summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPraveen Chavan <pchavan@codeaurora.org>2015-05-06 00:18:16 -0700
committerVineeta Srivastava <vsrivastava@google.com>2015-05-06 00:21:58 -0700
commit8364c0e5af2666f935c7526836ea8b4f67ae5ac3 (patch)
tree229860eeac3a9c334bf86e7015322848f75911a8
parent5564ba432eb2de9df9d17174ef9c38b5786bc2b4 (diff)
downloadmsm8x84-8364c0e5af2666f935c7526836ea8b4f67ae5ac3.tar.gz
msm8x84: update msm_media_info.h
update media-info to accommodate extradata-size in bufer-size Change-Id: I9907845444c63ceaa9e7812c5d7629338c5476c1
-rw-r--r--kernel-headers/media/msm_media_info.h16
-rw-r--r--original-kernel-headers/media/msm_media_info.h14
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;