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

Commit c68ba45e authored by Amit Shekhar's avatar Amit Shekhar Committed by Gerrit - the friendly Code Review server
Browse files

msm: vidc: Fix tile alignment of buffer for some resolution



Fix buffer size calculation for NV12, NV21 and UBWC color format to
accommodate last row buffers for all frames whose width and height
are greater than 2400 pixels and size is not a multiple of 512x512

Change-Id: I6ea19e479f64b20b980df6cb0ac94ad524a82c01
CRs-Fixed: 2265460
Signed-off-by: default avatarAmit Shekhar <ashekhar@codeaurora.org>
parent e8df302a
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -1261,8 +1261,11 @@ static inline unsigned int VENUS_BUFFER_SIZE(
		size = MSM_MEDIA_ALIGN(size, 4096);

		/* Additional size to cover last row of non-aligned frame */
		size += MSM_MEDIA_ALIGN(width, w_alignment) * w_alignment;
		if (width >= 2400 && height >= 2400) {
			size += MSM_MEDIA_ALIGN(width, w_alignment) *
					w_alignment;
			size = MSM_MEDIA_ALIGN(size, 4096);
		}
		break;
	case COLOR_FMT_P010:
		uv_alignment = 4096;
@@ -1302,8 +1305,11 @@ static inline unsigned int VENUS_BUFFER_SIZE(
		size = MSM_MEDIA_ALIGN(size, 4096);

		/* Additional size to cover last row of non-aligned frame */
		size += MSM_MEDIA_ALIGN(width, w_alignment) * w_alignment;
		if (width >= 2400 && height >= 2400) {
			size += MSM_MEDIA_ALIGN(width, w_alignment) *
					w_alignment;
			size = MSM_MEDIA_ALIGN(size, 4096);
		}
		break;
	case COLOR_FMT_NV12_BPP10_UBWC:
		y_ubwc_plane = MSM_MEDIA_ALIGN(y_stride * y_sclines, 4096);