Browse Source

msm: eva: Support session creation via device node

Support creating eva session via device node "boot".
It helps pre-silicon and kbdev based EVA bring up test.

Change-Id: I66f4ccf730817afd8f00f8ffeb286c7d89a69a65
Signed-off-by: George Shen <[email protected]>
George Shen 4 years ago
parent
commit
d83b8480a6
3 changed files with 22 additions and 4 deletions
  1. 20 0
      msm/eva/cvp.c
  2. 1 4
      msm/eva/msm_cvp.c
  3. 1 0
      msm/eva/msm_cvp.h

+ 20 - 0
msm/eva/cvp.c

@@ -25,6 +25,7 @@
 #include "cvp_private.h"
 #include "msm_cvp_clocks.h"
 #include "msm_cvp_dsp.h"
+#include "msm_cvp.h"
 
 #define CLASS_NAME              "cvp"
 #define DRIVER_NAME             "cvp"
@@ -272,6 +273,25 @@ static ssize_t boot_store(struct device *dev,
 			"Failed to close cvp instance\n");
 			return rc;
 		}
+	} else if ((val == 2) && booted) {
+		struct msm_cvp_inst *inst;
+
+		inst = msm_cvp_open(MSM_CORE_CVP, MSM_CVP_USER);
+		if (!inst) {
+			dprintk(CVP_ERR,
+			"Failed to create eva instance\n");
+			return -ENOMEM;
+		}
+		rc = msm_cvp_session_create(inst);
+		if (rc)
+			dprintk(CVP_ERR, "Failed to create eva session\n");
+
+		rc = msm_cvp_close(inst);
+		if (rc) {
+			dprintk(CVP_ERR,
+			"Failed to close eva instance\n");
+			return rc;
+		}
 	}
 	booted = 1;
 	return count;

+ 1 - 4
msm/eva/msm_cvp.c

@@ -1053,7 +1053,7 @@ static int msm_cvp_unregister_buffer(struct msm_cvp_inst *inst,
 	return rc;
 }
 
-static int msm_cvp_session_create(struct msm_cvp_inst *inst)
+int msm_cvp_session_create(struct msm_cvp_inst *inst)
 {
 	int rc = 0;
 	struct synx_initialization_params params;
@@ -1884,9 +1884,6 @@ int msm_cvp_session_init(struct msm_cvp_inst *inst)
 	inst->clk_data.sys_cache_bw = 1000;
 
 	inst->prop.type = HFI_SESSION_CV;
-	if (inst->session_type == MSM_CVP_KERNEL)
-		inst->prop.type = HFI_SESSION_DMM;
-
 	inst->prop.kernel_mask = 0xFFFFFFFF;
 	inst->prop.priority = 0;
 	inst->prop.is_secure = 0;

+ 1 - 0
msm/eva/msm_cvp.h

@@ -33,5 +33,6 @@ int msm_cvp_handle_syscall(struct msm_cvp_inst *inst, struct eva_kmd_arg *arg);
 int msm_cvp_session_init(struct msm_cvp_inst *inst);
 int msm_cvp_session_deinit(struct msm_cvp_inst *inst);
 int msm_cvp_session_queue_stop(struct msm_cvp_inst *inst);
+int msm_cvp_session_create(struct msm_cvp_inst *inst);
 int cvp_stop_clean_fence_queue(struct msm_cvp_inst *inst);
 #endif