Browse Source

msm: eva: Use dummy CB to map secure camera buf

Per SMMU driver team recommendation. The "mapped" result will be
the virtual addresss of S2 VM_SECURE_CAMERA page tables.

Change-Id: Ide5a330e208e503182e4aa46a8fa2ba093202ced
Signed-off-by: George Shen <[email protected]>
George Shen 2 years ago
parent
commit
7b624f7924
2 changed files with 8 additions and 6 deletions
  1. 4 6
      msm/eva/cvp_smem.c
  2. 4 0
      msm/eva/msm_cvp_res_parse.c

+ 4 - 6
msm/eva/cvp_smem.c

@@ -114,11 +114,7 @@ static int msm_dma_get_device_address(struct dma_buf *dbuf, u32 align,
 		}
 
 		if (table->sgl) {
-			if (flags & SMEM_CAMERA) {
-				*iova = sg_phys(table->sgl);
-			} else {
-				*iova = table->sgl->dma_address;
-			}
+			*iova = table->sgl->dma_address;
 		} else {
 			dprintk(CVP_ERR, "sgl is NULL\n");
 			rc = -ENOMEM;
@@ -538,6 +534,7 @@ struct context_bank_info *msm_cvp_smem_get_context_bank(
 	char *non_secure_cb = "cvp_hlos";
 	char *secure_nonpixel_cb = "cvp_sec_nonpixel";
 	char *secure_pixel_cb = "cvp_sec_pixel";
+	char *dummy_cb = "cvp_dummy";
 	bool is_secure = (flags & SMEM_SECURE) ? true : false;
 
 	if (flags & SMEM_PIXEL)
@@ -545,7 +542,8 @@ struct context_bank_info *msm_cvp_smem_get_context_bank(
 	else if (flags & SMEM_NON_PIXEL)
 		search_str = secure_nonpixel_cb;
 	else if (flags & SMEM_CAMERA)
-		search_str = secure_pixel_cb;
+		/* Secure Camera pixel buffer */
+		search_str = dummy_cb;
 	else
 		search_str = non_secure_cb;
 

+ 4 - 0
msm/eva/msm_cvp_res_parse.c

@@ -1063,6 +1063,9 @@ static int msm_cvp_populate_context_bank(struct device *dev,
 	}
 
 	dprintk(CVP_CORE, "%s: context bank has name %s\n", __func__, cb->name);
+	if (!strcmp(cb->name, "cvp_dummy"))
+		goto success_setup_cb;
+
 	rc = of_property_read_u32_array(np, "qcom,iommu-dma-addr-pool",
 			(u32 *)&cb->addr_range, 2);
 	if (rc) {
@@ -1088,6 +1091,7 @@ static int msm_cvp_populate_context_bank(struct device *dev,
 		cb->name, cb->addr_range.start,
 		cb->addr_range.size, cb->buffer_type);
 
+success_setup_cb:
 	cb->domain = iommu_get_domain_for_dev(dev);
 	if (IS_ERR_OR_NULL(cb->domain)) {
 		dprintk(CVP_ERR, "Create domain failed\n");