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

Commit d65483ef authored by Vikash Garodia's avatar Vikash Garodia
Browse files

msm: vidc: Confirgure work mode 2 based on rate control



Existing code sets work mode as 1 for all encoder usecases.
For VBR and MBR cases, work mode is required to be 2. Hence
setting the same based on RC mode.

Change-Id: I882807ccc4e0348e2cdfab1e74b80a55a47b754d
Signed-off-by: default avatarVikash Garodia <vgarodia@codeaurora.org>
parent febca8f6
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -1255,9 +1255,17 @@ static int msm_vidc_decide_work_mode_ar50(struct msm_vidc_inst *inst)
				pdata.video_work_mode = VIDC_WORK_MODE_1;
			break;
		}
	} else if (inst->session_type == MSM_VIDC_ENCODER)
	} else if (inst->session_type == MSM_VIDC_ENCODER) {
		u32 rc_mode = 0;

		pdata.video_work_mode = VIDC_WORK_MODE_1;
	else {
		rc_mode =  msm_comm_g_ctrl_for_id(inst,
				V4L2_CID_MPEG_VIDEO_BITRATE_MODE);
		if (rc_mode == V4L2_MPEG_VIDEO_BITRATE_MODE_VBR ||
		    rc_mode == V4L2_MPEG_VIDEO_BITRATE_MODE_MBR ||
		    rc_mode == V4L2_MPEG_VIDEO_BITRATE_MODE_MBR_VFR)
			pdata.video_work_mode = VIDC_WORK_MODE_2;
	} else {
		return -EINVAL;
	}