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

Commit 39cf3d55 authored by Maheshwar Ajja's avatar Maheshwar Ajja
Browse files

msm: vidc: kill unsupported sessions



Unsupported sessions are not being killed when hardware
overload error occurs, so these sessions are not closed
inside video hardware resulting in max clients error
from video hardware for the following supported sessions.
Hence driver need to kill the unsupported sessions to
avoid max clients error for the supported sessions.

Change-Id: I37a839a59db3ec1a0e526730475fbe8b935ccede
Signed-off-by: default avatarMaheshwar Ajja <majja@codeaurora.org>
parent b6d89b7b
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
/* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2015, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -486,8 +486,8 @@ static void change_inst_state(struct msm_vidc_inst *inst,
	mutex_lock(&inst->lock);
	if (inst->state == MSM_VIDC_CORE_INVALID) {
		dprintk(VIDC_DBG,
			"Inst: %p is in bad state can't change state\n",
			inst);
			"Inst: %p is in bad state can't change state to %d\n",
			inst, state);
		goto exit;
	}
	dprintk(VIDC_DBG, "Moved inst: %p from state: %d to state: %d\n",
@@ -2165,6 +2165,7 @@ core_already_uninited:

int msm_comm_force_cleanup(struct msm_vidc_inst *inst)
{
	msm_comm_kill_session(inst);
	return msm_vidc_deinit_core(inst);
}

@@ -4150,6 +4151,7 @@ int msm_vidc_check_session_supported(struct msm_vidc_inst *inst)
	rc = msm_vidc_load_supported(inst);
	if (rc) {
		change_inst_state(inst, MSM_VIDC_CORE_INVALID);
		msm_comm_kill_session(inst);
		dprintk(VIDC_WARN,
			"%s: Hardware is overloaded\n", __func__);
		return rc;
@@ -4195,6 +4197,7 @@ int msm_vidc_check_session_supported(struct msm_vidc_inst *inst)
	}
	if (rc) {
		change_inst_state(inst, MSM_VIDC_CORE_INVALID);
		msm_comm_kill_session(inst);
		dprintk(VIDC_ERR,
			"%s: Resolution unsupported\n", __func__);
	}