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

Commit 836b73ab authored by Darshana Patil's avatar Darshana Patil
Browse files

msm: vidc: fix slice command buffer sizes



Fix HEVC slice command buffer sizes.

Change-Id: I87138c75e7476e6da6c16cefed00d9a3f405b90e
Signed-off-by: default avatarDarshana Patil <darshana@codeaurora.org>
parent 8daa6110
Loading
Loading
Loading
Loading
+9 −7
Original line number Diff line number Diff line
@@ -1109,11 +1109,13 @@ static inline u32 size_h265d_bse_cmd_buf(u32 width, u32 height)
{
	u32 size;

	size = ALIGN(((ALIGN(width, LCU_MAX_SIZE_PELS) / LCU_MIN_SIZE_PELS) +
		(ALIGN(height, LCU_MAX_SIZE_PELS) / LCU_MIN_SIZE_PELS)) *
		NUM_HW_PIC_BUF, VENUS_DMA_ALIGNMENT);
	size = (ALIGN(width, LCU_MAX_SIZE_PELS) / LCU_MIN_SIZE_PELS) +
		(ALIGN(height, LCU_MAX_SIZE_PELS) / LCU_MIN_SIZE_PELS) *
		NUM_HW_PIC_BUF;
	size = min_t(u32, size, H265D_MAX_SLICE + 1);
	size = 2 * size * SIZE_H265D_BSE_CMD_PER_BUF;
	size = ALIGN(size, VENUS_DMA_ALIGNMENT);

	return size;
}

@@ -1121,13 +1123,13 @@ static inline u32 size_h265d_vpp_cmd_buf(u32 width, u32 height)
{
	u32 size = 0;

	size = ALIGN((
		(ALIGN(width, LCU_MAX_SIZE_PELS) / LCU_MIN_SIZE_PELS) +
		(ALIGN(height, LCU_MAX_SIZE_PELS) / LCU_MIN_SIZE_PELS)) *
		NUM_HW_PIC_BUF, VENUS_DMA_ALIGNMENT);
	size = (ALIGN(width, LCU_MAX_SIZE_PELS) / LCU_MIN_SIZE_PELS) +
		(ALIGN(height, LCU_MAX_SIZE_PELS) / LCU_MIN_SIZE_PELS) *
		NUM_HW_PIC_BUF;
	size = min_t(u32, size, H265D_MAX_SLICE + 1);
	size = ALIGN(size, 4);
	size = 2 * size * SIZE_H265D_VPP_CMD_PER_BUF;
	size = ALIGN(size, VENUS_DMA_ALIGNMENT);

	return size;
}