Loading drivers/media/platform/msm/camera_v3/cam_cdm/cam_cdm_virtual_core.c +9 −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 @@ -118,6 +118,14 @@ int cam_virtual_cdm_submit_bl(struct cam_hw_info *cdm_hw, if ((!rc) && (vaddr_ptr) && (len) && (len >= cdm_cmd->cmd[i].offset)) { if ((len - cdm_cmd->cmd[i].offset) <= cdm_cmd->cmd[i].len) { CAM_ERR(CAM_CDM, "Not enough buffer"); rc = -EINVAL; break; } CAM_DBG(CAM_CDM, "hdl=%x vaddr=%pK offset=%d cmdlen=%d:%zu", cdm_cmd->cmd[i].bl_addr.mem_handle, Loading drivers/media/platform/msm/camera_v3/cam_core/cam_context.c +4 −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 @@ -173,6 +173,7 @@ int cam_context_handle_crm_apply_req(struct cam_context *ctx, return -EINVAL; } mutex_lock(&ctx->ctx_mutex); if (ctx->state_machine[ctx->state].crm_ops.apply_req) { rc = ctx->state_machine[ctx->state].crm_ops.apply_req(ctx, apply); Loading @@ -181,6 +182,7 @@ int cam_context_handle_crm_apply_req(struct cam_context *ctx, ctx->dev_hdl, ctx->state); rc = -EPROTO; } mutex_unlock(&ctx->ctx_mutex); return rc; } Loading Loading @@ -456,6 +458,7 @@ int cam_context_handle_start_dev(struct cam_context *ctx, } mutex_lock(&ctx->ctx_mutex); ctx->last_flush_req = 0; if (ctx->state_machine[ctx->state].ioctl_ops.start_dev) rc = ctx->state_machine[ctx->state].ioctl_ops.start_dev( ctx, cmd); Loading drivers/media/platform/msm/camera_v3/cam_core/cam_context_utils.c +17 −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 @@ -303,6 +303,12 @@ int32_t cam_context_config_dev_to_hw( return rc; } if ((len < sizeof(struct cam_packet)) || (cmd->offset >= (len - sizeof(struct cam_packet)))) { CAM_ERR(CAM_CTXT, "Not enough buf"); return -EINVAL; } packet = (struct cam_packet *) ((uint8_t *)packet_addr + (uint32_t)cmd->offset); Loading Loading @@ -333,6 +339,7 @@ int32_t cam_context_prepare_dev_to_hw(struct cam_context *ctx, uintptr_t packet_addr; struct cam_packet *packet; size_t len = 0; size_t remain_len = 0; int32_t i = 0, j = 0; if (!ctx || !cmd) { Loading Loading @@ -381,6 +388,14 @@ int32_t cam_context_prepare_dev_to_hw(struct cam_context *ctx, goto free_req; } remain_len = len; if ((len < sizeof(struct cam_packet)) || ((size_t)cmd->offset >= len - sizeof(struct cam_packet))) { CAM_ERR(CAM_CTXT, "invalid buff length: %zu or offset", len); return -EINVAL; } remain_len -= (size_t)cmd->offset; packet = (struct cam_packet *) ((uint8_t *)packet_addr + (uint32_t)cmd->offset); Loading @@ -398,6 +413,7 @@ int32_t cam_context_prepare_dev_to_hw(struct cam_context *ctx, /* preprocess the configuration */ memset(&cfg, 0, sizeof(cfg)); cfg.packet = packet; cfg.remain_len = remain_len; cfg.ctxt_to_hw_map = ctx->ctxt_to_hw_map; cfg.max_hw_update_entries = CAM_CTX_CFG_MAX; cfg.num_hw_update_entries = req->num_hw_update_entries; Loading drivers/media/platform/msm/camera_v3/cam_core/cam_hw_mgr_intf.h +3 −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 @@ -153,6 +153,7 @@ struct cam_hw_mgr_dump_pf_data { * struct cam_hw_prepare_update_args - Payload for prepare command * * @packet: CSL packet from user mode driver * @remain_len Remaining length of CPU buffer after config offset * @ctxt_to_hw_map: HW context from the acquire * @max_hw_update_entries: Maximum hardware update entries supported * @hw_update_entries: Actual hardware update configuration (returned) Loading @@ -169,6 +170,7 @@ struct cam_hw_mgr_dump_pf_data { */ struct cam_hw_prepare_update_args { struct cam_packet *packet; size_t remain_len; void *ctxt_to_hw_map; uint32_t max_hw_update_entries; struct cam_hw_update_entry *hw_update_entries; Loading drivers/media/platform/msm/camera_v3/cam_cpas/cam_cpas_hw.c +14 −4 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 @@ -313,6 +313,9 @@ static int cam_cpas_util_axi_setup(struct cam_cpas *cpas_core, goto mnoc_node_get_fail; } axi_port->axi_port_mnoc_node = axi_port_mnoc_node; axi_port->ib_bw_voting_needed = of_property_read_bool(axi_port_node, "ib-bw-voting-needed"); rc = cam_cpas_util_register_bus_client(soc_info, axi_port_mnoc_node, &axi_port->mnoc_bus); Loading Loading @@ -662,12 +665,19 @@ static int cam_cpas_util_apply_client_axi_vote( axi_port->camnoc_bus.src, axi_port->camnoc_bus.dst, camnoc_bw, mnoc_bw); if (axi_port->ib_bw_voting_needed) rc = cam_cpas_util_vote_bus_client_bw(&axi_port->mnoc_bus, mnoc_bw, mnoc_bw, false); else rc = cam_cpas_util_vote_bus_client_bw(&axi_port->mnoc_bus, mnoc_bw, 0, false); if (rc) { CAM_ERR(CAM_CPAS, "Failed in mnoc vote ab[%llu] ib[%llu] rc=%d", mnoc_bw, mnoc_bw, rc); mnoc_bw, (axi_port->ib_bw_voting_needed ? mnoc_bw : 0), rc); goto unlock_axi_port; } Loading Loading
drivers/media/platform/msm/camera_v3/cam_cdm/cam_cdm_virtual_core.c +9 −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 @@ -118,6 +118,14 @@ int cam_virtual_cdm_submit_bl(struct cam_hw_info *cdm_hw, if ((!rc) && (vaddr_ptr) && (len) && (len >= cdm_cmd->cmd[i].offset)) { if ((len - cdm_cmd->cmd[i].offset) <= cdm_cmd->cmd[i].len) { CAM_ERR(CAM_CDM, "Not enough buffer"); rc = -EINVAL; break; } CAM_DBG(CAM_CDM, "hdl=%x vaddr=%pK offset=%d cmdlen=%d:%zu", cdm_cmd->cmd[i].bl_addr.mem_handle, Loading
drivers/media/platform/msm/camera_v3/cam_core/cam_context.c +4 −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 @@ -173,6 +173,7 @@ int cam_context_handle_crm_apply_req(struct cam_context *ctx, return -EINVAL; } mutex_lock(&ctx->ctx_mutex); if (ctx->state_machine[ctx->state].crm_ops.apply_req) { rc = ctx->state_machine[ctx->state].crm_ops.apply_req(ctx, apply); Loading @@ -181,6 +182,7 @@ int cam_context_handle_crm_apply_req(struct cam_context *ctx, ctx->dev_hdl, ctx->state); rc = -EPROTO; } mutex_unlock(&ctx->ctx_mutex); return rc; } Loading Loading @@ -456,6 +458,7 @@ int cam_context_handle_start_dev(struct cam_context *ctx, } mutex_lock(&ctx->ctx_mutex); ctx->last_flush_req = 0; if (ctx->state_machine[ctx->state].ioctl_ops.start_dev) rc = ctx->state_machine[ctx->state].ioctl_ops.start_dev( ctx, cmd); Loading
drivers/media/platform/msm/camera_v3/cam_core/cam_context_utils.c +17 −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 @@ -303,6 +303,12 @@ int32_t cam_context_config_dev_to_hw( return rc; } if ((len < sizeof(struct cam_packet)) || (cmd->offset >= (len - sizeof(struct cam_packet)))) { CAM_ERR(CAM_CTXT, "Not enough buf"); return -EINVAL; } packet = (struct cam_packet *) ((uint8_t *)packet_addr + (uint32_t)cmd->offset); Loading Loading @@ -333,6 +339,7 @@ int32_t cam_context_prepare_dev_to_hw(struct cam_context *ctx, uintptr_t packet_addr; struct cam_packet *packet; size_t len = 0; size_t remain_len = 0; int32_t i = 0, j = 0; if (!ctx || !cmd) { Loading Loading @@ -381,6 +388,14 @@ int32_t cam_context_prepare_dev_to_hw(struct cam_context *ctx, goto free_req; } remain_len = len; if ((len < sizeof(struct cam_packet)) || ((size_t)cmd->offset >= len - sizeof(struct cam_packet))) { CAM_ERR(CAM_CTXT, "invalid buff length: %zu or offset", len); return -EINVAL; } remain_len -= (size_t)cmd->offset; packet = (struct cam_packet *) ((uint8_t *)packet_addr + (uint32_t)cmd->offset); Loading @@ -398,6 +413,7 @@ int32_t cam_context_prepare_dev_to_hw(struct cam_context *ctx, /* preprocess the configuration */ memset(&cfg, 0, sizeof(cfg)); cfg.packet = packet; cfg.remain_len = remain_len; cfg.ctxt_to_hw_map = ctx->ctxt_to_hw_map; cfg.max_hw_update_entries = CAM_CTX_CFG_MAX; cfg.num_hw_update_entries = req->num_hw_update_entries; Loading
drivers/media/platform/msm/camera_v3/cam_core/cam_hw_mgr_intf.h +3 −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 @@ -153,6 +153,7 @@ struct cam_hw_mgr_dump_pf_data { * struct cam_hw_prepare_update_args - Payload for prepare command * * @packet: CSL packet from user mode driver * @remain_len Remaining length of CPU buffer after config offset * @ctxt_to_hw_map: HW context from the acquire * @max_hw_update_entries: Maximum hardware update entries supported * @hw_update_entries: Actual hardware update configuration (returned) Loading @@ -169,6 +170,7 @@ struct cam_hw_mgr_dump_pf_data { */ struct cam_hw_prepare_update_args { struct cam_packet *packet; size_t remain_len; void *ctxt_to_hw_map; uint32_t max_hw_update_entries; struct cam_hw_update_entry *hw_update_entries; Loading
drivers/media/platform/msm/camera_v3/cam_cpas/cam_cpas_hw.c +14 −4 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 @@ -313,6 +313,9 @@ static int cam_cpas_util_axi_setup(struct cam_cpas *cpas_core, goto mnoc_node_get_fail; } axi_port->axi_port_mnoc_node = axi_port_mnoc_node; axi_port->ib_bw_voting_needed = of_property_read_bool(axi_port_node, "ib-bw-voting-needed"); rc = cam_cpas_util_register_bus_client(soc_info, axi_port_mnoc_node, &axi_port->mnoc_bus); Loading Loading @@ -662,12 +665,19 @@ static int cam_cpas_util_apply_client_axi_vote( axi_port->camnoc_bus.src, axi_port->camnoc_bus.dst, camnoc_bw, mnoc_bw); if (axi_port->ib_bw_voting_needed) rc = cam_cpas_util_vote_bus_client_bw(&axi_port->mnoc_bus, mnoc_bw, mnoc_bw, false); else rc = cam_cpas_util_vote_bus_client_bw(&axi_port->mnoc_bus, mnoc_bw, 0, false); if (rc) { CAM_ERR(CAM_CPAS, "Failed in mnoc vote ab[%llu] ib[%llu] rc=%d", mnoc_bw, mnoc_bw, rc); mnoc_bw, (axi_port->ib_bw_voting_needed ? mnoc_bw : 0), rc); goto unlock_axi_port; } Loading