msm: camera: isp: Fix bandwidth voting
Add minimum vote to be added to the bandwidth vote for cobalt. Also, use the vfe clock rate when deciding the bandwidth for both rdi as well as pix stream. CRs-Fixed: 1065389 Change-Id: Ic142026e8963830cda5c2d607e6e96f66c39d1bb Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
This commit is contained in:
parent
e1e955199d
commit
8401b47ce5
4 changed files with 33 additions and 20 deletions
|
@ -320,6 +320,7 @@ enable_regulators_failed:
|
|||
void msm_vfe47_release_hardware(struct vfe_device *vfe_dev)
|
||||
{
|
||||
enum cam_ahb_clk_client id;
|
||||
unsigned long rate = 0;
|
||||
|
||||
/* when closing node, disable all irq */
|
||||
vfe_dev->irq0_mask = 0;
|
||||
|
@ -345,6 +346,8 @@ void msm_vfe47_release_hardware(struct vfe_device *vfe_dev)
|
|||
|
||||
vfe_dev->ahb_vote = CAM_AHB_SUSPEND_VOTE;
|
||||
|
||||
vfe_dev->hw_info->vfe_ops.platform_ops.set_clk_rate(vfe_dev, &rate);
|
||||
|
||||
vfe_dev->hw_info->vfe_ops.platform_ops.enable_clks(
|
||||
vfe_dev, 0);
|
||||
vfe_dev->hw_info->vfe_ops.platform_ops.enable_regulators(vfe_dev, 0);
|
||||
|
|
|
@ -246,6 +246,8 @@ struct msm_vfe_hardware_info vfe48_hw_info = {
|
|||
.num_iommu_secure_ctx = 0,
|
||||
.vfe_clk_idx = VFE48_SRC_CLK_DTSI_IDX,
|
||||
.runtime_axi_update = 1,
|
||||
.min_ib = 100000000,
|
||||
.min_ab = 100000000,
|
||||
.vfe_ops = {
|
||||
.irq_ops = {
|
||||
.read_irq_status = msm_vfe47_read_irq_status,
|
||||
|
|
|
@ -1023,31 +1023,32 @@ static void msm_isp_calculate_bandwidth(
|
|||
struct msm_vfe_axi_stream *stream_info)
|
||||
{
|
||||
int bpp = 0;
|
||||
struct vfe_device *vfe_dev;
|
||||
struct msm_vfe_axi_shared_data *axi_data;
|
||||
int i;
|
||||
|
||||
if (stream_info->stream_src < RDI_INTF_0) {
|
||||
for (i = 0; i < stream_info->num_isp; i++) {
|
||||
axi_data = &stream_info->vfe_dev[i]->axi_data;
|
||||
for (i = 0; i < stream_info->num_isp; i++) {
|
||||
vfe_dev = stream_info->vfe_dev[i];
|
||||
axi_data = &vfe_dev->axi_data;
|
||||
if (stream_info->stream_src < RDI_INTF_0) {
|
||||
stream_info->bandwidth[i] =
|
||||
(axi_data->src_info[VFE_PIX_0].pixel_clock /
|
||||
(vfe_dev->msm_isp_vfe_clk_rate /
|
||||
axi_data->src_info[VFE_PIX_0].width) *
|
||||
stream_info->max_width[i];
|
||||
stream_info->bandwidth[i] =
|
||||
(unsigned long)stream_info->bandwidth[i] *
|
||||
stream_info->format_factor / ISP_Q2;
|
||||
}
|
||||
} else {
|
||||
int rdi = SRC_TO_INTF(stream_info->stream_src);
|
||||
bpp = msm_isp_get_bit_per_pixel(stream_info->output_format);
|
||||
if (rdi < VFE_SRC_MAX) {
|
||||
for (i = 0; i < stream_info->num_isp; i++) {
|
||||
axi_data = &stream_info->vfe_dev[i]->axi_data;
|
||||
stream_info->bandwidth[i] =
|
||||
(axi_data->src_info[rdi].pixel_clock / 8) * bpp;
|
||||
}
|
||||
} else {
|
||||
pr_err("%s: Invalid rdi interface\n", __func__);
|
||||
int rdi = SRC_TO_INTF(stream_info->stream_src);
|
||||
|
||||
bpp = msm_isp_get_bit_per_pixel(
|
||||
stream_info->output_format);
|
||||
if (rdi < VFE_SRC_MAX) {
|
||||
stream_info->bandwidth[i] =
|
||||
(vfe_dev->msm_isp_vfe_clk_rate / 8) * bpp;
|
||||
} else {
|
||||
pr_err("%s: Invalid rdi interface\n", __func__);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -483,11 +483,18 @@ int msm_isp_cfg_input(struct vfe_device *vfe_dev, void *arg)
|
|||
}
|
||||
|
||||
pixel_clock = input_cfg->input_pix_clk;
|
||||
rc = vfe_dev->hw_info->vfe_ops.platform_ops.set_clk_rate(vfe_dev,
|
||||
&pixel_clock);
|
||||
if (rc < 0) {
|
||||
pr_err("%s: clock set rate failed\n", __func__);
|
||||
return rc;
|
||||
/*
|
||||
* Only set rate to higher, do not lower higher
|
||||
* rate needed by another input
|
||||
*/
|
||||
if (pixel_clock > vfe_dev->msm_isp_vfe_clk_rate) {
|
||||
rc = vfe_dev->hw_info->vfe_ops.platform_ops.set_clk_rate(
|
||||
vfe_dev,
|
||||
&pixel_clock);
|
||||
if (rc < 0) {
|
||||
pr_err("%s: clock set rate failed\n", __func__);
|
||||
return rc;
|
||||
}
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue