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

Commit fa10e48f authored by Deva Ramasubramanian's avatar Deva Ramasubramanian
Browse files

msm: vidc: Don't report unsupported bitstreams as hardware errors



Usually clients don't really care what sort of error they get since the
error handling tends to be the same.  But for clients that do, report it
properly.

Change-Id: I8dd453b29fa937529091d48fc1f57963e1a77650
Signed-off-by: default avatarDeva Ramasubramanian <dramasub@codeaurora.org>
parent 31f8dcc9
Loading
Loading
Loading
Loading
+13 −12
Original line number Diff line number Diff line
@@ -1172,6 +1172,7 @@ static void handle_session_error(enum hal_command_response cmd, void *data)
	struct msm_vidc_cb_cmd_done *response = data;
	struct hfi_device *hdev = NULL;
	struct msm_vidc_inst *inst = NULL;
	int event = V4L2_EVENT_MSM_VIDC_SYS_ERROR;

	if (!response) {
		dprintk(VIDC_ERR,
@@ -1191,27 +1192,27 @@ static void handle_session_error(enum hal_command_response cmd, void *data)
	change_inst_state(inst, MSM_VIDC_CORE_INVALID);

	if (response->status == VIDC_ERR_MAX_CLIENTS) {
		dprintk(VIDC_WARN,
			"send max clients reached error to client: %p\n",
			inst);
		msm_vidc_queue_v4l2_event(inst,
			V4L2_EVENT_MSM_VIDC_MAX_CLIENTS);
		dprintk(VIDC_WARN, "Too many clients, rejecting %p", inst);
		event = V4L2_EVENT_MSM_VIDC_MAX_CLIENTS;

		/* Clean the HFI session now. Since inst->state is moved to
		 * INVLAID, forward thread doesn't know FW has valid session
		/*
		 * Clean the HFI session now. Since inst->state is moved to
		 * INVALID, forward thread doesn't know FW has valid session
		 * or not. This is the last place driver knows that there is
		 * no session in FW. Hence clean HFI session now.
		 */

		msm_comm_session_clean(inst);
	} else if (response->status == VIDC_ERR_NOT_SUPPORTED) {
		dprintk(VIDC_WARN, "Unsupported bitstream in %p", inst);
		event = V4L2_EVENT_MSM_VIDC_HW_UNSUPPORTED;
	} else {
		dprintk(VIDC_ERR,
			"send session error to client: %p\n",
			inst);
		msm_vidc_queue_v4l2_event(inst,
			V4L2_EVENT_MSM_VIDC_SYS_ERROR);
		dprintk(VIDC_WARN, "Unknown session error (%d) for %p\n",
				response->status, inst);
		event = V4L2_EVENT_MSM_VIDC_SYS_ERROR;
	}

	msm_vidc_queue_v4l2_event(inst, event);
	put_inst(inst);
}