Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 38e9d434 authored by Deva Ramasubramanian's avatar Deva Ramasubramanian
Browse files

msm: vidc: Amend calculation of buffer sizes in VENUS_BUFFER_SIZE



Add 8KB worth of padding for extradata. This is required to accommodate
some of the larger extradata types that didn't fit into the residual
space between the actual buffer size and its aligned size.

Change-Id: I550f806079dfbdece229f68ffdfc5c0e20b3c9e1
Signed-off-by: default avatarDeva Ramasubramanian <dramasub@codeaurora.org>
parent 6791a1be
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -220,8 +220,8 @@ invalid_input:
static inline unsigned int VENUS_BUFFER_SIZE(
	int color_fmt, int width, int height)
{
	unsigned int uv_alignment;
	unsigned int size = 0;
	const unsigned int extra_size = 8*1024;
	unsigned int uv_alignment = 0, size = 0;
	unsigned int y_plane, uv_plane, y_stride,
		uv_stride, y_sclines, uv_sclines;
	if (!width || !height)
@@ -237,15 +237,15 @@ static inline unsigned int VENUS_BUFFER_SIZE(
		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 + extra_size;
		size = MSM_MEDIA_ALIGN(size, 4096);
		break;
	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 + uv_alignment;
		size = 2 * size + extra_size;
		size = MSM_MEDIA_ALIGN(size, 4096);
		break;
	default: