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

Commit 9d830ba0 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: Fix race condition during instance load calculation"

parents ae425529 8e64ba50
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -267,9 +267,11 @@ int msm_comm_get_inst_load(struct msm_vidc_inst *inst,
{
	int load = 0;

	mutex_lock(&inst->lock);

	if (!(inst->state >= MSM_VIDC_OPEN_DONE &&
		inst->state < MSM_VIDC_STOP_DONE))
		return 0;
		goto exit;

	load = msm_comm_get_mbs_per_sec(inst);

@@ -299,6 +301,9 @@ int msm_comm_get_inst_load(struct msm_vidc_inst *inst,
	if (is_non_realtime_session(inst) &&
		(quirks & LOAD_CALC_IGNORE_NON_REALTIME_LOAD))
		load = msm_comm_get_mbs_per_sec(inst) / inst->prop.fps;

exit:
	mutex_unlock(&inst->lock);
	return load;
}