Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fd5f68d3 authored by Alok Kediya's avatar Alok Kediya Committed by Ian Maund
Browse files

msm-camera: Avoid adding top up to calulated ab/ib for single stream.



Avoiding topup for ab/ib for single stream

Change-Id: Ie6fb6716ea1b30604d801936bea3da5a96d8a6fc
Signed-off-by: default avatarAlok Kediya <kediya@codeaurora.org>
parent 0b2ed0fc
Loading
Loading
Loading
Loading
+12 −3
Original line number Diff line number Diff line
@@ -1261,6 +1261,8 @@ static int msm_isp_update_stream_bandwidth(struct vfe_device *vfe_dev)
	struct msm_vfe_axi_shared_data *axi_data = &vfe_dev->axi_data;
	uint64_t total_pix_bandwidth = 0, total_rdi_bandwidth = 0;
	uint32_t num_pix_streams = 0;
	uint32_t num_rdi_streams = 0;
	uint32_t total_streams   = 0;
	uint64_t total_bandwidth = 0;

	for (i = 0; i < MAX_NUM_STREAM; i++) {
@@ -1272,13 +1274,20 @@ static int msm_isp_update_stream_bandwidth(struct vfe_device *vfe_dev)
				num_pix_streams++;
			} else {
				total_rdi_bandwidth += stream_info->bandwidth;
				num_rdi_streams++;
			}
		}
	}
	total_bandwidth = total_pix_bandwidth + total_rdi_bandwidth;
	total_streams = num_pix_streams + num_rdi_streams;
	if (total_streams == 1)
		rc = msm_isp_update_bandwidth(ISP_VFE0 + vfe_dev->pdev->id,
		total_bandwidth,  total_bandwidth *
		ISP_BUS_UTILIZATION_FACTOR / ISP_Q2);
		total_bandwidth ,
		(total_bandwidth * ISP_BUS_UTILIZATION_FACTOR / ISP_Q2));
	else
		rc = msm_isp_update_bandwidth(ISP_VFE0 + vfe_dev->pdev->id,
		(total_bandwidth + MSM_ISP_MIN_AB),  (total_bandwidth *
		ISP_BUS_UTILIZATION_FACTOR / ISP_Q2 + MSM_ISP_MIN_IB));
	if (rc < 0)
		pr_err("%s: update failed\n", __func__);