Loading drivers/media/platform/msm/camera/cam_fd/fd_hw_mgr/fd_hw/cam_fd_hw_core.c +2 −1 Original line number Diff line number Diff line /* Copyright (c) 2017, The Linux Foundation. All rights reserved. /* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -1092,6 +1092,7 @@ int cam_fd_hw_release(void *hw_priv, void *hw_release_args, uint32_t arg_size) CAM_ERR(CAM_FD, "Release cdm handle failed, handle=0x%x, rc=%d", ctx_hw_private->cdm_handle, rc); kfree(ctx_hw_private->cdm_cmd); kfree(ctx_hw_private); release_args->ctx_hw_private = NULL; Loading drivers/media/platform/msm/camera/cam_icp/icp_hw/a5_hw/a5_core.c +10 −10 Original line number Diff line number Diff line /* Copyright (c) 2017, The Linux Foundation. All rights reserved. /* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -207,37 +207,38 @@ static int32_t cam_a5_download_fw(void *device_priv) if (!core_info->fw_elf) { CAM_ERR(CAM_ICP, "Invalid elf size"); return -EINVAL; rc = -EINVAL; goto fw_download_failed; } fw_start = core_info->fw_elf->data; rc = cam_icp_validate_fw(fw_start); if (rc) { CAM_ERR(CAM_ICP, "fw elf validation failed"); return -EINVAL; goto fw_download_failed; } rc = cam_icp_get_fw_size(fw_start, &fw_size); if (rc) { CAM_ERR(CAM_ICP, "unable to get fw size"); return rc; goto fw_download_failed; } if (core_info->fw_buf_len < fw_size) { CAM_ERR(CAM_ICP, "mismatch in fw size: %u %llu", fw_size, core_info->fw_buf_len); goto fw_alloc_failed; rc = -EINVAL; goto fw_download_failed; } rc = cam_icp_program_fw(fw_start, core_info); if (rc) { CAM_ERR(CAM_ICP, "fw program is failed"); goto fw_program_failed; goto fw_download_failed; } return 0; fw_program_failed: fw_alloc_failed: fw_download_failed: release_firmware(core_info->fw_elf); return rc; } Loading Loading @@ -387,7 +388,6 @@ int cam_a5_process_cmd(void *device_priv, uint32_t cmd_type, switch (cmd_type) { case CAM_ICP_A5_CMD_FW_DOWNLOAD: rc = cam_a5_download_fw(device_priv); break; case CAM_ICP_A5_CMD_SET_FW_BUF: { struct cam_icp_a5_set_fw_buf_info *fw_buf_info = cmd_args; Loading drivers/media/platform/msm/camera/cam_jpeg/jpeg_hw/cam_jpeg_hw_mgr.c +7 −14 Original line number Diff line number Diff line /* Copyright (c) 2017, The Linux Foundation. All rights reserved. /* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -924,6 +924,7 @@ static int cam_jpeg_mgr_release_hw(void *hw_mgr_priv, void *release_hw_args) if (hw_mgr->cdm_info[dev_type][0].ref_cnt == 0) { mutex_unlock(&hw_mgr->hw_mgr_mutex); CAM_ERR(CAM_JPEG, "Error Unbalanced deinit"); kfree(ctx_data->cdm_cmd); return -EFAULT; } Loading @@ -943,9 +944,12 @@ static int cam_jpeg_mgr_release_hw(void *hw_mgr_priv, void *release_hw_args) rc = cam_jpeg_mgr_release_ctx(hw_mgr, ctx_data); if (rc) { mutex_unlock(&hw_mgr->hw_mgr_mutex); CAM_ERR(CAM_JPEG, "JPEG release ctx failed"); kfree(ctx_data->cdm_cmd); return -EINVAL; } kfree(ctx_data->cdm_cmd); CAM_DBG(CAM_JPEG, "handle %llu", ctx_data); return rc; Loading Loading @@ -999,7 +1003,7 @@ static int cam_jpeg_mgr_acquire_hw(void *hw_mgr_priv, void *acquire_hw_args) sizeof(struct cam_cdm_bl_cmd))), GFP_KERNEL); if (!ctx_data->cdm_cmd) { rc = -ENOMEM; goto acq_cdm_hdl_failed; goto jpeg_release_ctx; } mutex_lock(&ctx_data->ctx_mutex); Loading Loading @@ -1046,20 +1050,8 @@ static int cam_jpeg_mgr_acquire_hw(void *hw_mgr_priv, void *acquire_hw_args) hw_mgr->cdm_info[dev_type][0].ref_cnt++; } ctx_data->cdm_cmd_chbase = kzalloc(((sizeof(struct cam_cdm_bl_request)) + (2 * sizeof(struct cam_cdm_bl_cmd))), GFP_KERNEL); if (!ctx_data->cdm_cmd_chbase) { rc = -ENOMEM; goto start_cdm_hdl_failed; } size = hw_mgr->cdm_info[dev_type][0]. cdm_ops->cdm_required_size_changebase(); ctx_data->cmd_chbase_buf_addr = kzalloc(size*4, GFP_KERNEL); if (!ctx_data->cdm_cmd_chbase) { rc = -ENOMEM; goto start_cdm_hdl_failed; } if (hw_mgr->cdm_info[dev_type][0].ref_cnt == 1) if (cam_cdm_stream_on( Loading Loading @@ -1101,6 +1093,7 @@ static int cam_jpeg_mgr_acquire_hw(void *hw_mgr_priv, void *acquire_hw_args) hw_mgr->cdm_info[dev_type][0].ref_cnt--; acq_cdm_hdl_failed: kfree(ctx_data->cdm_cmd); jpeg_release_ctx: cam_jpeg_mgr_release_ctx(hw_mgr, ctx_data); mutex_unlock(&hw_mgr->hw_mgr_mutex); Loading drivers/media/platform/msm/camera/cam_jpeg/jpeg_hw/cam_jpeg_hw_mgr.h +1 −5 Original line number Diff line number Diff line /* Copyright (c) 2017, The Linux Foundation. All rights reserved. /* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -95,8 +95,6 @@ struct cam_jpeg_hw_cfg_req { * @in_use: Flag for context usage * @wait_complete: Completion info * @cdm_cmd: Cdm cmd submitted for that context. * @cdm_cmd_chbase: Change base cdm command from context * @cmd_chbase_buf_addr : Change base cmd buf address */ struct cam_jpeg_hw_ctx_data { void *context_priv; Loading @@ -106,8 +104,6 @@ struct cam_jpeg_hw_ctx_data { bool in_use; struct completion wait_complete; struct cam_cdm_bl_request *cdm_cmd; struct cam_cdm_bl_request *cdm_cmd_chbase; uint32_t *cmd_chbase_buf_addr; }; /** Loading Loading
drivers/media/platform/msm/camera/cam_fd/fd_hw_mgr/fd_hw/cam_fd_hw_core.c +2 −1 Original line number Diff line number Diff line /* Copyright (c) 2017, The Linux Foundation. All rights reserved. /* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -1092,6 +1092,7 @@ int cam_fd_hw_release(void *hw_priv, void *hw_release_args, uint32_t arg_size) CAM_ERR(CAM_FD, "Release cdm handle failed, handle=0x%x, rc=%d", ctx_hw_private->cdm_handle, rc); kfree(ctx_hw_private->cdm_cmd); kfree(ctx_hw_private); release_args->ctx_hw_private = NULL; Loading
drivers/media/platform/msm/camera/cam_icp/icp_hw/a5_hw/a5_core.c +10 −10 Original line number Diff line number Diff line /* Copyright (c) 2017, The Linux Foundation. All rights reserved. /* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -207,37 +207,38 @@ static int32_t cam_a5_download_fw(void *device_priv) if (!core_info->fw_elf) { CAM_ERR(CAM_ICP, "Invalid elf size"); return -EINVAL; rc = -EINVAL; goto fw_download_failed; } fw_start = core_info->fw_elf->data; rc = cam_icp_validate_fw(fw_start); if (rc) { CAM_ERR(CAM_ICP, "fw elf validation failed"); return -EINVAL; goto fw_download_failed; } rc = cam_icp_get_fw_size(fw_start, &fw_size); if (rc) { CAM_ERR(CAM_ICP, "unable to get fw size"); return rc; goto fw_download_failed; } if (core_info->fw_buf_len < fw_size) { CAM_ERR(CAM_ICP, "mismatch in fw size: %u %llu", fw_size, core_info->fw_buf_len); goto fw_alloc_failed; rc = -EINVAL; goto fw_download_failed; } rc = cam_icp_program_fw(fw_start, core_info); if (rc) { CAM_ERR(CAM_ICP, "fw program is failed"); goto fw_program_failed; goto fw_download_failed; } return 0; fw_program_failed: fw_alloc_failed: fw_download_failed: release_firmware(core_info->fw_elf); return rc; } Loading Loading @@ -387,7 +388,6 @@ int cam_a5_process_cmd(void *device_priv, uint32_t cmd_type, switch (cmd_type) { case CAM_ICP_A5_CMD_FW_DOWNLOAD: rc = cam_a5_download_fw(device_priv); break; case CAM_ICP_A5_CMD_SET_FW_BUF: { struct cam_icp_a5_set_fw_buf_info *fw_buf_info = cmd_args; Loading
drivers/media/platform/msm/camera/cam_jpeg/jpeg_hw/cam_jpeg_hw_mgr.c +7 −14 Original line number Diff line number Diff line /* Copyright (c) 2017, The Linux Foundation. All rights reserved. /* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -924,6 +924,7 @@ static int cam_jpeg_mgr_release_hw(void *hw_mgr_priv, void *release_hw_args) if (hw_mgr->cdm_info[dev_type][0].ref_cnt == 0) { mutex_unlock(&hw_mgr->hw_mgr_mutex); CAM_ERR(CAM_JPEG, "Error Unbalanced deinit"); kfree(ctx_data->cdm_cmd); return -EFAULT; } Loading @@ -943,9 +944,12 @@ static int cam_jpeg_mgr_release_hw(void *hw_mgr_priv, void *release_hw_args) rc = cam_jpeg_mgr_release_ctx(hw_mgr, ctx_data); if (rc) { mutex_unlock(&hw_mgr->hw_mgr_mutex); CAM_ERR(CAM_JPEG, "JPEG release ctx failed"); kfree(ctx_data->cdm_cmd); return -EINVAL; } kfree(ctx_data->cdm_cmd); CAM_DBG(CAM_JPEG, "handle %llu", ctx_data); return rc; Loading Loading @@ -999,7 +1003,7 @@ static int cam_jpeg_mgr_acquire_hw(void *hw_mgr_priv, void *acquire_hw_args) sizeof(struct cam_cdm_bl_cmd))), GFP_KERNEL); if (!ctx_data->cdm_cmd) { rc = -ENOMEM; goto acq_cdm_hdl_failed; goto jpeg_release_ctx; } mutex_lock(&ctx_data->ctx_mutex); Loading Loading @@ -1046,20 +1050,8 @@ static int cam_jpeg_mgr_acquire_hw(void *hw_mgr_priv, void *acquire_hw_args) hw_mgr->cdm_info[dev_type][0].ref_cnt++; } ctx_data->cdm_cmd_chbase = kzalloc(((sizeof(struct cam_cdm_bl_request)) + (2 * sizeof(struct cam_cdm_bl_cmd))), GFP_KERNEL); if (!ctx_data->cdm_cmd_chbase) { rc = -ENOMEM; goto start_cdm_hdl_failed; } size = hw_mgr->cdm_info[dev_type][0]. cdm_ops->cdm_required_size_changebase(); ctx_data->cmd_chbase_buf_addr = kzalloc(size*4, GFP_KERNEL); if (!ctx_data->cdm_cmd_chbase) { rc = -ENOMEM; goto start_cdm_hdl_failed; } if (hw_mgr->cdm_info[dev_type][0].ref_cnt == 1) if (cam_cdm_stream_on( Loading Loading @@ -1101,6 +1093,7 @@ static int cam_jpeg_mgr_acquire_hw(void *hw_mgr_priv, void *acquire_hw_args) hw_mgr->cdm_info[dev_type][0].ref_cnt--; acq_cdm_hdl_failed: kfree(ctx_data->cdm_cmd); jpeg_release_ctx: cam_jpeg_mgr_release_ctx(hw_mgr, ctx_data); mutex_unlock(&hw_mgr->hw_mgr_mutex); Loading
drivers/media/platform/msm/camera/cam_jpeg/jpeg_hw/cam_jpeg_hw_mgr.h +1 −5 Original line number Diff line number Diff line /* Copyright (c) 2017, The Linux Foundation. All rights reserved. /* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -95,8 +95,6 @@ struct cam_jpeg_hw_cfg_req { * @in_use: Flag for context usage * @wait_complete: Completion info * @cdm_cmd: Cdm cmd submitted for that context. * @cdm_cmd_chbase: Change base cdm command from context * @cmd_chbase_buf_addr : Change base cmd buf address */ struct cam_jpeg_hw_ctx_data { void *context_priv; Loading @@ -106,8 +104,6 @@ struct cam_jpeg_hw_ctx_data { bool in_use; struct completion wait_complete; struct cam_cdm_bl_request *cdm_cmd; struct cam_cdm_bl_request *cdm_cmd_chbase; uint32_t *cmd_chbase_buf_addr; }; /** Loading