Loading drivers/media/platform/msm/vidc/venus_hfi.c +28 −9 Original line number Diff line number Diff line Loading @@ -1225,10 +1225,20 @@ static inline int venus_hfi_tzbsp_set_video_state(enum tzbsp_video_state state) struct tzbsp_video_set_state_req cmd = {0}; int tzbsp_rsp = 0; int rc = 0; cmd.state = state; cmd.spare = 0; rc = scm_call(SCM_SVC_BOOT, TZBSP_VIDEO_SET_STATE, &cmd, sizeof(cmd), &tzbsp_rsp, sizeof(tzbsp_rsp)); struct scm_desc desc = {0}; desc.args[0] = cmd.state = state; desc.args[1] = cmd.spare = 0; desc.arginfo = SCM_ARGS(2); if (!is_scm_armv8()) { rc = scm_call(SCM_SVC_BOOT, TZBSP_VIDEO_SET_STATE, &cmd, sizeof(cmd), &tzbsp_rsp, sizeof(tzbsp_rsp)); } else { rc = scm_call2(SCM_SIP_FNID(SCM_SVC_BOOT, TZBSP_VIDEO_SET_STATE), &desc); tzbsp_rsp = desc.ret[0]; } if (rc) { dprintk(VIDC_ERR, "Failed scm_call %d\n", rc); return rc; Loading Loading @@ -3745,6 +3755,7 @@ static int protect_cp_mem(struct venus_hfi_device *device) struct iommu_set *iommu_group_set; struct iommu_info *iommu_map; int i; struct scm_desc desc = {0}; if (!device) return -EINVAL; Loading @@ -3763,21 +3774,29 @@ static int protect_cp_mem(struct venus_hfi_device *device) for (i = 0; i < iommu_group_set->count; i++) { iommu_map = &iommu_group_set->iommu_maps[i]; if (strcmp(iommu_map->name, "venus_ns") == 0) memprot.cp_size = iommu_map->addr_range[0].start; desc.args[1] = memprot.cp_size = iommu_map->addr_range[0].start; if (strcmp(iommu_map->name, "venus_sec_non_pixel") == 0) { memprot.cp_nonpixel_start = desc.args[2] = memprot.cp_nonpixel_start = iommu_map->addr_range[0].start; memprot.cp_nonpixel_size = desc.args[3] = memprot.cp_nonpixel_size = iommu_map->addr_range[0].size; } else if (strcmp(iommu_map->name, "venus_cp") == 0) { memprot.cp_nonpixel_start = desc.args[2] = memprot.cp_nonpixel_start = iommu_map->addr_range[1].start; } } if (!is_scm_armv8()) { rc = scm_call(SCM_SVC_MP, TZBSP_MEM_PROTECT_VIDEO_VAR, &memprot, sizeof(memprot), &resp, sizeof(resp)); } else { desc.arginfo = SCM_ARGS(4); rc = scm_call2(SCM_SIP_FNID(SCM_SVC_MP, TZBSP_MEM_PROTECT_VIDEO_VAR), &desc); resp = desc.ret[0]; } if (rc) dprintk(VIDC_ERR, "Failed to protect memory , rc is :%d, response : %d\n", Loading Loading
drivers/media/platform/msm/vidc/venus_hfi.c +28 −9 Original line number Diff line number Diff line Loading @@ -1225,10 +1225,20 @@ static inline int venus_hfi_tzbsp_set_video_state(enum tzbsp_video_state state) struct tzbsp_video_set_state_req cmd = {0}; int tzbsp_rsp = 0; int rc = 0; cmd.state = state; cmd.spare = 0; rc = scm_call(SCM_SVC_BOOT, TZBSP_VIDEO_SET_STATE, &cmd, sizeof(cmd), &tzbsp_rsp, sizeof(tzbsp_rsp)); struct scm_desc desc = {0}; desc.args[0] = cmd.state = state; desc.args[1] = cmd.spare = 0; desc.arginfo = SCM_ARGS(2); if (!is_scm_armv8()) { rc = scm_call(SCM_SVC_BOOT, TZBSP_VIDEO_SET_STATE, &cmd, sizeof(cmd), &tzbsp_rsp, sizeof(tzbsp_rsp)); } else { rc = scm_call2(SCM_SIP_FNID(SCM_SVC_BOOT, TZBSP_VIDEO_SET_STATE), &desc); tzbsp_rsp = desc.ret[0]; } if (rc) { dprintk(VIDC_ERR, "Failed scm_call %d\n", rc); return rc; Loading Loading @@ -3745,6 +3755,7 @@ static int protect_cp_mem(struct venus_hfi_device *device) struct iommu_set *iommu_group_set; struct iommu_info *iommu_map; int i; struct scm_desc desc = {0}; if (!device) return -EINVAL; Loading @@ -3763,21 +3774,29 @@ static int protect_cp_mem(struct venus_hfi_device *device) for (i = 0; i < iommu_group_set->count; i++) { iommu_map = &iommu_group_set->iommu_maps[i]; if (strcmp(iommu_map->name, "venus_ns") == 0) memprot.cp_size = iommu_map->addr_range[0].start; desc.args[1] = memprot.cp_size = iommu_map->addr_range[0].start; if (strcmp(iommu_map->name, "venus_sec_non_pixel") == 0) { memprot.cp_nonpixel_start = desc.args[2] = memprot.cp_nonpixel_start = iommu_map->addr_range[0].start; memprot.cp_nonpixel_size = desc.args[3] = memprot.cp_nonpixel_size = iommu_map->addr_range[0].size; } else if (strcmp(iommu_map->name, "venus_cp") == 0) { memprot.cp_nonpixel_start = desc.args[2] = memprot.cp_nonpixel_start = iommu_map->addr_range[1].start; } } if (!is_scm_armv8()) { rc = scm_call(SCM_SVC_MP, TZBSP_MEM_PROTECT_VIDEO_VAR, &memprot, sizeof(memprot), &resp, sizeof(resp)); } else { desc.arginfo = SCM_ARGS(4); rc = scm_call2(SCM_SIP_FNID(SCM_SVC_MP, TZBSP_MEM_PROTECT_VIDEO_VAR), &desc); resp = desc.ret[0]; } if (rc) dprintk(VIDC_ERR, "Failed to protect memory , rc is :%d, response : %d\n", Loading