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

Commit 941aefc9 authored by Priyanka Gujjula's avatar Priyanka Gujjula
Browse files

msm: vidc: Optimize enc scratch and scratch_2 calc for >=8k



Optimize the encoder scratch and scratch_2 buffer size
calculations for >=(7680x4320) usecases.

Change-Id: Ibefd6fa105c2dbecd5e163b52f68f14c39d5a100
Signed-off-by: default avatarPriyanka Gujjula <pgujjula@codeaurora.org>
parent 24d1ef86
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -1423,7 +1423,9 @@ static inline u32 calculate_enc_scratch_size(struct msm_vidc_inst *inst,
		bitstream_size = aligned_width * aligned_height * 3;
		bitbin_size = ALIGN(bitstream_size, VENUS_DMA_ALIGNMENT);
	}
	if (num_vpp_pipes > 2)
	if (aligned_width * aligned_height >= 7680 * 4320)
		size_singlePipe = bitbin_size / 4;
	else if (num_vpp_pipes > 2)
		size_singlePipe = bitbin_size / 2;
	else
		size_singlePipe = bitbin_size;
@@ -1831,7 +1833,7 @@ static inline u32 calculate_enc_scratch2_size(struct msm_vidc_inst *inst,
			metadata_stride, meta_buf_height);
		size = (aligned_height + chroma_height) * aligned_width +
			meta_size_y + meta_size_c;
		size = (size * (num_ref+3)) + 4096;
		size = (size * (num_ref + 2)) + 4096;
	} else {
		ref_buf_height = (height + (HFI_VENUS_HEIGHT_ALIGNMENT - 1))
			& (~(HFI_VENUS_HEIGHT_ALIGNMENT - 1));