diff options
author | Raja Mallik <rmallik@codeaurora.org> | 2019-04-04 14:32:27 +0530 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2019-05-14 23:16:47 -0700 |
commit | a3fe18bfdb7f94eda522adc5cce1c9e7885e4be4 (patch) | |
tree | 3053fa6bb3bad989e09d2f181bcfd6c3eb91d916 | |
parent | 2de21ab366b0d854c5c406e11b0fe094da183c12 (diff) |
msm: camera_v3: cpas: Handling AB BW passed by UMD along with IBLA.UM.7.8.c3-06800-QCS605.0
Currently CPAS only handles IB voted by each client. Added support
to handle AB along with IB to be voted on external bus.
Change-Id: Iff5b28f3980a1293adb81e389915d08ff84728bc
Signed-off-by: Raja Mallik <rmallik@codeaurora.org>
21 files changed, 211 insertions, 62 deletions
diff --git a/drivers/media/platform/msm/camera_v3/cam_cdm/cam_cdm_core_common.c b/drivers/media/platform/msm/camera_v3/cam_cdm/cam_cdm_core_common.c index 506de5e88309..b1f4fe87e8fa 100644 --- a/drivers/media/platform/msm/camera_v3/cam_cdm/cam_cdm_core_common.c +++ b/drivers/media/platform/msm/camera_v3/cam_cdm/cam_cdm_core_common.c @@ -1,4 +1,4 @@ -/* 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 @@ -280,6 +280,7 @@ int cam_cdm_stream_ops_internal(void *hw_priv, ahb_vote.type = CAM_VOTE_ABSOLUTE; ahb_vote.vote.level = CAM_SVS_VOTE; axi_vote.compressed_bw = CAM_CPAS_DEFAULT_AXI_BW; + axi_vote.compressed_bw_ab = CAM_CPAS_DEFAULT_AXI_BW; axi_vote.uncompressed_bw = CAM_CPAS_DEFAULT_AXI_BW; rc = cam_cpas_start(core->cpas_handle, diff --git a/drivers/media/platform/msm/camera_v3/cam_cdm/cam_cdm_hw_core.c b/drivers/media/platform/msm/camera_v3/cam_cdm/cam_cdm_hw_core.c index 4d6892ddaf9e..c8c64b49d686 100644 --- a/drivers/media/platform/msm/camera_v3/cam_cdm/cam_cdm_hw_core.c +++ b/drivers/media/platform/msm/camera_v3/cam_cdm/cam_cdm_hw_core.c @@ -955,6 +955,7 @@ int cam_hw_cdm_probe(struct platform_device *pdev) ahb_vote.type = CAM_VOTE_ABSOLUTE; ahb_vote.vote.level = CAM_SVS_VOTE; axi_vote.compressed_bw = CAM_CPAS_DEFAULT_AXI_BW; + axi_vote.compressed_bw_ab = CAM_CPAS_DEFAULT_AXI_BW; axi_vote.uncompressed_bw = CAM_CPAS_DEFAULT_AXI_BW; rc = cam_cpas_start(cdm_core->cpas_handle, &ahb_vote, &axi_vote); if (rc) { diff --git a/drivers/media/platform/msm/camera_v3/cam_cpas/cam_cpas_hw.c b/drivers/media/platform/msm/camera_v3/cam_cpas/cam_cpas_hw.c index 017e810e07c0..a05901afba71 100644 --- a/drivers/media/platform/msm/camera_v3/cam_cpas/cam_cpas_hw.c +++ b/drivers/media/platform/msm/camera_v3/cam_cpas/cam_cpas_hw.c @@ -620,7 +620,7 @@ static int cam_cpas_util_apply_client_axi_vote( struct cam_cpas_client *temp_client; struct cam_axi_vote req_axi_vote = *axi_vote; struct cam_cpas_axi_port *axi_port = cpas_client->axi_port; - uint64_t camnoc_bw = 0, mnoc_bw = 0; + uint64_t camnoc_bw = 0, mnoc_bw = 0, mnoc_bw_ab = 0; int rc = 0; if (!axi_port) { @@ -632,14 +632,21 @@ static int cam_cpas_util_apply_client_axi_vote( * Make sure we use same bw for both compressed, uncompressed * in case client has requested either of one only */ - if (req_axi_vote.compressed_bw == 0) + if (req_axi_vote.compressed_bw == 0) { req_axi_vote.compressed_bw = req_axi_vote.uncompressed_bw; + req_axi_vote.compressed_bw_ab = req_axi_vote.uncompressed_bw; + } + + if (req_axi_vote.compressed_bw_ab == 0) + req_axi_vote.compressed_bw_ab = req_axi_vote.compressed_bw; if (req_axi_vote.uncompressed_bw == 0) req_axi_vote.uncompressed_bw = req_axi_vote.compressed_bw; if ((cpas_client->axi_vote.compressed_bw == req_axi_vote.compressed_bw) && + (cpas_client->axi_vote.compressed_bw_ab == + req_axi_vote.compressed_bw_ab) && (cpas_client->axi_vote.uncompressed_bw == req_axi_vote.uncompressed_bw)) return 0; @@ -651,23 +658,27 @@ static int cam_cpas_util_apply_client_axi_vote( &axi_port->clients_list_head, axi_sibling_client) { camnoc_bw += curr_client->axi_vote.uncompressed_bw; mnoc_bw += curr_client->axi_vote.compressed_bw; + mnoc_bw_ab += curr_client->axi_vote.compressed_bw_ab; } if ((!soc_private->axi_camnoc_based) && (mnoc_bw < camnoc_bw)) mnoc_bw = camnoc_bw; + if ((!soc_private->axi_camnoc_based) && (mnoc_bw_ab < camnoc_bw)) + mnoc_bw_ab = mnoc_bw; + axi_port->consolidated_axi_vote.compressed_bw = mnoc_bw; axi_port->consolidated_axi_vote.uncompressed_bw = camnoc_bw; CAM_DBG(CAM_CPAS, - "axi[(%d, %d),(%d, %d)] : camnoc_bw[%llu], mnoc_bw[%llu]", + "axi[(%d, %d),(%d, %d)] : camnoc_bw[%llu], mnoc_bw[ab: %llu, ib: %llu]", axi_port->mnoc_bus.src, axi_port->mnoc_bus.dst, axi_port->camnoc_bus.src, axi_port->camnoc_bus.dst, - camnoc_bw, mnoc_bw); + camnoc_bw, mnoc_bw_ab, 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); + mnoc_bw_ab, mnoc_bw, false); else rc = cam_cpas_util_vote_bus_client_bw(&axi_port->mnoc_bus, mnoc_bw, 0, false); @@ -675,9 +686,7 @@ static int cam_cpas_util_apply_client_axi_vote( if (rc) { CAM_ERR(CAM_CPAS, "Failed in mnoc vote ab[%llu] ib[%llu] rc=%d", - mnoc_bw, - (axi_port->ib_bw_voting_needed ? mnoc_bw : 0), - rc); + mnoc_bw_ab, mnoc_bw, rc); goto unlock_axi_port; } @@ -723,11 +732,13 @@ static int cam_cpas_hw_update_axi_vote(struct cam_hw_info *cpas_hw, axi_vote = *client_axi_vote; if ((axi_vote.compressed_bw == 0) && - (axi_vote.uncompressed_bw == 0)) { + (axi_vote.uncompressed_bw == 0) && + (axi_vote.compressed_bw_ab == 0)) { CAM_DBG(CAM_CPAS, "0 vote from client_handle=%d", client_handle); axi_vote.compressed_bw = CAM_CPAS_DEFAULT_AXI_BW; axi_vote.uncompressed_bw = CAM_CPAS_DEFAULT_AXI_BW; + axi_vote.compressed_bw_ab = CAM_CPAS_DEFAULT_AXI_BW; } if (!CAM_CPAS_CLIENT_VALID(client_indx)) @@ -746,10 +757,10 @@ static int cam_cpas_hw_update_axi_vote(struct cam_hw_info *cpas_hw, } CAM_DBG(CAM_PERF, - "Client=[%d][%s][%d] Requested compressed[%llu], uncompressed[%llu]", + "Client=[%d][%s][%d] Req comp[%llu], comp_ab[%llu], uncomp[%llu]", client_indx, cpas_client->data.identifier, cpas_client->data.cell_index, axi_vote.compressed_bw, - axi_vote.uncompressed_bw); + axi_vote.compressed_bw_ab, axi_vote.uncompressed_bw); rc = cam_cpas_util_apply_client_axi_vote(cpas_hw, cpas_core->cpas_client[client_indx], &axi_vote); @@ -1001,11 +1012,11 @@ static int cam_cpas_hw_start(void *hw_priv, void *start_args, if (rc) goto done; - CAM_DBG(CAM_CPAS, - "AXI client=[%d][%s][%d] compressed_bw[%llu], uncompressed_bw[%llu]", + CAM_INFO(CAM_CPAS, + "AXI client=[%d][%s][%d] comp[%llu], comp_ab[%llu], uncomp[%llu]", client_indx, cpas_client->data.identifier, cpas_client->data.cell_index, axi_vote->compressed_bw, - axi_vote->uncompressed_bw); + axi_vote->compressed_bw_ab, axi_vote->uncompressed_bw); rc = cam_cpas_util_apply_client_axi_vote(cpas_hw, cpas_client, axi_vote); if (rc) @@ -1156,6 +1167,7 @@ static int cam_cpas_hw_stop(void *hw_priv, void *stop_args, 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); diff --git a/drivers/media/platform/msm/camera_v3/cam_cpas/include/cam_cpas_api.h b/drivers/media/platform/msm/camera_v3/cam_cpas/include/cam_cpas_api.h index 5dbd94a1fa9b..7b534a93c71d 100644 --- a/drivers/media/platform/msm/camera_v3/cam_cpas/include/cam_cpas_api.h +++ b/drivers/media/platform/msm/camera_v3/cam_cpas/include/cam_cpas_api.h @@ -1,4 +1,4 @@ -/* 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 @@ -348,6 +348,7 @@ struct cam_ahb_vote { struct cam_axi_vote { uint64_t uncompressed_bw; uint64_t compressed_bw; + uint64_t compressed_bw_ab; }; /** diff --git a/drivers/media/platform/msm/camera_v3/cam_fd/fd_hw_mgr/fd_hw/cam_fd_hw_soc.c b/drivers/media/platform/msm/camera_v3/cam_fd/fd_hw_mgr/fd_hw/cam_fd_hw_soc.c index adfd4d839a59..3b16789eece6 100644 --- a/drivers/media/platform/msm/camera_v3/cam_fd/fd_hw_mgr/fd_hw/cam_fd_hw_soc.c +++ b/drivers/media/platform/msm/camera_v3/cam_fd/fd_hw_mgr/fd_hw/cam_fd_hw_soc.c @@ -1,4 +1,4 @@ -/* 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 @@ -151,6 +151,7 @@ int cam_fd_soc_enable_resources(struct cam_hw_soc_info *soc_info) ahb_vote.type = CAM_VOTE_ABSOLUTE; ahb_vote.vote.level = CAM_SVS_VOTE; axi_vote.compressed_bw = 7200000; + axi_vote.compressed_bw_ab = 7200000; axi_vote.uncompressed_bw = 7200000; rc = cam_cpas_start(soc_private->cpas_handle, &ahb_vote, &axi_vote); if (rc) { diff --git a/drivers/media/platform/msm/camera_v3/cam_icp/icp_hw/a5_hw/a5_core.c b/drivers/media/platform/msm/camera_v3/cam_icp/icp_hw/a5_hw/a5_core.c index 18bd6d8dd2c7..e13d7f2edcee 100644 --- a/drivers/media/platform/msm/camera_v3/cam_icp/icp_hw/a5_hw/a5_core.c +++ b/drivers/media/platform/msm/camera_v3/cam_icp/icp_hw/a5_hw/a5_core.c @@ -1,4 +1,4 @@ -/* 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 @@ -268,6 +268,7 @@ int cam_a5_init_hw(void *device_priv, cpas_vote.ahb_vote.type = CAM_VOTE_ABSOLUTE; cpas_vote.ahb_vote.vote.level = CAM_SVS_VOTE; cpas_vote.axi_vote.compressed_bw = CAM_ICP_A5_BW_BYTES_VOTE; + cpas_vote.axi_vote.compressed_bw_ab = CAM_ICP_A5_BW_BYTES_VOTE; cpas_vote.axi_vote.uncompressed_bw = CAM_ICP_A5_BW_BYTES_VOTE; rc = cam_cpas_start(core_info->cpas_handle, diff --git a/drivers/media/platform/msm/camera_v3/cam_icp/icp_hw/icp_hw_mgr/cam_icp_hw_mgr.c b/drivers/media/platform/msm/camera_v3/cam_icp/icp_hw/icp_hw_mgr/cam_icp_hw_mgr.c index 004695902ee5..927ea2d8d629 100644 --- a/drivers/media/platform/msm/camera_v3/cam_icp/icp_hw/icp_hw_mgr/cam_icp_hw_mgr.c +++ b/drivers/media/platform/msm/camera_v3/cam_icp/icp_hw/icp_hw_mgr/cam_icp_hw_mgr.c @@ -109,6 +109,7 @@ static void cam_icp_hw_mgr_reset_clk_info(struct cam_icp_hw_mgr *hw_mgr) hw_mgr->clk_info[i].over_clked = 0; hw_mgr->clk_info[i].uncompressed_bw = CAM_CPAS_DEFAULT_AXI_BW; hw_mgr->clk_info[i].compressed_bw = CAM_CPAS_DEFAULT_AXI_BW; + hw_mgr->clk_info[i].compressed_bw_ab = CAM_CPAS_DEFAULT_AXI_BW; } hw_mgr->icp_default_clk = ICP_CLK_SVS_HZ; } @@ -245,6 +246,7 @@ static int cam_icp_ctx_clk_info_init(struct cam_icp_hw_ctx_data *ctx_data) ctx_data->clk_info.base_clk = 0; ctx_data->clk_info.uncompressed_bw = 0; ctx_data->clk_info.compressed_bw = 0; + ctx_data->clk_info.compressed_bw_ab = 0; cam_icp_supported_clk_rates(&icp_hw_mgr, ctx_data); return 0; @@ -403,10 +405,11 @@ static int32_t cam_icp_ctx_timer(void *priv, void *data) } CAM_DBG(CAM_ICP, - "E :ctx_id = %d ubw = %lld cbw = %lld curr_fc = %u bc = %u", + "E :ctx_id %d, ubw %lld, cbw %lld, cbw_a %ld, curr_fc %u, bc %u", ctx_data->ctx_id, ctx_data->clk_info.uncompressed_bw, ctx_data->clk_info.compressed_bw, + ctx_data->clk_info.compressed_bw_ab, ctx_data->clk_info.curr_fc, ctx_data->clk_info.base_clk); ipe0_dev_intf = hw_mgr->ipe0_dev_intf; @@ -436,9 +439,11 @@ static int32_t cam_icp_ctx_timer(void *priv, void *data) } clk_info->compressed_bw -= ctx_data->clk_info.compressed_bw; + clk_info->compressed_bw_ab -= ctx_data->clk_info.compressed_bw_ab; clk_info->uncompressed_bw -= ctx_data->clk_info.uncompressed_bw; ctx_data->clk_info.uncompressed_bw = 0; ctx_data->clk_info.compressed_bw = 0; + ctx_data->clk_info.compressed_bw_ab = 0; ctx_data->clk_info.curr_fc = 0; ctx_data->clk_info.base_clk = 0; @@ -446,16 +451,18 @@ static int32_t cam_icp_ctx_timer(void *priv, void *data) clk_update.ahb_vote.vote.freq = 0; clk_update.ahb_vote_valid = false; clk_update.axi_vote.compressed_bw = clk_info->compressed_bw; + clk_update.axi_vote.compressed_bw_ab = clk_info->compressed_bw; clk_update.axi_vote.uncompressed_bw = clk_info->uncompressed_bw; clk_update.axi_vote_valid = true; dev_intf->hw_ops.process_cmd(dev_intf->hw_priv, id, &clk_update, sizeof(clk_update)); CAM_DBG(CAM_ICP, - "X :ctx_id = %d ubw = %lld cbw = %lld curr_fc = %u bc = %u", + "X :ctx_id %d, ubw %lld cbw %lld abw_a %lld, curr_fc %u, bc %u", ctx_data->ctx_id, ctx_data->clk_info.uncompressed_bw, ctx_data->clk_info.compressed_bw, + ctx_data->clk_info.compressed_bw_ab, ctx_data->clk_info.curr_fc, ctx_data->clk_info.base_clk); mutex_unlock(&ctx_data->ctx_mutex); @@ -523,6 +530,7 @@ static int cam_icp_clk_info_init(struct cam_icp_hw_mgr *hw_mgr, hw_mgr->clk_info[i].over_clked = 0; hw_mgr->clk_info[i].uncompressed_bw = CAM_CPAS_DEFAULT_AXI_BW; hw_mgr->clk_info[i].compressed_bw = CAM_CPAS_DEFAULT_AXI_BW; + hw_mgr->clk_info[i].compressed_bw_ab = CAM_CPAS_DEFAULT_AXI_BW; hw_mgr->clk_info[i].hw_type = i; hw_mgr->clk_info[i].watch_dog_reset_counter = 0; } @@ -812,6 +820,7 @@ static bool cam_icp_debug_clk_update(struct cam_icp_clk_info *hw_mgr_clk_info) hw_mgr_clk_info->curr_clk = icp_hw_mgr.icp_debug_clk; hw_mgr_clk_info->uncompressed_bw = icp_hw_mgr.icp_debug_clk; hw_mgr_clk_info->compressed_bw = icp_hw_mgr.icp_debug_clk; + hw_mgr_clk_info->compressed_bw_ab = icp_hw_mgr.icp_debug_clk; CAM_DBG(CAM_ICP, "bc = %d cc = %d", hw_mgr_clk_info->base_clk, hw_mgr_clk_info->curr_clk); return true; @@ -827,6 +836,7 @@ static bool cam_icp_default_clk_update(struct cam_icp_clk_info *hw_mgr_clk_info) hw_mgr_clk_info->curr_clk = icp_hw_mgr.icp_default_clk; hw_mgr_clk_info->uncompressed_bw = icp_hw_mgr.icp_default_clk; hw_mgr_clk_info->compressed_bw = icp_hw_mgr.icp_default_clk; + hw_mgr_clk_info->compressed_bw_ab = icp_hw_mgr.icp_default_clk; CAM_DBG(CAM_ICP, "bc = %d cc = %d", hw_mgr_clk_info->base_clk, hw_mgr_clk_info->curr_clk); return true; @@ -864,8 +874,10 @@ static bool cam_icp_update_bw(struct cam_icp_hw_mgr *hw_mgr, ctx_data->clk_info.uncompressed_bw = clk_info->uncompressed_bw; ctx_data->clk_info.compressed_bw = clk_info->compressed_bw; + ctx_data->clk_info.compressed_bw_ab = clk_info->compressed_bw; hw_mgr_clk_info->uncompressed_bw = 0; hw_mgr_clk_info->compressed_bw = 0; + hw_mgr_clk_info->compressed_bw_ab = 0; for (i = 0; i < CAM_ICP_CTX_MAX; i++) { ctx = &hw_mgr->ctx_data[i]; if (ctx->state == CAM_ICP_CTX_STATE_ACQUIRED && @@ -877,9 +889,12 @@ static bool cam_icp_update_bw(struct cam_icp_hw_mgr *hw_mgr, ctx->clk_info.uncompressed_bw; hw_mgr_clk_info->compressed_bw += ctx->clk_info.compressed_bw; - CAM_DBG(CAM_ICP, "ubw = %lld, cbw = %lld", + hw_mgr_clk_info->compressed_bw_ab += + ctx->clk_info.compressed_bw_ab; + CAM_DBG(CAM_ICP, "ubw = %lld, cbw = %lld cbw_ab", hw_mgr_clk_info->uncompressed_bw, - hw_mgr_clk_info->compressed_bw); + hw_mgr_clk_info->compressed_bw, + hw_mgr_clk_info->compressed_bw_ab); } } @@ -960,9 +975,10 @@ static bool cam_icp_check_bw_update(struct cam_icp_hw_mgr *hw_mgr, rc = cam_icp_update_bw(hw_mgr, ctx_data, hw_mgr_clk_info, clk_info, busy); - CAM_DBG(CAM_ICP, "ubw = %lld, cbw = %lld, update_bw = %d", + CAM_DBG(CAM_ICP, "ubw %lld, cbw %lld, cbw_a %lld, update_bw %d", hw_mgr_clk_info->uncompressed_bw, - hw_mgr_clk_info->compressed_bw, rc); + hw_mgr_clk_info->compressed_bw, + hw_mgr_clk_info->compressed_bw_ab, rc); return rc; } @@ -1050,6 +1066,7 @@ static int cam_icp_update_cpas_vote(struct cam_icp_hw_mgr *hw_mgr, clk_update.ahb_vote.vote.freq = 0; clk_update.ahb_vote_valid = false; clk_update.axi_vote.compressed_bw = clk_info->compressed_bw; + clk_update.axi_vote.compressed_bw_ab = clk_info->compressed_bw; clk_update.axi_vote.uncompressed_bw = clk_info->uncompressed_bw; clk_update.axi_vote_valid = true; dev_intf->hw_ops.process_cmd(dev_intf->hw_priv, id, @@ -1063,8 +1080,10 @@ static int cam_icp_update_cpas_vote(struct cam_icp_hw_mgr *hw_mgr, * anyway. */ - CAM_DBG(CAM_ICP, "compress_bw %llu uncompress_bw %llu dev_type %d", - clk_info->compressed_bw, clk_info->uncompressed_bw, + CAM_DBG(CAM_ICP, + "comp_bw %llu comp_bw_ab %lld uncomp_bw %llu dev_type %d", + clk_info->compressed_bw, clk_info->compressed_bw_ab, + clk_info->uncompressed_bw, ctx_data->icp_dev_acquire_info->dev_type); return 0; diff --git a/drivers/media/platform/msm/camera_v3/cam_icp/icp_hw/icp_hw_mgr/cam_icp_hw_mgr.h b/drivers/media/platform/msm/camera_v3/cam_icp/icp_hw/icp_hw_mgr/cam_icp_hw_mgr.h index 5a93df33925f..9af4ccc96003 100644 --- a/drivers/media/platform/msm/camera_v3/cam_icp/icp_hw/icp_hw_mgr/cam_icp_hw_mgr.h +++ b/drivers/media/platform/msm/camera_v3/cam_icp/icp_hw/icp_hw_mgr/cam_icp_hw_mgr.h @@ -185,6 +185,7 @@ struct cam_ctx_clk_info { uint32_t reserved; uint64_t uncompressed_bw; uint64_t compressed_bw; + uint64_t compressed_bw_ab; int32_t clk_rate[CAM_MAX_VOTE]; }; /** @@ -249,6 +250,7 @@ struct icp_cmd_generic_blob { * @over_clked: Over clock count * @uncompressed_bw: Current bandwidth voting * @compressed_bw: Current compressed bandwidth voting + * @compressed_bw_ab: Current absolute compressed bandwidth voting * @hw_type: IPE/BPS device type * @watch_dog: watchdog timer handle * @watch_dog_reset_counter: Counter for watch dog reset @@ -260,6 +262,7 @@ struct cam_icp_clk_info { uint32_t over_clked; uint64_t uncompressed_bw; uint64_t compressed_bw; + uint64_t compressed_bw_ab; uint32_t hw_type; struct cam_req_mgr_timer *watch_dog; uint32_t watch_dog_reset_counter; diff --git a/drivers/media/platform/msm/camera_v3/cam_icp/icp_hw/ipe_hw/ipe_core.c b/drivers/media/platform/msm/camera_v3/cam_icp/icp_hw/ipe_hw/ipe_core.c index 1f71c7d4cd36..7a7c76ea4fbc 100644 --- a/drivers/media/platform/msm/camera_v3/cam_icp/icp_hw/ipe_hw/ipe_core.c +++ b/drivers/media/platform/msm/camera_v3/cam_icp/icp_hw/ipe_hw/ipe_core.c @@ -78,6 +78,7 @@ int cam_ipe_init_hw(void *device_priv, cpas_vote.ahb_vote.type = CAM_VOTE_ABSOLUTE; cpas_vote.ahb_vote.vote.level = CAM_SVS_VOTE; cpas_vote.axi_vote.compressed_bw = CAM_CPAS_DEFAULT_AXI_BW; + cpas_vote.axi_vote.compressed_bw_ab = CAM_CPAS_DEFAULT_AXI_BW; cpas_vote.axi_vote.uncompressed_bw = CAM_CPAS_DEFAULT_AXI_BW; rc = cam_cpas_start(core_info->cpas_handle, diff --git a/drivers/media/platform/msm/camera_v3/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c b/drivers/media/platform/msm/camera_v3/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c index 582d4858e18b..dd81973a1e19 100644 --- a/drivers/media/platform/msm/camera_v3/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c +++ b/drivers/media/platform/msm/camera_v3/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c @@ -43,7 +43,7 @@ (CAM_ISP_PACKET_META_GENERIC_BLOB_COMMON + 1) #define CAM_ISP_GENERIC_BLOB_TYPE_MAX \ - (CAM_ISP_GENERIC_BLOB_TYPE_FE_CONFIG + 1) + (CAM_ISP_GENERIC_BLOB_TYPE_BW_CONFIG_V2 + 1) static uint32_t blob_type_hw_cmd_map[CAM_ISP_GENERIC_BLOB_TYPE_MAX] = { CAM_ISP_HW_CMD_GET_HFR_UPDATE, @@ -2202,6 +2202,7 @@ static int cam_ife_mgr_acquire(void *hw_mgr_priv, static int cam_isp_blob_bw_update( struct cam_isp_bw_config *bw_config, + struct cam_isp_bw_config_ab *bw_config_ab, struct cam_ife_hw_mgr_ctx *ctx) { struct cam_ife_hw_mgr_res *hw_mgr_res; @@ -2209,6 +2210,7 @@ static int cam_isp_blob_bw_update( struct cam_vfe_bw_update_args bw_upd_args; uint64_t cam_bw_bps = 0; uint64_t ext_bw_bps = 0; + uint64_t ext_bw_bps_ab = 0; int rc = -EINVAL; uint32_t i; bool camif_l_bw_updated = false; @@ -2238,6 +2240,8 @@ static int cam_isp_blob_bw_update( bw_config->left_pix_vote.cam_bw_bps; ext_bw_bps = bw_config->left_pix_vote.ext_bw_bps; + ext_bw_bps_ab = + bw_config_ab->left_pix_vote_ab; camif_l_bw_updated = true; } else { @@ -2248,6 +2252,8 @@ static int cam_isp_blob_bw_update( bw_config->right_pix_vote.cam_bw_bps; ext_bw_bps = bw_config->right_pix_vote.ext_bw_bps; + ext_bw_bps_ab = + bw_config_ab->right_pix_vote_ab; camif_r_bw_updated = true; } @@ -2263,6 +2269,8 @@ static int cam_isp_blob_bw_update( bw_config->rdi_vote[idx].cam_bw_bps; ext_bw_bps = bw_config->rdi_vote[idx].ext_bw_bps; + ext_bw_bps_ab = + bw_config_ab->rdi_vote_ab[idx]; } else if (hw_mgr_res->res_id == CAM_ISP_HW_VFE_IN_CAMIF_LITE) { if (i == CAM_ISP_HW_SPLIT_LEFT) { @@ -2273,6 +2281,8 @@ static int cam_isp_blob_bw_update( bw_config->left_pix_vote.cam_bw_bps; ext_bw_bps = bw_config->left_pix_vote.ext_bw_bps; + ext_bw_bps_ab = + bw_config_ab->left_pix_vote_ab; camif_l_bw_updated = true; } else { @@ -2283,6 +2293,9 @@ static int cam_isp_blob_bw_update( bw_config->right_pix_vote.cam_bw_bps; ext_bw_bps = bw_config->right_pix_vote.ext_bw_bps; + ext_bw_bps_ab = + bw_config_ab->right_pix_vote_ab; + camif_r_bw_updated = true; } @@ -2301,6 +2314,8 @@ static int cam_isp_blob_bw_update( bw_upd_args.camnoc_bw_bytes = cam_bw_bps; bw_upd_args.external_bw_bytes = ext_bw_bps; + bw_upd_args.external_bw_bytes_ab = + ext_bw_bps_ab; rc = hw_intf->hw_ops.process_cmd( hw_intf->hw_priv, @@ -2351,10 +2366,15 @@ static int cam_ife_mgr_config_hw(void *hw_mgr_priv, hw_update_data = (struct cam_isp_prepare_hw_update_data *) cfg->priv; for (i = 0; i < CAM_IFE_HW_NUM_MAX; i++) { + CAM_DBG(CAM_ISP, "hw_update_data->bw_config_valid[%d]:%d", i, + hw_update_data->bw_config_valid[i]); if (hw_update_data->bw_config_valid[i] == true) { rc = cam_isp_blob_bw_update( (struct cam_isp_bw_config *) - &hw_update_data->bw_config[i], ctx); + &hw_update_data->bw_config[i], + (struct cam_isp_bw_config_ab *) + &hw_update_data->bw_config_ab[i], + ctx); if (rc) CAM_ERR(CAM_ISP, "Bandwidth Update Failed"); } @@ -3557,9 +3577,9 @@ static int cam_isp_packet_generic_blob_handler(void *user_data, } if (blob_type >= CAM_ISP_GENERIC_BLOB_TYPE_MAX) { - CAM_ERR(CAM_ISP, "Invalid Blob Type %d Max %d", blob_type, + CAM_WARN(CAM_ISP, "Invalid Blob Type %d Max %d", blob_type, CAM_ISP_GENERIC_BLOB_TYPE_MAX); - return -EINVAL; + return 0; } prepare = blob_info->prepare; @@ -3668,13 +3688,37 @@ static int cam_isp_packet_generic_blob_handler(void *user_data, prepare_hw_data = (struct cam_isp_prepare_hw_update_data *) prepare->priv; - memcpy(&prepare_hw_data->bw_config[bw_config->usage_type], bw_config, sizeof(prepare_hw_data->bw_config[0])); + memset(&prepare_hw_data->bw_config_ab[bw_config->usage_type], + 0, sizeof(prepare_hw_data->bw_config_ab[0])); prepare_hw_data->bw_config_valid[bw_config->usage_type] = true; } break; + case CAM_ISP_GENERIC_BLOB_TYPE_BW_CONFIG_V2: { + struct cam_isp_bw_config_ab *bw_config_ab = + (struct cam_isp_bw_config_ab *)blob_data; + struct cam_isp_prepare_hw_update_data *prepare_hw_data; + + CAM_DBG(CAM_ISP, "AB L:%lld R:%lld usage_type %d", + bw_config_ab->left_pix_vote_ab, + bw_config_ab->right_pix_vote_ab, + bw_config_ab->usage_type); + + if (!prepare || !prepare->priv || + (bw_config_ab->usage_type >= CAM_IFE_HW_NUM_MAX)) { + CAM_ERR(CAM_ISP, "Invalid inputs"); + rc = -EINVAL; + break; + } + prepare_hw_data = (struct cam_isp_prepare_hw_update_data *) + prepare->priv; + + memcpy(&prepare_hw_data->bw_config_ab[bw_config_ab->usage_type], + bw_config_ab, sizeof(prepare_hw_data->bw_config_ab[0])); + } + break; case CAM_ISP_GENERIC_BLOB_TYPE_UBWC_CONFIG: { struct cam_ubwc_config *ubwc_config; diff --git a/drivers/media/platform/msm/camera_v3/cam_isp/isp_hw_mgr/include/cam_isp_hw_mgr_intf.h b/drivers/media/platform/msm/camera_v3/cam_isp/isp_hw_mgr/include/cam_isp_hw_mgr_intf.h index e9bcc98a8956..096e0f186bbf 100644 --- a/drivers/media/platform/msm/camera_v3/cam_isp/isp_hw_mgr/include/cam_isp_hw_mgr_intf.h +++ b/drivers/media/platform/msm/camera_v3/cam_isp/isp_hw_mgr/include/cam_isp_hw_mgr_intf.h @@ -95,6 +95,14 @@ struct cam_isp_start_args { bool start_only; }; +struct cam_isp_bw_config_internal_ab { + uint32_t usage_type; + uint32_t num_rdi; + uint64_t left_pix_vote_ab; + uint64_t right_pix_vote_ab; + uint64_t rdi_vote_ab[CAM_IFE_RDI_NUM_MAX]; +}; + /** * struct cam_isp_bw_config_internal - Internal Bandwidth configuration * @@ -106,11 +114,11 @@ struct cam_isp_start_args { */ struct cam_isp_bw_config_internal { - uint32_t usage_type; - uint32_t num_rdi; - struct cam_isp_bw_vote left_pix_vote; - struct cam_isp_bw_vote right_pix_vote; - struct cam_isp_bw_vote rdi_vote[CAM_IFE_RDI_NUM_MAX]; + uint32_t usage_type; + uint32_t num_rdi; + struct cam_isp_bw_vote left_pix_vote; + struct cam_isp_bw_vote right_pix_vote; + struct cam_isp_bw_vote rdi_vote[CAM_IFE_RDI_NUM_MAX]; }; /** @@ -125,9 +133,10 @@ struct cam_isp_bw_config_internal { * */ struct cam_isp_prepare_hw_update_data { - uint32_t packet_opcode_type; - struct cam_isp_bw_config_internal bw_config[CAM_IFE_HW_NUM_MAX]; - bool bw_config_valid[CAM_IFE_HW_NUM_MAX]; + uint32_t packet_opcode_type; + struct cam_isp_bw_config_internal bw_config[CAM_IFE_HW_NUM_MAX]; + struct cam_isp_bw_config_internal_ab bw_config_ab[CAM_IFE_HW_NUM_MAX]; + bool bw_config_valid[CAM_IFE_HW_NUM_MAX]; }; diff --git a/drivers/media/platform/msm/camera_v3/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_soc.c b/drivers/media/platform/msm/camera_v3/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_soc.c index 5e02609088c4..eb9e63f30ba6 100644 --- a/drivers/media/platform/msm/camera_v3/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_soc.c +++ b/drivers/media/platform/msm/camera_v3/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_soc.c @@ -129,6 +129,7 @@ int cam_ife_csid_enable_soc_resources( ahb_vote.type = CAM_VOTE_ABSOLUTE; ahb_vote.vote.level = CAM_SVS_VOTE; axi_vote.compressed_bw = CAM_CPAS_DEFAULT_AXI_BW; + axi_vote.compressed_bw_ab = CAM_CPAS_DEFAULT_AXI_BW; axi_vote.uncompressed_bw = CAM_CPAS_DEFAULT_AXI_BW; CAM_DBG(CAM_ISP, "csid vote compressed_bw:%lld uncompressed_bw:%lld", diff --git a/drivers/media/platform/msm/camera_v3/cam_isp/isp_hw_mgr/isp_hw/include/cam_vfe_hw_intf.h b/drivers/media/platform/msm/camera_v3/cam_isp/isp_hw_mgr/isp_hw/include/cam_vfe_hw_intf.h index f60bf6e4b3d4..9d6bcb71bb69 100644 --- a/drivers/media/platform/msm/camera_v3/cam_isp/isp_hw_mgr/isp_hw/include/cam_vfe_hw_intf.h +++ b/drivers/media/platform/msm/camera_v3/cam_isp/isp_hw_mgr/isp_hw/include/cam_vfe_hw_intf.h @@ -189,6 +189,7 @@ struct cam_vfe_bw_update_args { struct cam_isp_resource_node *node_res; uint64_t camnoc_bw_bytes; uint64_t external_bw_bytes; + uint64_t external_bw_bytes_ab; }; /* diff --git a/drivers/media/platform/msm/camera_v3/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/cam_vfe_soc.c b/drivers/media/platform/msm/camera_v3/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/cam_vfe_soc.c index b57762644082..78dd64c4cccf 100644 --- a/drivers/media/platform/msm/camera_v3/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/cam_vfe_soc.c +++ b/drivers/media/platform/msm/camera_v3/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/cam_vfe_soc.c @@ -235,6 +235,7 @@ int cam_vfe_enable_soc_resources(struct cam_hw_soc_info *soc_info) ahb_vote.vote.level = CAM_SVS_VOTE; axi_vote.compressed_bw = 10640000000L; + axi_vote.compressed_bw_ab = 10640000000L; axi_vote.uncompressed_bw = 10640000000L; rc = cam_cpas_start(soc_private->cpas_handle[0], &ahb_vote, &axi_vote); diff --git a/drivers/media/platform/msm/camera_v3/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe_top/cam_vfe_top_ver2.c b/drivers/media/platform/msm/camera_v3/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe_top/cam_vfe_top_ver2.c index 569bbb6b2ce0..c5acbe5dbd16 100644 --- a/drivers/media/platform/msm/camera_v3/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe_top/cam_vfe_top_ver2.c +++ b/drivers/media/platform/msm/camera_v3/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe_top/cam_vfe_top_ver2.c @@ -34,7 +34,7 @@ struct cam_vfe_top_ver2_priv { struct cam_vfe_top_ver2_common_data common_data; struct cam_isp_resource_node mux_rsrc[CAM_VFE_TOP_VER2_MUX_MAX]; unsigned long hw_clk_rate; - struct cam_axi_vote applied_axi_vote; + struct cam_axi_vote applied_axi_vote; struct cam_axi_vote req_axi_vote[CAM_VFE_TOP_VER2_MUX_MAX]; unsigned long req_clk_rate[CAM_VFE_TOP_VER2_MUX_MAX]; struct cam_axi_vote last_vote[CAM_CPAS_HANDLE_MAX] @@ -127,8 +127,8 @@ static int cam_vfe_top_set_axi_bw_vote( struct cam_vfe_top_ver2_priv *top_priv, bool start_stop) { - struct cam_axi_vote sum = {0, 0}; - struct cam_axi_vote to_be_applied_axi_vote = {0, 0}; + struct cam_axi_vote sum = {0, 0, 0}; + struct cam_axi_vote to_be_applied_axi_vote = {0, 0, 0}; int i, rc = 0; struct cam_hw_soc_info *soc_info = top_priv->common_data.soc_info; @@ -137,6 +137,7 @@ static int cam_vfe_top_set_axi_bw_vote( bool apply_bw_update = false; enum cam_cpas_handle_id cpashdl_type; struct cam_axi_vote *last_vote = NULL; + struct cam_axi_vote *applied_axi_vote = NULL; if (!soc_private) { CAM_ERR(CAM_ISP, "Error soc_private NULL"); @@ -151,8 +152,10 @@ static int cam_vfe_top_set_axi_bw_vote( continue; sum.uncompressed_bw = sum.compressed_bw = 0; + sum.compressed_bw_ab = 0; to_be_applied_axi_vote.uncompressed_bw = 0; to_be_applied_axi_vote.compressed_bw = 0; + to_be_applied_axi_vote.compressed_bw_ab = 0; apply_bw_update = false; for (i = 0; i < CAM_VFE_TOP_VER2_MUX_MAX; i++) { @@ -164,14 +167,20 @@ static int cam_vfe_top_set_axi_bw_vote( top_priv->req_axi_vote[i].uncompressed_bw; sum.compressed_bw += top_priv->req_axi_vote[i].compressed_bw; + sum.compressed_bw_ab += + top_priv->req_axi_vote[i].compressed_bw_ab; } } + applied_axi_vote = &top_priv->applied_axi_vote; - CAM_DBG(CAM_ISP, "Updating BW from (%llu %llu) to (%llu %llu)", - top_priv->applied_axi_vote.uncompressed_bw, - top_priv->applied_axi_vote.compressed_bw, + CAM_DBG(CAM_ISP, + "Updating BW (ib, ib, ab) from (%llu %llu %llu) to (%llu %llu %llu)", + applied_axi_vote->uncompressed_bw, + applied_axi_vote->compressed_bw, + applied_axi_vote->compressed_bw_ab, sum.uncompressed_bw, - sum.compressed_bw); + sum.compressed_bw, + sum.compressed_bw_ab); last_vote = top_priv->last_vote[cpashdl_type]; @@ -181,13 +190,16 @@ static int cam_vfe_top_set_axi_bw_vote( (CAM_VFE_TOP_VER2_MUX_MAX * CAM_VFE_DELAY_BW_REDUCTION_NUM_FRAMES); - if ((top_priv->applied_axi_vote.uncompressed_bw == + if ((applied_axi_vote->uncompressed_bw == sum.uncompressed_bw) && - (top_priv->applied_axi_vote.compressed_bw == - sum.compressed_bw)) { - CAM_DBG(CAM_ISP, "BW config unchanged %llu %llu", - top_priv->applied_axi_vote.uncompressed_bw, - top_priv->applied_axi_vote.compressed_bw); + (applied_axi_vote->compressed_bw == + sum.compressed_bw) && + (applied_axi_vote->compressed_bw_ab == + sum.compressed_bw_ab)) { + CAM_DBG(CAM_ISP, "BW config unchanged %llu %llu %llu", + applied_axi_vote->uncompressed_bw, + applied_axi_vote->compressed_bw, + applied_axi_vote->compressed_bw_ab); return 0; } @@ -196,10 +208,12 @@ static int cam_vfe_top_set_axi_bw_vote( soc_private->cpas_handle[cpashdl_type], &to_be_applied_axi_vote); if (!rc) { - top_priv->applied_axi_vote.uncompressed_bw = + applied_axi_vote->uncompressed_bw = to_be_applied_axi_vote.uncompressed_bw; - top_priv->applied_axi_vote.compressed_bw = + applied_axi_vote->compressed_bw = to_be_applied_axi_vote.compressed_bw; + applied_axi_vote->compressed_bw_ab = + to_be_applied_axi_vote.compressed_bw_ab; } return rc; } @@ -215,6 +229,11 @@ static int cam_vfe_top_set_axi_bw_vote( to_be_applied_axi_vote.compressed_bw = last_vote[i].compressed_bw; + if (to_be_applied_axi_vote.compressed_bw_ab < + last_vote[i].compressed_bw_ab) + to_be_applied_axi_vote.compressed_bw_ab = + last_vote[i].compressed_bw_ab; + if (to_be_applied_axi_vote.uncompressed_bw < last_vote[i].uncompressed_bw) to_be_applied_axi_vote.uncompressed_bw = @@ -222,9 +241,11 @@ static int cam_vfe_top_set_axi_bw_vote( } if ((to_be_applied_axi_vote.uncompressed_bw != - top_priv->applied_axi_vote.uncompressed_bw) || + applied_axi_vote->uncompressed_bw) || (to_be_applied_axi_vote.compressed_bw != - top_priv->applied_axi_vote.compressed_bw)) + applied_axi_vote->compressed_bw) || + (to_be_applied_axi_vote.compressed_bw_ab != + applied_axi_vote->compressed_bw_ab)) apply_bw_update = true; CAM_DBG(CAM_ISP, "apply_bw_update=%d", apply_bw_update); @@ -234,10 +255,12 @@ static int cam_vfe_top_set_axi_bw_vote( soc_private->cpas_handle[cpashdl_type], &to_be_applied_axi_vote); if (!rc) { - top_priv->applied_axi_vote.uncompressed_bw = - to_be_applied_axi_vote.uncompressed_bw; - top_priv->applied_axi_vote.compressed_bw = + applied_axi_vote->uncompressed_bw = + to_be_applied_axi_vote.uncompressed_bw; + applied_axi_vote->compressed_bw = to_be_applied_axi_vote.compressed_bw; + applied_axi_vote->compressed_bw_ab = + to_be_applied_axi_vote.compressed_bw_ab; } else { CAM_ERR(CAM_ISP, "BW request failed, rc=%d", rc); @@ -338,6 +361,8 @@ static int cam_vfe_top_bw_update( bw_update->camnoc_bw_bytes; top_priv->req_axi_vote[i].compressed_bw = bw_update->external_bw_bytes; + top_priv->req_axi_vote[i].compressed_bw_ab = + bw_update->external_bw_bytes_ab; top_priv->axi_vote_control[i] = CAM_VFE_BW_CONTROL_INCLUDE; break; @@ -639,6 +664,7 @@ int cam_vfe_top_stop(void *device_priv, if (top_priv->mux_rsrc[i].res_id == mux_res->res_id) { top_priv->req_clk_rate[i] = 0; top_priv->req_axi_vote[i].compressed_bw = 0; + top_priv->req_axi_vote[i].compressed_bw_ab = 0; top_priv->req_axi_vote[i].uncompressed_bw = 0; top_priv->axi_vote_control[i] = CAM_VFE_BW_CONTROL_EXCLUDE; @@ -742,6 +768,7 @@ int cam_vfe_top_ver2_init( vfe_top->top_priv = top_priv; top_priv->hw_clk_rate = 0; top_priv->applied_axi_vote.compressed_bw = 0; + top_priv->applied_axi_vote.compressed_bw_ab = 0; top_priv->applied_axi_vote.uncompressed_bw = 0; memset(top_priv->last_vote, 0x0, sizeof(struct cam_axi_vote) * (CAM_VFE_TOP_VER2_MUX_MAX * CAM_CPAS_HANDLE_MAX * @@ -756,6 +783,7 @@ int cam_vfe_top_ver2_init( CAM_ISP_RESOURCE_STATE_AVAILABLE; top_priv->req_clk_rate[i] = 0; top_priv->req_axi_vote[i].compressed_bw = 0; + top_priv->req_axi_vote[i].compressed_bw_ab = 0; top_priv->req_axi_vote[i].uncompressed_bw = 0; top_priv->axi_vote_control[i] = CAM_VFE_BW_CONTROL_EXCLUDE; diff --git a/drivers/media/platform/msm/camera_v3/cam_jpeg/jpeg_hw/jpeg_dma_hw/jpeg_dma_core.c b/drivers/media/platform/msm/camera_v3/cam_jpeg/jpeg_hw/jpeg_dma_hw/jpeg_dma_core.c index b6f1d56de67f..9a523f7479d9 100644 --- a/drivers/media/platform/msm/camera_v3/cam_jpeg/jpeg_hw/jpeg_dma_hw/jpeg_dma_core.c +++ b/drivers/media/platform/msm/camera_v3/cam_jpeg/jpeg_hw/jpeg_dma_hw/jpeg_dma_core.c @@ -1,4 +1,4 @@ -/* 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 @@ -65,6 +65,7 @@ int cam_jpeg_dma_init_hw(void *device_priv, ahb_vote.type = CAM_VOTE_ABSOLUTE; ahb_vote.vote.level = CAM_SVS_VOTE; axi_vote.compressed_bw = JPEG_VOTE; + axi_vote.compressed_bw_ab = JPEG_VOTE; axi_vote.uncompressed_bw = JPEG_VOTE; rc = cam_cpas_start(core_info->cpas_handle, diff --git a/drivers/media/platform/msm/camera_v3/cam_jpeg/jpeg_hw/jpeg_enc_hw/jpeg_enc_core.c b/drivers/media/platform/msm/camera_v3/cam_jpeg/jpeg_hw/jpeg_enc_hw/jpeg_enc_core.c index 7fcc1ada1a36..52907cd6803e 100644 --- a/drivers/media/platform/msm/camera_v3/cam_jpeg/jpeg_hw/jpeg_enc_hw/jpeg_enc_core.c +++ b/drivers/media/platform/msm/camera_v3/cam_jpeg/jpeg_hw/jpeg_enc_hw/jpeg_enc_core.c @@ -1,4 +1,4 @@ -/* 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 @@ -76,6 +76,7 @@ int cam_jpeg_enc_init_hw(void *device_priv, ahb_vote.type = CAM_VOTE_ABSOLUTE; ahb_vote.vote.level = CAM_SVS_VOTE; axi_vote.compressed_bw = JPEG_VOTE; + axi_vote.compressed_bw_ab = JPEG_VOTE; axi_vote.uncompressed_bw = JPEG_VOTE; rc = cam_cpas_start(core_info->cpas_handle, diff --git a/drivers/media/platform/msm/camera_v3/cam_lrme/lrme_hw_mgr/lrme_hw/cam_lrme_hw_soc.c b/drivers/media/platform/msm/camera_v3/cam_lrme/lrme_hw_mgr/lrme_hw/cam_lrme_hw_soc.c index 8c58685696ad..d32e5f7edc1a 100644 --- a/drivers/media/platform/msm/camera_v3/cam_lrme/lrme_hw_mgr/lrme_hw/cam_lrme_hw_soc.c +++ b/drivers/media/platform/msm/camera_v3/cam_lrme/lrme_hw_mgr/lrme_hw/cam_lrme_hw_soc.c @@ -1,4 +1,4 @@ -/* 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 @@ -33,6 +33,7 @@ int cam_lrme_soc_enable_resources(struct cam_hw_info *lrme_hw) ahb_vote.type = CAM_VOTE_ABSOLUTE; ahb_vote.vote.level = CAM_SVS_VOTE; axi_vote.compressed_bw = 7200000; + axi_vote.compressed_bw_ab = 7200000; axi_vote.uncompressed_bw = 7200000; rc = cam_cpas_start(soc_private->cpas_handle, &ahb_vote, &axi_vote); if (rc) { diff --git a/drivers/media/platform/msm/camera_v3/cam_sensor_module/cam_cci/cam_cci_soc.c b/drivers/media/platform/msm/camera_v3/cam_sensor_module/cam_cci/cam_cci_soc.c index 7d71cd57573e..fa290c0b982c 100644 --- a/drivers/media/platform/msm/camera_v3/cam_sensor_module/cam_cci/cam_cci_soc.c +++ b/drivers/media/platform/msm/camera_v3/cam_sensor_module/cam_cci/cam_cci_soc.c @@ -81,6 +81,7 @@ int cam_cci_init(struct v4l2_subdev *sd, ahb_vote.type = CAM_VOTE_ABSOLUTE; ahb_vote.vote.level = CAM_SVS_VOTE; axi_vote.compressed_bw = CAM_CPAS_DEFAULT_AXI_BW; + axi_vote.compressed_bw_ab = CAM_CPAS_DEFAULT_AXI_BW; axi_vote.uncompressed_bw = CAM_CPAS_DEFAULT_AXI_BW; rc = cam_cpas_start(cci_dev->cpas_handle, diff --git a/drivers/media/platform/msm/camera_v3/cam_sensor_module/cam_csiphy/cam_csiphy_core.c b/drivers/media/platform/msm/camera_v3/cam_sensor_module/cam_csiphy/cam_csiphy_core.c index 17499489184b..85b8e37de5f6 100644 --- a/drivers/media/platform/msm/camera_v3/cam_sensor_module/cam_csiphy/cam_csiphy_core.c +++ b/drivers/media/platform/msm/camera_v3/cam_sensor_module/cam_csiphy/cam_csiphy_core.c @@ -850,6 +850,7 @@ int32_t cam_csiphy_core_cfg(void *phy_dev, ahb_vote.type = CAM_VOTE_ABSOLUTE; ahb_vote.vote.level = CAM_SVS_VOTE; axi_vote.compressed_bw = CAM_CPAS_DEFAULT_AXI_BW; + axi_vote.compressed_bw_ab = CAM_CPAS_DEFAULT_AXI_BW; axi_vote.uncompressed_bw = CAM_CPAS_DEFAULT_AXI_BW; rc = cam_cpas_start(csiphy_dev->cpas_handle, diff --git a/include/uapi/media/cam_isp.h b/include/uapi/media/cam_isp.h index 91360e240b49..995d6ec7e4b2 100644 --- a/include/uapi/media/cam_isp.h +++ b/include/uapi/media/cam_isp.h @@ -90,6 +90,7 @@ #define CAM_ISP_GENERIC_BLOB_TYPE_UBWC_CONFIG 3 #define CAM_ISP_GENERIC_BLOB_TYPE_CSID_CLOCK_CONFIG 4 #define CAM_ISP_GENERIC_BLOB_TYPE_FE_CONFIG 5 +#define CAM_ISP_GENERIC_BLOB_TYPE_BW_CONFIG_V2 6 /* Query devices */ /** @@ -387,6 +388,25 @@ struct cam_isp_bw_config { struct cam_isp_bw_vote rdi_vote[1]; } __attribute__((packed)); + +/** + * struct cam_isp_bw_config_ab - Bandwidth configuration + * + * @usage_type: Usage type (Single/Dual) + * @num_rdi: Number of RDI votes + * @left_pix_vote_ab: AB Bandwidth vote for left ISP + * @right_pix_vote_ab: AB Bandwidth vote for right ISP + * @rdi_vote_ab: AB RDI bandwidth requirements + */ + +struct cam_isp_bw_config_ab { + uint32_t usage_type; + uint32_t num_rdi; + uint64_t left_pix_vote_ab; + uint64_t right_pix_vote_ab; + uint64_t rdi_vote_ab[1]; +} __attribute__((packed)); + /** * struct cam_fe_config - Fetch Engine configuration * |