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

Commit 6d57c6cc authored by Maheshwar Ajja's avatar Maheshwar Ajja
Browse files

msm: vidc: secure session frame size is based on bitrate



For secure sessions the frame size is dependent on max bitrate
supported by the platform and hence calculate accordingly.

Change-Id: I86e2ad4a81dc4d62fa987d56d604a1ed8de43587
Signed-off-by: default avatarMaheshwar Ajja <majja@codeaurora.org>
parent e8300ab4
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -769,6 +769,18 @@ u32 msm_vidc_calculate_dec_input_frame_size(struct msm_vidc_inst *inst)
	}

	frame_size = base_res_mbs * MB_SIZE_IN_PIXEL * 3 / 2 / div_factor;

	if (is_secure_session(inst)) {
		u32 max_bitrate = inst->capability.cap[CAP_SECURE_BITRATE].max;

		/*
		 * for secure, calc frame_size based on max bitrate,
		 * peak bitrate can be 10 times more and
		 * frame rate assumed to be 30 fps at least
		 */
		frame_size = (max_bitrate * 10 / 8) / 30;
	}

	 /* multiply by 10/8 (1.25) to get size for 10 bit case */
	if ((inst->fmts[OUTPUT_PORT].fourcc == V4L2_PIX_FMT_VP9) ||
		(inst->fmts[OUTPUT_PORT].fourcc == V4L2_PIX_FMT_HEVC))
+1 −0
Original line number Diff line number Diff line
@@ -200,6 +200,7 @@ static struct msm_vidc_codec_capability kona_capabilities[] = {
	{CAP_SECURE_FRAME_HEIGHT, DOMAINS_ALL, CODECS_ALL, 128, 4096, 1, 1080},
	/* (4096 * 2304) / 256 */
	{CAP_SECURE_MBS_PER_FRAME, DOMAINS_ALL, CODECS_ALL, 1, 36864, 1, 36864},
	{CAP_SECURE_BITRATE, DOMAINS_ALL, CODECS_ALL, 1, 40000000, 1, 20000000},
};

/*
+1 −0
Original line number Diff line number Diff line
@@ -275,6 +275,7 @@ enum hal_capability {
	CAP_SECURE_FRAME_WIDTH,
	CAP_SECURE_FRAME_HEIGHT,
	CAP_SECURE_MBS_PER_FRAME,
	CAP_SECURE_BITRATE,
	CAP_MAX,
};