Loading drivers/media/platform/msm/ais/cam_core/cam_context_utils.c +16 −5 Original line number Diff line number Diff line Loading @@ -459,6 +459,17 @@ int32_t cam_context_prepare_dev_to_hw(struct cam_context *ctx, "[%s][%d] : Moving req[%llu] from free_list to pending_list", ctx->dev_name, ctx->ctx_id, req->request_id); for (j = 0; j < req->num_in_map_entries; j++) { rc = cam_sync_check_valid( req->in_map_entries[j].sync_id); if (rc) { CAM_ERR(CAM_CTXT, "invalid in map sync object %d", req->in_map_entries[j].sync_id); goto put_ref; } } for (j = 0; j < req->num_in_map_entries; j++) { cam_context_getref(ctx); rc = cam_sync_register_callback( Loading @@ -480,7 +491,9 @@ int32_t cam_context_prepare_dev_to_hw(struct cam_context *ctx, ctx->dev_name, ctx->ctx_id, req->request_id); goto put_ctx_ref; cam_context_putref(ctx); goto put_ref; } CAM_DBG(CAM_CTXT, "register in fence cb: %d ret = %d", req->in_map_entries[j].sync_id, rc); Loading @@ -492,9 +505,7 @@ int32_t cam_context_prepare_dev_to_hw(struct cam_context *ctx, ctx->dev_name, ctx->ctx_id); return rc; put_ctx_ref: for (j; j >= 0; j--) cam_context_putref(ctx); put_ref: for (--i; i >= 0; i--) { if (cam_sync_put_obj_ref(req->out_map_entries[i].sync_id)) Loading Loading @@ -578,7 +589,7 @@ int32_t cam_context_acquire_dev_to_hw(struct cam_context *ctx, req_hdl_param.media_entity_flag = 0; req_hdl_param.priv = ctx; req_hdl_param.ops = ctx->crm_ctx_intf; req_hdl_param.dev_id = ctx->dev_id; ctx->dev_hdl = cam_create_device_hdl(&req_hdl_param); if (ctx->dev_hdl <= 0) { rc = -EFAULT; Loading drivers/media/platform/msm/ais/cam_cpas/cam_cpas_hw.c +23 −6 Original line number Diff line number Diff line Loading @@ -568,7 +568,7 @@ static int cam_cpas_util_set_camnoc_axi_clk_rate( struct cam_cpas_axi_port *curr_axi_port = NULL; struct cam_cpas_axi_port *temp_axi_port = NULL; uint64_t required_camnoc_bw = 0; int32_t clk_rate = 0; int64_t clk_rate = 0; list_for_each_entry_safe(curr_axi_port, temp_axi_port, &cpas_core->axi_ports_list_head, sibling_port) { Loading Loading @@ -596,13 +596,13 @@ static int cam_cpas_util_set_camnoc_axi_clk_rate( clk_rate = required_camnoc_bw / soc_private->camnoc_bus_width; CAM_DBG(CAM_CPAS, "Setting camnoc axi clk rate : %llu %d", CAM_DBG(CAM_CPAS, "Setting camnoc axi clk rate : %llu %lld", required_camnoc_bw, clk_rate); rc = cam_soc_util_set_src_clk_rate(soc_info, clk_rate); if (rc) CAM_ERR(CAM_CPAS, "Failed in setting camnoc axi clk %llu %d %d", "Failed in setting camnoc axi clk %llu %lld %d", required_camnoc_bw, clk_rate, rc); } Loading Loading @@ -980,8 +980,10 @@ static int cam_cpas_hw_start(void *hw_priv, void *start_args, return -EINVAL; } if (!CAM_CPAS_CLIENT_VALID(client_indx)) if (!CAM_CPAS_CLIENT_VALID(client_indx)) { CAM_ERR(CAM_CPAS, "Client index invalid %d", client_indx); return -EINVAL; } mutex_lock(&cpas_hw->hw_mutex); mutex_lock(&cpas_core->client_mutex[client_indx]); Loading Loading @@ -1099,8 +1101,10 @@ static int cam_cpas_hw_stop(void *hw_priv, void *stop_args, cmd_hw_stop = (struct cam_cpas_hw_cmd_stop *)stop_args; client_indx = CAM_CPAS_GET_CLIENT_IDX(cmd_hw_stop->client_handle); if (!CAM_CPAS_CLIENT_VALID(client_indx)) if (!CAM_CPAS_CLIENT_VALID(client_indx)) { CAM_ERR(CAM_CPAS, "Client index invalid %d", client_indx); return -EINVAL; } mutex_lock(&cpas_hw->hw_mutex); mutex_lock(&cpas_core->client_mutex[client_indx]); Loading Loading @@ -1162,14 +1166,20 @@ static int cam_cpas_hw_stop(void *hw_priv, void *stop_args, ahb_vote.vote.level = CAM_SUSPEND_VOTE; rc = cam_cpas_util_apply_client_ahb_vote(cpas_hw, cpas_client, &ahb_vote, NULL); if (rc) if (rc) { CAM_ERR(CAM_CPAS, "ahb vote failed for %s rc %d", cpas_client->data.identifier, rc); goto done; } axi_vote.uncompressed_bw = 0; axi_vote.compressed_bw = 0; axi_vote.compressed_bw_ab = 0; rc = cam_cpas_util_apply_client_axi_vote(cpas_hw, cpas_client, &axi_vote); if (rc) CAM_ERR(CAM_CPAS, "axi vote failed for %s rc %d", cpas_client->data.identifier, rc); done: mutex_unlock(&cpas_core->client_mutex[client_indx]); Loading Loading @@ -1234,6 +1244,13 @@ static int cam_cpas_hw_register_client(struct cam_hw_info *cpas_hw, rc = cam_common_util_get_string_index(soc_private->client_name, soc_private->num_clients, client_name, &client_indx); if (rc) { CAM_ERR(CAM_CPAS, "No match found for client %s", client_name); mutex_unlock(&cpas_hw->hw_mutex); return rc; } mutex_lock(&cpas_core->client_mutex[client_indx]); if (rc || !CAM_CPAS_CLIENT_VALID(client_indx) || Loading drivers/media/platform/msm/ais/cam_cpas/cpas_top/cam_cpastop_hw.c +7 −0 Original line number Diff line number Diff line Loading @@ -406,6 +406,12 @@ static void cam_cpastop_work(struct work_struct *work) return; } mutex_lock(&cpas_hw->hw_mutex); if (cpas_hw->hw_state == CAM_HW_STATE_POWER_DOWN) { CAM_ERR(CAM_CPAS, "CPAS CORE is off"); mutex_unlock(&cpas_hw->hw_mutex); return; } for (i = 0; i < camnoc_info->irq_err_size; i++) { if ((payload->irq_status & camnoc_info->irq_err[i].sbm_port) && (camnoc_info->irq_err[i].enable)) { Loading Loading @@ -451,6 +457,7 @@ static void cam_cpastop_work(struct work_struct *work) ~camnoc_info->irq_err[i].sbm_port; } } mutex_unlock(&cpas_hw->hw_mutex); atomic_dec(&cpas_core->irq_count); wake_up(&cpas_core->irq_count_wq); CAM_DBG(CAM_CPAS, "irq_count=%d\n", atomic_read(&cpas_core->irq_count)); Loading drivers/media/platform/msm/ais/cam_fd/fd_hw_mgr/fd_hw/cam_fd_hw_dev.c +1 −5 Original line number Diff line number Diff line /* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. /* Copyright (c) 2017-2019, 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 @@ -206,10 +206,6 @@ static const struct of_device_id cam_fd_hw_dt_match[] = { .compatible = "qcom,fd501", .data = &cam_fd_wrapper200_core501_info, }, { .compatible = "qcom,fd501", .data = &cam_fd_wrapper200_core501_info, }, {} }; MODULE_DEVICE_TABLE(of, cam_fd_hw_dt_match); Loading drivers/media/platform/msm/ais/cam_icp/fw_inc/hfi_sys_defs.h +22 −1 Original line number Diff line number Diff line /* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. /* Copyright (c) 2017-2019, 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 @@ -215,6 +215,27 @@ #define HFI_DEV_VERSION_MAX 0x5 /* General errors and HFI Specific errors. */ enum hfi_errors { CAMERAICP_SUCCESS, CAMERAICP_EFAILED, CAMERAICP_ENOMEMORY, CAMERAICP_EBADSTATE, CAMERAICP_EBADPARM, CAMERAICP_EBADITEM, CAMERAICP_EINVALIDFORMAT, CAMERAICP_EUNSUPPORTED, CAMERAICP_EOUTOFBOUND, CAMERAICP_ETIMEDOUT, CAMERAICP_EABORTED, CAMERAICP_EHWVIOLATION, CAMERAICP_ECDMERROR, CAMERAICP_HFI_ERR_COMMAND_SIZE = 1000, CAMERAICP_HFI_ERR_MESSAGE_SIZE, CAMERAICP_HFI_QUEUE_EMPTY, CAMERAICP_HFI_QUEUE_FULL, }; /** * start of sys command packet types * These commands are used to get system level information Loading Loading
drivers/media/platform/msm/ais/cam_core/cam_context_utils.c +16 −5 Original line number Diff line number Diff line Loading @@ -459,6 +459,17 @@ int32_t cam_context_prepare_dev_to_hw(struct cam_context *ctx, "[%s][%d] : Moving req[%llu] from free_list to pending_list", ctx->dev_name, ctx->ctx_id, req->request_id); for (j = 0; j < req->num_in_map_entries; j++) { rc = cam_sync_check_valid( req->in_map_entries[j].sync_id); if (rc) { CAM_ERR(CAM_CTXT, "invalid in map sync object %d", req->in_map_entries[j].sync_id); goto put_ref; } } for (j = 0; j < req->num_in_map_entries; j++) { cam_context_getref(ctx); rc = cam_sync_register_callback( Loading @@ -480,7 +491,9 @@ int32_t cam_context_prepare_dev_to_hw(struct cam_context *ctx, ctx->dev_name, ctx->ctx_id, req->request_id); goto put_ctx_ref; cam_context_putref(ctx); goto put_ref; } CAM_DBG(CAM_CTXT, "register in fence cb: %d ret = %d", req->in_map_entries[j].sync_id, rc); Loading @@ -492,9 +505,7 @@ int32_t cam_context_prepare_dev_to_hw(struct cam_context *ctx, ctx->dev_name, ctx->ctx_id); return rc; put_ctx_ref: for (j; j >= 0; j--) cam_context_putref(ctx); put_ref: for (--i; i >= 0; i--) { if (cam_sync_put_obj_ref(req->out_map_entries[i].sync_id)) Loading Loading @@ -578,7 +589,7 @@ int32_t cam_context_acquire_dev_to_hw(struct cam_context *ctx, req_hdl_param.media_entity_flag = 0; req_hdl_param.priv = ctx; req_hdl_param.ops = ctx->crm_ctx_intf; req_hdl_param.dev_id = ctx->dev_id; ctx->dev_hdl = cam_create_device_hdl(&req_hdl_param); if (ctx->dev_hdl <= 0) { rc = -EFAULT; Loading
drivers/media/platform/msm/ais/cam_cpas/cam_cpas_hw.c +23 −6 Original line number Diff line number Diff line Loading @@ -568,7 +568,7 @@ static int cam_cpas_util_set_camnoc_axi_clk_rate( struct cam_cpas_axi_port *curr_axi_port = NULL; struct cam_cpas_axi_port *temp_axi_port = NULL; uint64_t required_camnoc_bw = 0; int32_t clk_rate = 0; int64_t clk_rate = 0; list_for_each_entry_safe(curr_axi_port, temp_axi_port, &cpas_core->axi_ports_list_head, sibling_port) { Loading Loading @@ -596,13 +596,13 @@ static int cam_cpas_util_set_camnoc_axi_clk_rate( clk_rate = required_camnoc_bw / soc_private->camnoc_bus_width; CAM_DBG(CAM_CPAS, "Setting camnoc axi clk rate : %llu %d", CAM_DBG(CAM_CPAS, "Setting camnoc axi clk rate : %llu %lld", required_camnoc_bw, clk_rate); rc = cam_soc_util_set_src_clk_rate(soc_info, clk_rate); if (rc) CAM_ERR(CAM_CPAS, "Failed in setting camnoc axi clk %llu %d %d", "Failed in setting camnoc axi clk %llu %lld %d", required_camnoc_bw, clk_rate, rc); } Loading Loading @@ -980,8 +980,10 @@ static int cam_cpas_hw_start(void *hw_priv, void *start_args, return -EINVAL; } if (!CAM_CPAS_CLIENT_VALID(client_indx)) if (!CAM_CPAS_CLIENT_VALID(client_indx)) { CAM_ERR(CAM_CPAS, "Client index invalid %d", client_indx); return -EINVAL; } mutex_lock(&cpas_hw->hw_mutex); mutex_lock(&cpas_core->client_mutex[client_indx]); Loading Loading @@ -1099,8 +1101,10 @@ static int cam_cpas_hw_stop(void *hw_priv, void *stop_args, cmd_hw_stop = (struct cam_cpas_hw_cmd_stop *)stop_args; client_indx = CAM_CPAS_GET_CLIENT_IDX(cmd_hw_stop->client_handle); if (!CAM_CPAS_CLIENT_VALID(client_indx)) if (!CAM_CPAS_CLIENT_VALID(client_indx)) { CAM_ERR(CAM_CPAS, "Client index invalid %d", client_indx); return -EINVAL; } mutex_lock(&cpas_hw->hw_mutex); mutex_lock(&cpas_core->client_mutex[client_indx]); Loading Loading @@ -1162,14 +1166,20 @@ static int cam_cpas_hw_stop(void *hw_priv, void *stop_args, ahb_vote.vote.level = CAM_SUSPEND_VOTE; rc = cam_cpas_util_apply_client_ahb_vote(cpas_hw, cpas_client, &ahb_vote, NULL); if (rc) if (rc) { CAM_ERR(CAM_CPAS, "ahb vote failed for %s rc %d", cpas_client->data.identifier, rc); goto done; } axi_vote.uncompressed_bw = 0; axi_vote.compressed_bw = 0; axi_vote.compressed_bw_ab = 0; rc = cam_cpas_util_apply_client_axi_vote(cpas_hw, cpas_client, &axi_vote); if (rc) CAM_ERR(CAM_CPAS, "axi vote failed for %s rc %d", cpas_client->data.identifier, rc); done: mutex_unlock(&cpas_core->client_mutex[client_indx]); Loading Loading @@ -1234,6 +1244,13 @@ static int cam_cpas_hw_register_client(struct cam_hw_info *cpas_hw, rc = cam_common_util_get_string_index(soc_private->client_name, soc_private->num_clients, client_name, &client_indx); if (rc) { CAM_ERR(CAM_CPAS, "No match found for client %s", client_name); mutex_unlock(&cpas_hw->hw_mutex); return rc; } mutex_lock(&cpas_core->client_mutex[client_indx]); if (rc || !CAM_CPAS_CLIENT_VALID(client_indx) || Loading
drivers/media/platform/msm/ais/cam_cpas/cpas_top/cam_cpastop_hw.c +7 −0 Original line number Diff line number Diff line Loading @@ -406,6 +406,12 @@ static void cam_cpastop_work(struct work_struct *work) return; } mutex_lock(&cpas_hw->hw_mutex); if (cpas_hw->hw_state == CAM_HW_STATE_POWER_DOWN) { CAM_ERR(CAM_CPAS, "CPAS CORE is off"); mutex_unlock(&cpas_hw->hw_mutex); return; } for (i = 0; i < camnoc_info->irq_err_size; i++) { if ((payload->irq_status & camnoc_info->irq_err[i].sbm_port) && (camnoc_info->irq_err[i].enable)) { Loading Loading @@ -451,6 +457,7 @@ static void cam_cpastop_work(struct work_struct *work) ~camnoc_info->irq_err[i].sbm_port; } } mutex_unlock(&cpas_hw->hw_mutex); atomic_dec(&cpas_core->irq_count); wake_up(&cpas_core->irq_count_wq); CAM_DBG(CAM_CPAS, "irq_count=%d\n", atomic_read(&cpas_core->irq_count)); Loading
drivers/media/platform/msm/ais/cam_fd/fd_hw_mgr/fd_hw/cam_fd_hw_dev.c +1 −5 Original line number Diff line number Diff line /* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. /* Copyright (c) 2017-2019, 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 @@ -206,10 +206,6 @@ static const struct of_device_id cam_fd_hw_dt_match[] = { .compatible = "qcom,fd501", .data = &cam_fd_wrapper200_core501_info, }, { .compatible = "qcom,fd501", .data = &cam_fd_wrapper200_core501_info, }, {} }; MODULE_DEVICE_TABLE(of, cam_fd_hw_dt_match); Loading
drivers/media/platform/msm/ais/cam_icp/fw_inc/hfi_sys_defs.h +22 −1 Original line number Diff line number Diff line /* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. /* Copyright (c) 2017-2019, 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 @@ -215,6 +215,27 @@ #define HFI_DEV_VERSION_MAX 0x5 /* General errors and HFI Specific errors. */ enum hfi_errors { CAMERAICP_SUCCESS, CAMERAICP_EFAILED, CAMERAICP_ENOMEMORY, CAMERAICP_EBADSTATE, CAMERAICP_EBADPARM, CAMERAICP_EBADITEM, CAMERAICP_EINVALIDFORMAT, CAMERAICP_EUNSUPPORTED, CAMERAICP_EOUTOFBOUND, CAMERAICP_ETIMEDOUT, CAMERAICP_EABORTED, CAMERAICP_EHWVIOLATION, CAMERAICP_ECDMERROR, CAMERAICP_HFI_ERR_COMMAND_SIZE = 1000, CAMERAICP_HFI_ERR_MESSAGE_SIZE, CAMERAICP_HFI_QUEUE_EMPTY, CAMERAICP_HFI_QUEUE_FULL, }; /** * start of sys command packet types * These commands are used to get system level information Loading