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

Commit e265d462 authored by Paras Nagda's avatar Paras Nagda Committed by Gerrit - the friendly Code Review server
Browse files

uapi/media: Update yuv buffer size based on hardware requirement



1. Update buffer layout based on HW spec.
2. Remove padding at end of each buffer.
3. Align the buffer size with video firmware spec.

Change-Id: I51eca554fcd5316a0968dcf505df8883a656a2bb
Signed-off-by: default avatarParas Nagda <pnagda@codeaurora.org>
parent 1195b6ca
Loading
Loading
Loading
Loading
+5 −10
Original line number Diff line number Diff line
@@ -1276,7 +1276,6 @@ static inline unsigned int VENUS_RGB_META_SCANLINES(int color_fmt, int height)
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,
@@ -1305,8 +1304,7 @@ 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 +
				MSM_MEDIA_MAX(extra_size, 8 * y_stride);
		size = y_plane + uv_plane;
		size = MSM_MEDIA_ALIGN(size, 4096);

		/* Additional size to cover last row of non-aligned frame */
@@ -1321,8 +1319,7 @@ 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 +
				MSM_MEDIA_MAX(extra_size, 8 * y_stride);
		size = y_plane + uv_plane;
		size = MSM_MEDIA_ALIGN(size, 4096);
		break;
	case COLOR_FMT_NV12_MVTB:
@@ -1330,7 +1327,7 @@ static inline unsigned int VENUS_BUFFER_SIZE(
		y_plane = y_stride * y_sclines;
		uv_plane = uv_stride * uv_sclines + uv_alignment;
		size = y_plane + uv_plane;
		size = 2 * size + extra_size;
		size = 2 * size;
		size = MSM_MEDIA_ALIGN(size, 4096);
		break;
	case COLOR_FMT_NV12_UBWC:
@@ -1350,8 +1347,7 @@ static inline unsigned int VENUS_BUFFER_SIZE(
			uv_meta_scanlines, 4096);

		size = (y_ubwc_plane + uv_ubwc_plane + y_meta_plane +
			uv_meta_plane)*2 +
			MSM_MEDIA_MAX(extra_size + 8192, 48 * y_stride);
			uv_meta_plane)*2;
		size = MSM_MEDIA_ALIGN(size, 4096);

		/* Additional size to cover last row of non-aligned frame */
@@ -1374,8 +1370,7 @@ static inline unsigned int VENUS_BUFFER_SIZE(
					uv_meta_scanlines, 4096);

		size = y_ubwc_plane + uv_ubwc_plane + y_meta_plane +
			uv_meta_plane +
			MSM_MEDIA_MAX(extra_size + 8192, 48 * y_stride);
			uv_meta_plane;
		size = MSM_MEDIA_ALIGN(size, 4096);
		break;
	case COLOR_FMT_P010_UBWC: