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

Commit 0510f720 authored by Arun Menon's avatar Arun Menon
Browse files

msm: vidc: Support session_continue for sufficient event



Venus 3xx has deprecated continue_data_transfer property.
In case, client enables e2e smooth streaming and firmware
reports sufficient resources event, then driver should
send session_continue command to firmware, to resume execution.
Without this change, firmware will stall waiting for session_continue
command, if client has enabled smooth streaming and resources
are sufficient.

Change-Id: I0b061b8451a771416d776dc3a6961d7a0887bc86
Signed-off-by: default avatarArun Menon <avmenon@codeaurora.org>
parent 66f4f85a
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -2096,6 +2096,9 @@ static int create_3x_pkt_cmd_session_set_property(
		pkt->size += sizeof(u32) + sizeof(struct hfi_enable);
		break;
	}
	/* Deprecated param on Venus 3xx */
	case HAL_PARAM_VDEC_CONTINUE_DATA_TRANSFER:
		break;
	default:
		rc = create_pkt_cmd_session_set_property(pkt,
				session, ptype, pdata);
+0 −9
Original line number Diff line number Diff line
@@ -1339,15 +1339,6 @@ static int set_default_properties(struct msm_vidc_inst *inst)
				rc);
	}

	if (defaults & HAL_VIDEO_CONTINUE_DATA_TRANSFER) {
		dprintk(VIDC_DBG, "Enable continue_data_transfer\n");
		ctrl.id = V4L2_CID_MPEG_VIDC_VIDEO_CONTINUE_DATA_TRANSFER;
		ctrl.value = true;
		rc = v4l2_s_ctrl(NULL, &inst->ctrl_handler, &ctrl);
		if (rc)
			dprintk(VIDC_ERR, "set cont_data_transfer failed\n");
	}

	return rc;
}

+17 −4
Original line number Diff line number Diff line
@@ -749,6 +749,7 @@ static void handle_event_change(enum hal_command_response cmd, void *data)
	struct v4l2_event seq_changed_event = {0};
	int rc = 0;
	bool bit_depth_changed = false;
	struct hfi_device *hdev;

	if (!event_notify) {
		dprintk(VIDC_WARN, "Got an empty event from hfi\n");
@@ -757,10 +758,11 @@ static void handle_event_change(enum hal_command_response cmd, void *data)

	inst = get_inst(get_vidc_core(event_notify->device_id),
			event_notify->session_id);
	if (!inst) {
	if (!inst || !inst->core || !inst->core->device) {
		dprintk(VIDC_WARN, "Got a reponse for an inactive session\n");
		return;
		goto err_bad_event;
	}
	hdev = inst->core->device;

	switch (event_notify->hal_event_type) {
	case HAL_EVENT_SEQ_CHANGED_SUFFICIENT_RESOURCES:
@@ -768,9 +770,20 @@ static void handle_event_change(enum hal_command_response cmd, void *data)

		rc = msm_comm_g_ctrl(inst,
			V4L2_CID_MPEG_VIDC_VIDEO_CONTINUE_DATA_TRANSFER);
		if (!IS_ERR_VALUE(rc) && rc == true)
			event = V4L2_EVENT_SEQ_CHANGED_SUFFICIENT;

		if (!IS_ERR_VALUE(rc) && rc == true) {
			event = V4L2_EVENT_SEQ_CHANGED_SUFFICIENT;
			dprintk(VIDC_DBG,
				"send session_continue after sufficient event\n");
			rc = call_hfi_op(hdev, session_continue,
					(void *) inst->session);
			if (rc) {
				dprintk(VIDC_ERR,
					"%s - failed to send session_continue\n",
					__func__);
				goto err_bad_event;
			}
		}
		break;
	case HAL_EVENT_SEQ_CHANGED_INSUFFICIENT_RESOURCES:
		event = V4L2_EVENT_SEQ_CHANGED_INSUFFICIENT;