Loading drivers/media/platform/msm/vidc/msm_vidc_common.c +11 −6 Original line number Diff line number Diff line Loading @@ -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 | Loading Loading @@ -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); Loading Loading @@ -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; } Loading Loading
drivers/media/platform/msm/vidc/msm_vidc_common.c +11 −6 Original line number Diff line number Diff line Loading @@ -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 | Loading Loading @@ -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); Loading Loading @@ -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; } Loading