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

Commit 722168b5 authored by Chinmay Sawarkar's avatar Chinmay Sawarkar
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.

CRs-Fixed: 2214722
Change-Id: I51eca554fcd5316a0968dcf505df8883a656a2bb
Signed-off-by: default avatarChinmay Sawarkar <chinmays@codeaurora.org>
parent 07fb2060
Loading
Loading
Loading
Loading
+4 −8
Original line number Diff line number Diff line
@@ -1284,7 +1284,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 y_plane, uv_plane, y_stride,
		uv_stride, y_sclines, uv_sclines;
@@ -1313,8 +1312,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:
@@ -1322,7 +1320,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:
@@ -1342,8 +1340,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);
		break;
	case COLOR_FMT_NV12_BPP10_UBWC:
@@ -1359,8 +1356,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: