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

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

Merge "msm: vidc: Fix intra refresh setting"

parents d89a3c22 4198ba2d
Loading
Loading
Loading
Loading
+10 −1
Original line number 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);
	intra_refresh.mbs = 0;
	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 */
		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 {
		ctrl = get_ctrl(inst,
			V4L2_CID_MPEG_VIDEO_CYCLIC_INTRA_REFRESH_MB);