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

Commit c5a157e3 authored by Chinmay Sawarkar's avatar Chinmay Sawarkar
Browse files

msm: vidc: Reduced compressed buffer size for resolutions above 4k



Compressed buffer sizes are allocated based on firmware
resolution capability. For 8k resolutions this size is very large
and hence capped to 1/4th of 8k yuv size.

CRs-Fixed: 2212215
Change-Id: Iae2fcec9b55328ef0ef53d5cedb8d1c0c2c499bb
Signed-off-by: default avatarChinmay Sawarkar <chinmays@codeaurora.org>
parent 8ecd48cc
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@
#define MB_SIZE_IN_PIXEL (16 * 16)
#define OPERATING_FRAME_RATE_STEP (1 << 16)
#define MAX_VP9D_INST_COUNT 6
#define MAX_4K_MBPF 38736 /* (4096 * 2304 / 256) */

static const char *const mpeg_video_stream_format[] = {
	"NAL Format Start Codes",
@@ -393,12 +394,18 @@ static struct msm_vidc_ctrl msm_vdec_ctrls[] = {
static u32 get_frame_size_compressed_full_yuv(int plane,
					u32 max_mbs_per_frame, u32 size_per_mb)
{
	if (max_mbs_per_frame > MAX_4K_MBPF)
		return (max_mbs_per_frame * size_per_mb * 3 / 2) / 4;
	else
		return (max_mbs_per_frame * size_per_mb * 3 / 2);
}

static u32 get_frame_size_compressed(int plane,
					u32 max_mbs_per_frame, u32 size_per_mb)
{
	if (max_mbs_per_frame > MAX_4K_MBPF)
		return (max_mbs_per_frame * size_per_mb * 3 / 2) / 4;
	else
		return (max_mbs_per_frame * size_per_mb * 3/2)/2;
}