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

Commit 02652a96 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: vidc: Select video core based on capability"

parents 2dac08c9 b0a48d3b
Loading
Loading
Loading
Loading
+14 −2
Original line number Diff line number Diff line
@@ -1106,6 +1106,16 @@ int msm_vidc_decide_core_and_power_mode(struct msm_vidc_inst *inst)
	lp_cycles = inst->session_type == MSM_VIDC_ENCODER ?
			inst->clk_data.entry->low_power_cycles :
			inst->clk_data.entry->vpp_cycles;
	/*
	 * Incase there is only 1 core enabled, mark it as the core
	 * with min load. This ensures that this core is selected and
	 * video session is set to run on the enabled core.
	 */
	if (inst->capability.max_video_cores.max <= VIDC_CORE_ID_1) {
		min_core_id = min_lp_core_id = VIDC_CORE_ID_1;
		min_load = core0_load;
		min_lp_load = core0_lp_load;
	}

	current_inst_load = msm_comm_get_inst_load(inst, LOAD_CALC_NO_QUIRKS) *
		inst->clk_data.entry->vpp_cycles;
@@ -1129,7 +1139,8 @@ int msm_vidc_decide_core_and_power_mode(struct msm_vidc_inst *inst)
		V4L2_CID_MPEG_VIDC_VIDEO_HYBRID_HIERP_MODE);

	/* Try for preferred core based on settings. */
	if (inst->session_type == MSM_VIDC_ENCODER && hier_mode) {
	if (inst->session_type == MSM_VIDC_ENCODER && hier_mode &&
		inst->capability.max_video_cores.max >= VIDC_CORE_ID_3) {
		if (current_inst_load / 2 + core0_load <= max_freq &&
			current_inst_load / 2 + core1_load <= max_freq) {
			if (inst->clk_data.work_mode == VIDC_WORK_MODE_2) {
@@ -1140,7 +1151,8 @@ int msm_vidc_decide_core_and_power_mode(struct msm_vidc_inst *inst)
		}
	}

	if (inst->session_type == MSM_VIDC_ENCODER && hier_mode) {
	if (inst->session_type == MSM_VIDC_ENCODER && hier_mode &&
		inst->capability.max_video_cores.max >= VIDC_CORE_ID_3) {
		if (current_inst_lp_load / 2 +
				core0_lp_load <= max_freq &&
			current_inst_lp_load / 2 +