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

Commit 4198ba2d authored by Karthikeyan Periasamy's avatar Karthikeyan Periasamy Committed by Gerrit - the friendly Code Review server
Browse files

msm: vidc: Fix intra refresh setting



Kernel receives intra refresh period from client, converts
it to MB count and send the calculated MB count to firmware.

CRs-Fixed: 2384822
Change-Id: I20e76b8cec1721239b48fd269ca952de4630c336
Signed-off-by: default avatarKarthikeyan Periasamy <kperiasa@codeaurora.org>
parent e415ce16
Loading
Loading
Loading
Loading
+10 −1
Original line number Original line Diff line number Diff line
@@ -2855,9 +2855,18 @@ int msm_venc_set_intra_refresh_mode(struct msm_vidc_inst *inst)
	ctrl = get_ctrl(inst, V4L2_CID_MPEG_VIDC_VIDEO_INTRA_REFRESH_RANDOM);
	ctrl = get_ctrl(inst, V4L2_CID_MPEG_VIDC_VIDEO_INTRA_REFRESH_RANDOM);
	intra_refresh.mbs = 0;
	intra_refresh.mbs = 0;
	if (ctrl->val) {
	if (ctrl->val) {
		u32 num_mbs_per_frame = 0;
		u32 width = inst->prop.width[CAPTURE_PORT];
		u32 height = inst->prop.height[CAPTURE_PORT];

		/* ignore cyclic mode if random mode is set */
		/* ignore cyclic mode if random mode is set */
		intra_refresh.mode = HFI_INTRA_REFRESH_RANDOM;
		intra_refresh.mode = HFI_INTRA_REFRESH_RANDOM;
		intra_refresh.mbs = ctrl->val;

		num_mbs_per_frame = NUM_MBS_PER_FRAME(height, width);
		intra_refresh.mbs = num_mbs_per_frame / ctrl->val;
		if (num_mbs_per_frame % ctrl->val) {
			intra_refresh.mbs++;
		}
	} else {
	} else {
		ctrl = get_ctrl(inst,
		ctrl = get_ctrl(inst,
			V4L2_CID_MPEG_VIDEO_CYCLIC_INTRA_REFRESH_MB);
			V4L2_CID_MPEG_VIDEO_CYCLIC_INTRA_REFRESH_MB);