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

Commit 4e3607ca authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: cvp: Signal Camera of CVP SSR"

parents f0123568 7d85e6d2
Loading
Loading
Loading
Loading
+4 −34
Original line number Diff line number Diff line
@@ -1072,24 +1072,16 @@ static int msm_cvp_thread_fence_run(void *data)
				"%s: Failed in call_hfi_op %d, %x\n",
				__func__, in_pkt->pkt_data[0],
				in_pkt->pkt_data[1]);

			if (rc == -ECONNRESET)
				goto exit;

			synx_state = SYNX_STATE_SIGNALED_ERROR;
		}

		if (synx_state != SYNX_STATE_SIGNALED_ERROR) {
			rc = wait_for_sess_signal_receipt(inst,
			rc = wait_for_sess_signal_receipt_fence(inst,
					HAL_SESSION_DME_FRAME_CMD_DONE);
			if (rc) {
				dprintk(CVP_ERR,
				"%s: wait for signal failed, rc %d\n",
				__func__, rc);

				if (rc == -ECONNRESET)
					goto exit;

				synx_state = SYNX_STATE_SIGNALED_ERROR;
			}
		}
@@ -1107,13 +1099,7 @@ static int msm_cvp_thread_fence_run(void *data)
					__func__);
				goto exit;
			}
			if (synx_get_status(synx_obj) !=
				SYNX_STATE_SIGNALED_SUCCESS) {
				dprintk(CVP_ERR,
					"%s: synx_get_status failed\n",
					__func__);
				goto exit;
			}

			rc = synx_release(synx_obj);
			if (rc) {
				dprintk(CVP_ERR, "%s: synx_release failed\n",
@@ -1185,24 +1171,16 @@ static int msm_cvp_thread_fence_run(void *data)
				"%s: Failed in call_hfi_op %d, %x\n",
				__func__, in_pkt->pkt_data[0],
				in_pkt->pkt_data[1]);

			if (rc == -ECONNRESET)
				goto exit;

			synx_state = SYNX_STATE_SIGNALED_ERROR;
		}

		if (synx_state != SYNX_STATE_SIGNALED_ERROR) {
			rc = wait_for_sess_signal_receipt(inst,
			rc = wait_for_sess_signal_receipt_fence(inst,
					HAL_SESSION_ICA_FRAME_CMD_DONE);
			if (rc) {
				dprintk(CVP_ERR,
				"%s: wait for signal failed, rc %d\n",
				__func__, rc);

				if (rc == -ECONNRESET)
					goto exit;

				synx_state = SYNX_STATE_SIGNALED_ERROR;
			}
		}
@@ -1264,24 +1242,16 @@ static int msm_cvp_thread_fence_run(void *data)
				"%s: Failed in call_hfi_op %d, %x\n",
				__func__, in_pkt->pkt_data[0],
				in_pkt->pkt_data[1]);

			if (rc == -ECONNRESET)
				goto exit;

			synx_state = SYNX_STATE_SIGNALED_ERROR;
		}

		if (synx_state != SYNX_STATE_SIGNALED_ERROR) {
			rc = wait_for_sess_signal_receipt(inst,
			rc = wait_for_sess_signal_receipt_fence(inst,
					HAL_SESSION_FD_FRAME_CMD_DONE);
			if (rc) {
				dprintk(CVP_ERR,
				"%s: wait for signal failed, rc %d\n",
				__func__, rc);

				if (rc == -ECONNRESET)
					goto exit;

				synx_state = SYNX_STATE_SIGNALED_ERROR;
			}
		}
+39 −5
Original line number Diff line number Diff line
@@ -395,14 +395,37 @@ int wait_for_sess_signal_receipt(struct msm_cvp_inst *inst,
		msecs_to_jiffies(
			inst->core->resources.msm_cvp_hw_rsp_timeout));
	if (!rc) {
		enum cvp_event_t event;
		unsigned long flags = 0;

		dprintk(CVP_WARN, "Wait interrupted or timed out: %d\n",
				SESSION_MSG_INDEX(cmd));
		call_hfi_op(hdev, flush_debug_queue, hdev->hfi_device_data);
		dump_hfi_queue(hdev->hfi_device_data);
		rc = -EIO;
	} else {
		rc = 0;
	}
	return rc;
}

int wait_for_sess_signal_receipt_fence(struct msm_cvp_inst *inst,
	enum hal_command_response cmd)
{
	int rc = 0;
	struct cvp_hfi_device *hdev;
	int retry = FENCE_WAIT_SIGNAL_RETRY_TIMES;

	if (!IS_HAL_SESSION_CMD(cmd)) {
		dprintk(CVP_ERR, "Invalid inst cmd response: %d\n", cmd);
		return -EINVAL;
	}
	hdev = (struct cvp_hfi_device *)(inst->core->device);

	while (retry) {
		rc = wait_for_completion_timeout(
			&inst->completions[SESSION_MSG_INDEX(cmd)],
			msecs_to_jiffies(FENCE_WAIT_SIGNAL_TIMEOUT));
		if (!rc) {
			enum cvp_event_t event;
			unsigned long flags = 0;

		spin_lock_irqsave(&inst->event_handler.lock, flags);
		event = inst->event_handler.event;
@@ -411,12 +434,23 @@ int wait_for_sess_signal_receipt(struct msm_cvp_inst *inst,
		if (event == CVP_SSR_EVENT) {
			dprintk(CVP_WARN, "%s: SSR triggered\n",
				__func__);
			rc = -ECONNRESET;
				return -ECONNRESET;
		}

			--retry;
	} else {
		rc = 0;
			break;
		}
	}

	if (!retry) {
		dprintk(CVP_WARN, "Wait interrupted or timed out: %d\n",
				SESSION_MSG_INDEX(cmd));
		call_hfi_op(hdev, flush_debug_queue, hdev->hfi_device_data);
		dump_hfi_queue(hdev->hfi_device_data);
		rc = -EIO;
	}

	return rc;
}

+2 −0
Original line number Diff line number Diff line
@@ -41,6 +41,8 @@ void print_cvp_buffer(u32 tag, const char *str,
		struct msm_cvp_internal_buffer *cbuf);
int wait_for_sess_signal_receipt(struct msm_cvp_inst *inst,
	enum hal_command_response cmd);
int wait_for_sess_signal_receipt_fence(struct msm_cvp_inst *inst,
	enum hal_command_response cmd);
int cvp_comm_set_arp_buffers(struct msm_cvp_inst *inst);
int cvp_comm_release_persist_buffers(struct msm_cvp_inst *inst);
void print_client_buffer(u32 tag, const char *str,
+2 −0
Original line number Diff line number Diff line
@@ -29,6 +29,8 @@
#define MAX_NAME_LENGTH 64
#define MAX_DEBUGFS_NAME 50
#define MAX_DSP_INIT_ATTEMPTS 16
#define FENCE_WAIT_SIGNAL_TIMEOUT 100
#define FENCE_WAIT_SIGNAL_RETRY_TIMES 20

#define SYS_MSG_START HAL_SYS_INIT_DONE
#define SYS_MSG_END HAL_SYS_ERROR