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

Commit 9c2ec496 authored by Petar Sivenov's avatar Petar Sivenov
Browse files

msm: camera: isp: Use proportional UB slicing and 7 WM



The proportional slicing is used for determining Unified Buffer sizes
for each write master. This allows more efficiend use of UBs and
avoiding overflows.
Also this removes the need to set maximum number of write masters to
less than all available.

Change-Id: I774220268c96275b84d5fe265d68669b9fda4294
Signed-off-by: default avatarPetar Sivenov <psiven@codeaurora.org>
parent 360013b1
Loading
Loading
Loading
Loading
+10 −9
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@
#include <linux/module.h>
#include <mach/iommu.h>
#include <linux/ratelimit.h>

#include <asm/div64.h>
#include "msm_isp40.h"
#include "msm_isp_util.h"
#include "msm_isp_axi_util.h"
@@ -37,8 +37,8 @@
#define VFE40_8x26V2_VERSION 0x20010014
#define VFE40_8916_VERSION 0x10030000

#define VFE40_BURST_LEN 3
#define VFE40_STATS_BURST_LEN 2
#define VFE40_BURST_LEN 1
#define VFE40_STATS_BURST_LEN 1
#define VFE40_UB_SIZE 1536
#define VFE40_EQUAL_SLICE_UB 190
#define VFE40_WM_BASE(idx) (0x6C + 0x24 * idx)
@@ -1066,7 +1066,6 @@ static void msm_vfe40_cfg_axi_ub_equal_default(
	uint8_t num_used_wms = 0;
	uint32_t prop_size = 0;
	uint32_t wm_ub_size;
	uint32_t delta;

	for (i = 0; i < axi_data->hw_info->num_wm; i++) {
		if (axi_data->free_wm[i] > 0) {
@@ -1078,9 +1077,11 @@ static void msm_vfe40_cfg_axi_ub_equal_default(
		axi_data->hw_info->min_wm_ub * num_used_wms;
	for (i = 0; i < axi_data->hw_info->num_wm; i++) {
		if (axi_data->free_wm[i]) {
			delta =
				(axi_data->wm_image_size[i] *
					prop_size)/total_image_size;
			uint64_t delta = 0;
			uint64_t temp = (uint64_t)axi_data->wm_image_size[i] *
					(uint64_t)prop_size;
			do_div(temp, total_image_size);
			delta = temp;
			wm_ub_size = axi_data->hw_info->min_wm_ub + delta;
			msm_camera_io_w(ub_offset << 16 | (wm_ub_size - 1),
				vfe_dev->vfe_base + VFE40_WM_BASE(i) + 0x10);
@@ -1107,7 +1108,7 @@ static void msm_vfe40_cfg_axi_ub_equal_slicing(
static void msm_vfe40_cfg_axi_ub(struct vfe_device *vfe_dev)
{
	struct msm_vfe_axi_shared_data *axi_data = &vfe_dev->axi_data;
	axi_data->wm_ub_cfg_policy = MSM_WM_UB_EQUAL_SLICING;
	axi_data->wm_ub_cfg_policy = MSM_WM_UB_CFG_DEFAULT;
	if (axi_data->wm_ub_cfg_policy == MSM_WM_UB_EQUAL_SLICING)
		msm_vfe40_cfg_axi_ub_equal_slicing(vfe_dev);
	else
@@ -1395,7 +1396,7 @@ static void msm_vfe40_get_error_mask(
}

static struct msm_vfe_axi_hardware_info msm_vfe40_axi_hw_info = {
	.num_wm = 6,
	.num_wm = 7,
	.num_comp_mask = 3,
	.num_rdi = 3,
	.num_rdi_master = 3,
+2 −2
Original line number Diff line number Diff line
@@ -24,8 +24,8 @@
static DEFINE_MUTEX(bandwidth_mgr_mutex);
static struct msm_isp_bandwidth_mgr isp_bandwidth_mgr;

#define MSM_ISP_MIN_AB 300000000
#define MSM_ISP_MIN_IB 450000000
#define MSM_ISP_MIN_AB 450000000
#define MSM_ISP_MIN_IB 900000000

#define VFE40_8974V2_VERSION 0x1001001A