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

Commit 0ad99124 authored by Govindaraj Rajagopal's avatar Govindaraj Rajagopal
Browse files

uapi: amend interlace buffer size calculation condition



Interlace video playback is failed for resolutions like 1600x1200
due to insufficient buffer size. Avoid the issue by correcting
interlace video buffer size calculation condition.

Change-Id: Ieaf9b62c75c0766f268eb1178be83bf17f0de7d5
Signed-off-by: default avatarGovindaraj Rajagopal <grajagop@codeaurora.org>
parent 2f79d07f
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -2,6 +2,11 @@
#ifndef __MSM_MEDIA_INFO_H__
#define __MSM_MEDIA_INFO_H__

/* Width and Height should be multiple of 16 */
#define INTERLACE_WIDTH_MAX 1920
#define INTERLACE_HEIGHT_MAX 1920
#define INTERLACE_MB_PER_FRAME_MAX ((1920*1088)/256)

#ifndef MSM_MEDIA_ALIGN
#define MSM_MEDIA_ALIGN(__sz, __align) (((__align) & ((__align) - 1)) ?\
	((((__sz) + (__align) - 1) / (__align)) * (__align)) :\
@@ -1210,8 +1215,9 @@ static inline unsigned int VENUS_BUFFER_SIZE(unsigned int color_fmt,
	case COLOR_FMT_NV12_UBWC:
		y_meta_stride = VENUS_Y_META_STRIDE(color_fmt, width);
		uv_meta_stride = VENUS_UV_META_STRIDE(color_fmt, width);
		if ((width <= 1920 && height <= 1088) ||
			(width <= 1088 && height <= 1920)) {
		if (width <= INTERLACE_WIDTH_MAX &&
			height <= INTERLACE_HEIGHT_MAX &&
			(height * width) / 256 <= INTERLACE_MB_PER_FRAME_MAX) {
			y_sclines =
				VENUS_Y_SCANLINES(color_fmt, (height+1)>>1);
			y_ubwc_plane =