Merge "Merge remote-tracking branch 'dev/msm-4.14-camx' into msm-4.14 03/28"

This commit is contained in:
qctecmdr 2019-04-04 06:36:34 -07:00 committed by Gerrit - the friendly Code Review server
commit 53f9955dd5
25 changed files with 358 additions and 85 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, The Linux Foundation. All rights reserved.
* Copyright (c) 2018-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
@ -267,7 +267,7 @@
qcom,cam-sensor@2 {
cell-index = <2>;
compatible = "qcom,cam-sensor";
reg = <0x02>;
reg = <0x2>;
csiphy-sd-index = <2>;
sensor-position-roll = <270>;
sensor-position-pitch = <0>;
@ -351,7 +351,7 @@
qcom,cam-sensor@4 {
cell-index = <4>;
compatible = "qcom,cam-sensor";
reg = <0x04>;
reg = <0x4>;
csiphy-sd-index = <0>;
sensor-position-roll = <90>;
sensor-position-pitch = <0>;
@ -390,6 +390,90 @@
clock-cntl-level = "turbo";
clock-rates = <24000000>;
};
qcom,cam-sensor@5 {
cell-index = <5>;
compatible = "qcom,cam-sensor";
reg = <0x5>;
csiphy-sd-index = <1>;
sensor-position-roll = <90>;
sensor-position-pitch = <0>;
sensor-position-yaw = <180>;
led-flash-src = <&led_flash_rear_aux>;
eeprom-src = <&eeprom_rear>;
actuator-src = <&actuator_rear>;
cam_vio-supply = <&pm8009_l7>;
cam_vana-supply = <&pm8009_l6>;
cam_vdig-supply = <&pm8009_l4>;
cam_clk-supply = <&titan_top_gdsc>;
regulator-names = "cam_vio", "cam_vana", "cam_vdig",
"cam_clk";
rgltr-cntrl-support;
rgltr-min-voltage = <1800000 2800000 1200000 0>;
rgltr-max-voltage = <1800000 2800000 1200000 0>;
rgltr-load-current = <0 80000 105000 0>;
gpio-no-mux = <0>;
pinctrl-names = "cam_default", "cam_suspend";
pinctrl-0 = <&cam_sensor_mclk1_active
&cam_sensor_rear2_active>;
pinctrl-1 = <&cam_sensor_mclk1_suspend
&cam_sensor_rear2_suspend>;
gpios = <&tlmm 14 0>,
<&pm8009_gpios 2 0>;
gpio-reset = <1>;
gpio-req-tbl-num = <0 1>;
gpio-req-tbl-flags = <1 0>;
gpio-req-tbl-label = "CAMIF_MCLK1",
"CAM_RESET1";
sensor-mode = <0>;
cci-master = <0>;
status = "ok";
clocks = <&clock_camcc CAM_CC_MCLK1_CLK>;
clock-names = "cam_clk";
clock-cntl-level = "turbo";
clock-rates = <24000000>;
};
qcom,cam-sensor@6 {
cell-index = <6>;
compatible = "qcom,cam-sensor";
reg = <0x6>;
csiphy-sd-index = <2>;
sensor-position-roll = <270>;
sensor-position-pitch = <0>;
sensor-position-yaw = <0>;
actuator-src = <&actuator_rear_aux>;
cam_vio-supply = <&pm8009_l7>;
cam_vana-supply = <&pm8009_l6>;
cam_vdig-supply = <&pm8009_l2>;
cam_clk-supply = <&titan_top_gdsc>;
regulator-names = "cam_vio", "cam_vana", "cam_vdig",
"cam_clk";
rgltr-cntrl-support;
rgltr-min-voltage = <1800000 2800000 1050000 0>;
rgltr-max-voltage = <1800000 2800000 1050000 0>;
rgltr-load-current = <0 80000 105000 0>;
gpio-no-mux = <0>;
pinctrl-names = "cam_default", "cam_suspend";
pinctrl-0 = <&cam_sensor_mclk2_active
&cam_sensor_front_active>;
pinctrl-1 = <&cam_sensor_mclk2_suspend
&cam_sensor_front_suspend>;
gpios = <&tlmm 15 0>,
<&pm8009_gpios 4 0>;
gpio-reset = <1>;
gpio-req-tbl-num = <0 1>;
gpio-req-tbl-flags = <1 0>;
gpio-req-tbl-label = "CAMIF_MCLK2",
"CAM_RESET2";
sensor-mode = <0>;
cci-master = <1>;
status = "ok";
clocks = <&clock_camcc CAM_CC_MCLK2_CLK>;
clock-names = "cam_clk";
clock-cntl-level = "turbo";
clock-rates = <24000000>;
};
};

View File

@ -1607,6 +1607,34 @@
};
};
cam_sensor_mclk3_active: cam_sensor_mclk3_active {
/* MCLK3 */
mux {
pins = "gpio31";
function = "cam_mclk";
};
config {
pins = "gpio31";
bias-disable; /* No PULL */
drive-strength = <2>; /* 2 MA */
};
};
cam_sensor_mclk3_suspend: cam_sensor_mclk3_suspend {
/* MCLK3 */
mux {
pins = "gpio31";
function = "cam_mclk";
};
config {
pins = "gpio31";
bias-pull-down; /* PULL DOWN */
drive-strength = <2>; /* 2 MA */
};
};
flash_led3_front {
flash_led3_front_en: flash_led3_front_en {
mux {

View File

@ -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,

View File

@ -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
@ -947,6 +947,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) {

View File

@ -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
@ -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);

View File

@ -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
@ -347,6 +347,7 @@ struct cam_ahb_vote {
struct cam_axi_vote {
uint64_t uncompressed_bw;
uint64_t compressed_bw;
uint64_t compressed_bw_ab;
};
/**

View File

@ -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) {

View File

@ -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,

View File

@ -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;
@ -4468,8 +4487,9 @@ static int cam_icp_get_acquire_info(struct cam_icp_hw_mgr *hw_mgr,
return -EINVAL;
}
if (icp_dev_acquire_info.num_out_res > ICP_MAX_OUTPUT_SUPPORTED) {
CAM_ERR(CAM_ICP, "num of out resources exceeding : %u",
if ((icp_dev_acquire_info.num_out_res > ICP_MAX_OUTPUT_SUPPORTED) ||
(icp_dev_acquire_info.num_out_res <= 0)) {
CAM_ERR(CAM_ICP, "Invalid num of out resources: %u",
icp_dev_acquire_info.num_out_res);
return -EINVAL;
}

View File

@ -188,6 +188,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];
};
/**
@ -252,6 +253,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
@ -263,6 +265,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;

View File

@ -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,

View File

@ -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,
@ -1691,6 +1691,14 @@ static int cam_ife_mgr_check_and_update_fe(
((uint8_t *)&acquire_hw_info->data +
acquire_hw_info->input_info_offset);
for (i = 0; i < acquire_hw_info->num_inputs; i++) {
if ((in_port->num_out_res > CAM_IFE_HW_OUT_RES_MAX) ||
(in_port->num_out_res <= 0)) {
CAM_ERR(CAM_ISP, "Invalid num output res %u",
in_port->num_out_res);
return -EINVAL;
}
in_port_length = sizeof(struct cam_isp_in_port_info) +
(in_port->num_out_res - 1) *
sizeof(struct cam_isp_out_port_info);
@ -1927,7 +1935,6 @@ static int cam_ife_mgr_acquire_hw(void *hw_mgr_priv, void *acquire_hw_args)
}
cdm_acquire.base_array_cnt = j;
cdm_acquire.id = CAM_CDM_VIRTUAL;
cdm_acquire.cam_cdm_callback = cam_ife_cam_cdm_callback;
rc = cam_cdm_acquire(&cdm_acquire);
@ -1943,21 +1950,23 @@ static int cam_ife_mgr_acquire_hw(void *hw_mgr_priv, void *acquire_hw_args)
acquire_hw_info =
(struct cam_isp_acquire_hw_info *)acquire_args->acquire_info;
in_port = (struct cam_isp_in_port_info *)
((uint8_t *)&acquire_hw_info->data +
acquire_hw_info->input_info_offset);
rc = cam_ife_mgr_check_and_update_fe(ife_ctx, acquire_hw_info);
if (rc) {
CAM_ERR(CAM_ISP, "buffer size is not enough");
goto free_ctx;
goto free_cdm;
}
in_port = (struct cam_isp_in_port_info *)
((uint8_t *)&acquire_hw_info->data +
acquire_hw_info->input_info_offset);
/* acquire HW resources */
for (i = 0; i < acquire_hw_info->num_inputs; i++) {
if (in_port->num_out_res > CAM_IFE_HW_OUT_RES_MAX) {
CAM_ERR(CAM_ISP, "too many output res %d",
if ((in_port->num_out_res > CAM_IFE_HW_OUT_RES_MAX) ||
(in_port->num_out_res <= 0)) {
CAM_ERR(CAM_ISP, "Invalid num output res %u",
in_port->num_out_res);
rc = -EINVAL;
goto free_res;
@ -2010,6 +2019,7 @@ static int cam_ife_mgr_acquire_hw(void *hw_mgr_priv, void *acquire_hw_args)
return 0;
free_res:
cam_ife_hw_mgr_release_hw_for_ctx(ife_ctx);
free_cdm:
cam_cdm_release(ife_ctx->cdm_handle);
free_ctx:
cam_ife_hw_mgr_put_ctx(&ife_hw_mgr->free_ctx_list, &ife_ctx);
@ -2202,6 +2212,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 +2220,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 +2250,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 +2262,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 +2279,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 +2291,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 +2303,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 +2324,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 +2376,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 +3587,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,11 +3698,35 @@ 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: {

View File

@ -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];
};

View File

@ -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",

View File

@ -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;
};
/*

View File

@ -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);

View File

@ -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
@ -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;

View File

@ -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,

View File

@ -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,

View File

@ -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) {

View File

@ -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
@ -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,

View File

@ -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
@ -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,

View File

@ -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
@ -338,6 +338,7 @@ int cam_sensor_i2c_command_parser(
cmd_buf = (uint32_t *)generic_ptr;
cmd_buf += cmd_desc[i].offset / sizeof(uint32_t);
remain_len -= cmd_desc[i].offset;
if (remain_len < cmd_desc[i].length) {
CAM_ERR(CAM_SENSOR, "buffer provided too small");
return -EINVAL;

View File

@ -681,11 +681,6 @@ static int cam_smmu_create_add_handle_in_table(char *name,
if (!strcmp(iommu_cb_set.cb_info[i].name, name)) {
mutex_lock(&iommu_cb_set.cb_info[i].lock);
if (iommu_cb_set.cb_info[i].handle != HANDLE_INIT) {
CAM_ERR(CAM_SMMU,
"Error: %s already got handle 0x%x",
name,
iommu_cb_set.cb_info[i].handle);
if (iommu_cb_set.cb_info[i].is_secure)
iommu_cb_set.cb_info[i].secure_count++;
@ -694,6 +689,11 @@ static int cam_smmu_create_add_handle_in_table(char *name,
*hdl = iommu_cb_set.cb_info[i].handle;
return 0;
}
CAM_ERR(CAM_SMMU,
"Error: %s already got handle 0x%x",
name, iommu_cb_set.cb_info[i].handle);
return -EINVAL;
}

View File

@ -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
*