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

Commit 9c831b80 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: Adjust max hw load during session rejection"

parents 9dc2bec8 8d4b77d0
Loading
Loading
Loading
Loading
+11 −6
Original line number Diff line number Diff line
@@ -2639,7 +2639,7 @@ static int msm_vidc_load_resources(int flipped_state,
{
	int rc = 0;
	struct hfi_device *hdev;
	int num_mbs_per_sec = 0;
	int num_mbs_per_sec = 0, max_load_adj = 0;
	struct msm_vidc_core *core;
	enum load_calc_quirks quirks = LOAD_CALC_IGNORE_TURBO_LOAD |
		LOAD_CALC_IGNORE_THUMBNAIL_LOAD |
@@ -2667,9 +2667,12 @@ static int msm_vidc_load_resources(int flipped_state,
		msm_comm_get_load(core, MSM_VIDC_DECODER, quirks) +
		msm_comm_get_load(core, MSM_VIDC_ENCODER, quirks);

	if (num_mbs_per_sec > core->resources.max_load) {
	max_load_adj = core->resources.max_load +
		inst->capability.mbs_per_frame.max;

	if (num_mbs_per_sec > max_load_adj) {
		dprintk(VIDC_ERR, "HW is overloaded, needed: %d max: %d\n",
			num_mbs_per_sec, core->resources.max_load);
			num_mbs_per_sec, max_load_adj);
		msm_vidc_print_running_insts(core);
		inst->state = MSM_VIDC_CORE_INVALID;
		msm_comm_kill_session(inst);
@@ -4585,21 +4588,23 @@ int msm_vidc_trigger_ssr(struct msm_vidc_core *core,

static int msm_vidc_load_supported(struct msm_vidc_inst *inst)
{
	int num_mbs_per_sec = 0;
	int num_mbs_per_sec = 0, max_load_adj = 0;
	enum load_calc_quirks quirks = LOAD_CALC_IGNORE_TURBO_LOAD |
		LOAD_CALC_IGNORE_THUMBNAIL_LOAD |
		LOAD_CALC_IGNORE_NON_REALTIME_LOAD;

	if (inst->state == MSM_VIDC_OPEN_DONE) {
		max_load_adj = inst->core->resources.max_load +
			inst->capability.mbs_per_frame.max;
		num_mbs_per_sec = msm_comm_get_load(inst->core,
					MSM_VIDC_DECODER, quirks);
		num_mbs_per_sec += msm_comm_get_load(inst->core,
					MSM_VIDC_ENCODER, quirks);
		if (num_mbs_per_sec > inst->core->resources.max_load) {
		if (num_mbs_per_sec > max_load_adj) {
			dprintk(VIDC_ERR,
				"H/W is overloaded. needed: %d max: %d\n",
				num_mbs_per_sec,
				inst->core->resources.max_load);
				max_load_adj);
			msm_vidc_print_running_insts(inst->core);
			return -EBUSY;
		}