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

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

Merge "msm: npu: Support multiple execution_network commands per network"

parents b819bec6 01e8472e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -336,5 +336,6 @@ void disable_fw(struct npu_device *npu_dev);
int load_fw(struct npu_device *npu_dev);
int unload_fw(struct npu_device *npu_dev);
int npu_set_bw(struct npu_device *npu_dev, int new_ib, int new_ab);
int npu_process_kevent(struct npu_client *client, struct npu_kevent *kevt);

#endif /* _NPU_COMMON_H */
+16 −23
Original line number Diff line number Diff line
@@ -1319,28 +1319,6 @@ static int npu_exec_network_v2(struct npu_client *client,
	return ret;
}

static int npu_process_kevent(struct npu_kevent *kevt)
{
	int ret = 0;

	switch (kevt->evt.type) {
	case MSM_NPU_EVENT_TYPE_EXEC_V2_DONE:
		ret = copy_to_user((void __user *)kevt->reserved[1],
			(void *)&kevt->reserved[0],
			kevt->evt.u.exec_v2_done.stats_buf_size);
		if (ret) {
			NPU_ERR("fail to copy to user\n");
			kevt->evt.u.exec_v2_done.stats_buf_size = 0;
			ret = -EFAULT;
		}
		break;
	default:
		break;
	}

	return ret;
}

static int npu_receive_event(struct npu_client *client,
	unsigned long arg)
{
@@ -1356,7 +1334,7 @@ static int npu_receive_event(struct npu_client *client,
		kevt = list_first_entry(&client->evt_list,
			struct npu_kevent, list);
		list_del(&kevt->list);
		npu_process_kevent(kevt);
		npu_process_kevent(client, kevt);
		ret = copy_to_user(argp, &kevt->evt,
			sizeof(struct msm_npu_event));
		if (ret) {
@@ -1472,6 +1450,21 @@ static int npu_get_property(struct npu_client *client,
	case MSM_NPU_PROP_ID_HARDWARE_VERSION:
		prop.prop_param[0] = npu_dev->hw_version;
		break;
	case MSM_NPU_PROP_ID_IPC_QUEUE_INFO:
		ret = npu_host_get_ipc_queue_size(npu_dev,
			prop.prop_param[0]);
		if (ret < 0) {
			NPU_ERR("Can't get ipc queue %d size",
				prop.prop_param[0]);
			return ret;
		}

		prop.prop_param[1] = ret;
		break;
	case MSM_NPU_PROP_ID_DRV_FEATURE:
		prop.prop_param[0] = MSM_NPU_FEATURE_MULTI_EXECUTE |
			MSM_NPU_FEATURE_ASYNC_EXECUTE;
		break;
	default:
		ret = npu_host_get_fw_property(client->npu_dev, &prop);
		if (ret) {
+10 −0
Original line number Diff line number Diff line
@@ -411,3 +411,13 @@ int npu_host_ipc_post_init(struct npu_device *npu_dev)
{
	return 0;
}

int npu_host_get_ipc_queue_size(struct npu_device *npu_dev, uint32_t q_idx)
{
	if (q_idx >= ARRAY_SIZE(npu_q_setup)) {
		NPU_ERR("Invalid ipc queue index %d\n", q_idx);
		return -EINVAL;
	}

	return npu_q_setup[q_idx].size;
}
+342 −111

File changed.

Preview size limit exceeded, changes collapsed.

+20 −8

File changed.

Preview size limit exceeded, changes collapsed.

Loading