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

Commit e12708e0 authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

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

parents f797b171 6d57c6cc
Loading
Loading
Loading
Loading
+12 −0
Original line number Original line Diff line number Diff line
@@ -765,6 +765,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;
	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 */
	 /* multiply by 10/8 (1.25) to get size for 10 bit case */
	if ((inst->fmts[OUTPUT_PORT].fourcc == V4L2_PIX_FMT_VP9) ||
	if ((inst->fmts[OUTPUT_PORT].fourcc == V4L2_PIX_FMT_VP9) ||
		(inst->fmts[OUTPUT_PORT].fourcc == V4L2_PIX_FMT_HEVC))
		(inst->fmts[OUTPUT_PORT].fourcc == V4L2_PIX_FMT_HEVC))
+1 −0
Original line number Original line Diff line number Diff line
@@ -199,6 +199,7 @@ static struct msm_vidc_codec_capability kona_capabilities[] = {
	{CAP_SECURE_FRAME_HEIGHT, DOMAINS_ALL, CODECS_ALL, 128, 4096, 1, 1080},
	{CAP_SECURE_FRAME_HEIGHT, DOMAINS_ALL, CODECS_ALL, 128, 4096, 1, 1080},
	/* (4096 * 2304) / 256 */
	/* (4096 * 2304) / 256 */
	{CAP_SECURE_MBS_PER_FRAME, DOMAINS_ALL, CODECS_ALL, 1, 36864, 1, 36864},
	{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 Original line Diff line number Diff line
@@ -275,6 +275,7 @@ enum hal_capability {
	CAP_SECURE_FRAME_WIDTH,
	CAP_SECURE_FRAME_WIDTH,
	CAP_SECURE_FRAME_HEIGHT,
	CAP_SECURE_FRAME_HEIGHT,
	CAP_SECURE_MBS_PER_FRAME,
	CAP_SECURE_MBS_PER_FRAME,
	CAP_SECURE_BITRATE,
	CAP_MAX,
	CAP_MAX,
};
};