Browse Source

video: driver: Add queues init in video core init

Call venus_hfi_interface_queues_init() from venus_hfi_core_init()
to initialize the hfi queues if they were not initialized already
in probe sequence.

Change-Id: I855d2b2b6404a1a2af79157576f07e5a0c207fb6
Signed-off-by: Akshata Sahukar <[email protected]>
Akshata Sahukar 3 years ago
parent
commit
a8091c92b9
1 changed files with 14 additions and 2 deletions
  1. 14 2
      driver/vidc/src/venus_hfi.c

+ 14 - 2
driver/vidc/src/venus_hfi.c

@@ -2240,6 +2240,11 @@ int venus_hfi_interface_queues_init(struct msm_vidc_core *core)
 
 	d_vpr_h("%s()\n", __func__);
 
+	if (core->iface_q_table.align_virtual_addr) {
+		d_vpr_h("%s: queues already allocated\n", __func__);
+		return 0;
+	}
+
 	memset(&alloc, 0, sizeof(alloc));
 	alloc.type       = MSM_VIDC_BUF_QUEUE;
 	alloc.region     = MSM_VIDC_NON_SECURE;
@@ -2500,10 +2505,13 @@ int __load_fw(struct msm_vidc_core *core)
 
 	/* configure interface_queues memory to firmware */
 	rc = call_venus_op(core, setup_ucregion_memmap, core);
-	if (rc)
-		return rc;
+	if (rc) {
+		d_vpr_e("%s: failed to setup ucregion\n");
+		goto fail_setup_ucregion;
+	}
 
 	return rc;
+fail_setup_ucregion:
 fail_protect_mem:
 	if (core->dt->fw_cookie)
 		qcom_scm_pas_shutdown(core->dt->fw_cookie);
@@ -2706,6 +2714,10 @@ int venus_hfi_core_init(struct msm_vidc_core *core)
 	if (rc)
 		return rc;
 
+	rc = venus_hfi_interface_queues_init(core);
+	if (rc)
+		goto error;
+
 	rc = __load_fw(core);
 	if (rc)
 		goto error;