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

Commit c6c2c991 authored by Jia Meng's avatar Jia Meng
Browse files

msm: vidc: removed the async v4l2 event for session unsupported



When an unsupported session is detected when handling an
information event, send only the unsupported event to client
and ignore the informational event.

CRs-fixed: 702914
Change-Id: Iede16ebf5b5f0216b18de71b8d3cbe669597188a
Signed-off-by: default avatarJia Meng <jmeng@codeaurora.org>
parent c5bc590f
Loading
Loading
Loading
Loading
+10 −6
Original line number Diff line number Diff line
@@ -783,8 +783,16 @@ static void handle_event_change(enum command_response cmd, void *data)
		}
		msm_comm_init_dcvs_load(inst);
		rc = msm_vidc_check_session_supported(inst);
		if (!rc)
		if (!rc) {
			msm_vidc_queue_v4l2_event(inst, event);
		} else if (rc == -ENOTSUPP) {
			msm_vidc_queue_v4l2_event(inst,
				V4L2_EVENT_MSM_VIDC_HW_UNSUPPORTED);
		} else if (rc == -EBUSY) {
			msm_vidc_queue_v4l2_event(inst,
				V4L2_EVENT_MSM_VIDC_HW_OVERLOAD);
		}

		return;
	} else {
		dprintk(VIDC_ERR,
@@ -4260,7 +4268,7 @@ static int msm_vidc_load_supported(struct msm_vidc_inst *inst)
				num_mbs_per_sec,
				inst->core->resources.max_load);
			msm_vidc_print_running_insts(inst->core);
			return -EINVAL;
			return -EBUSY;
		}
	}
	return 0;
@@ -4432,8 +4440,6 @@ 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_vidc_queue_v4l2_event(inst,
					V4L2_EVENT_MSM_VIDC_HW_OVERLOAD);
		dprintk(VIDC_WARN,
			"%s: Hardware is overloaded\n", __func__);
		return rc;
@@ -4472,8 +4478,6 @@ int msm_vidc_check_session_supported(struct msm_vidc_inst *inst)
	}
	if (rc) {
		change_inst_state(inst, MSM_VIDC_CORE_INVALID);
		msm_vidc_queue_v4l2_event(inst,
					V4L2_EVENT_MSM_VIDC_HW_UNSUPPORTED);
		dprintk(VIDC_ERR,
			"%s: Resolution unsupported\n", __func__);
	}