|
@@ -71,6 +71,8 @@ struct cam_tfe_bus_common_data {
|
|
|
uint32_t num_sec_out;
|
|
|
uint32_t comp_done_shift;
|
|
|
uint32_t rdi_width;
|
|
|
+ uint32_t en_cfg_shift;
|
|
|
+ uint32_t height_shift;
|
|
|
bool is_lite;
|
|
|
bool support_consumed_addr;
|
|
|
cam_hw_mgr_event_cb_func event_cb;
|
|
@@ -602,7 +604,7 @@ static int cam_tfe_bus_acquire_rdi_wm(
|
|
|
{
|
|
|
int pack_fmt = 0;
|
|
|
int rdi_width = rsrc_data->common_data->rdi_width;
|
|
|
-
|
|
|
+ int en_cfg_shift = rsrc_data->common_data->en_cfg_shift;
|
|
|
if (rdi_width == 64)
|
|
|
pack_fmt = 0xa;
|
|
|
else if (rdi_width == 128)
|
|
@@ -622,7 +624,7 @@ static int cam_tfe_bus_acquire_rdi_wm(
|
|
|
rsrc_data->height = 0;
|
|
|
rsrc_data->stride =
|
|
|
CAM_TFE_RDI_BUS_DEFAULT_STRIDE;
|
|
|
- rsrc_data->en_cfg = (0x1 << 16) | 0x1;
|
|
|
+ rsrc_data->en_cfg = (0x1 << en_cfg_shift) | 0x1;
|
|
|
}
|
|
|
break;
|
|
|
case CAM_FORMAT_MIPI_RAW_8:
|
|
@@ -639,7 +641,7 @@ static int cam_tfe_bus_acquire_rdi_wm(
|
|
|
rsrc_data->height = 0;
|
|
|
rsrc_data->stride =
|
|
|
CAM_TFE_RDI_BUS_DEFAULT_STRIDE;
|
|
|
- rsrc_data->en_cfg = (0x1 << 16) | 0x1;
|
|
|
+ rsrc_data->en_cfg = (0x1 << en_cfg_shift) | 0x1;
|
|
|
}
|
|
|
break;
|
|
|
case CAM_FORMAT_MIPI_RAW_10:
|
|
@@ -655,7 +657,7 @@ static int cam_tfe_bus_acquire_rdi_wm(
|
|
|
rsrc_data->height = 0;
|
|
|
rsrc_data->stride =
|
|
|
CAM_TFE_RDI_BUS_DEFAULT_STRIDE;
|
|
|
- rsrc_data->en_cfg = (0x1 << 16) | 0x1;
|
|
|
+ rsrc_data->en_cfg = (0x1 << en_cfg_shift) | 0x1;
|
|
|
}
|
|
|
break;
|
|
|
case CAM_FORMAT_MIPI_RAW_12:
|
|
@@ -671,7 +673,7 @@ static int cam_tfe_bus_acquire_rdi_wm(
|
|
|
rsrc_data->height = 0;
|
|
|
rsrc_data->stride =
|
|
|
CAM_TFE_RDI_BUS_DEFAULT_STRIDE;
|
|
|
- rsrc_data->en_cfg = (0x1 << 16) | 0x1;
|
|
|
+ rsrc_data->en_cfg = (0x1 << en_cfg_shift) | 0x1;
|
|
|
}
|
|
|
break;
|
|
|
case CAM_FORMAT_MIPI_RAW_14:
|
|
@@ -687,7 +689,7 @@ static int cam_tfe_bus_acquire_rdi_wm(
|
|
|
rsrc_data->height = 0;
|
|
|
rsrc_data->stride =
|
|
|
CAM_TFE_RDI_BUS_DEFAULT_STRIDE;
|
|
|
- rsrc_data->en_cfg = (0x1 << 16) | 0x1;
|
|
|
+ rsrc_data->en_cfg = (0x1 << en_cfg_shift) | 0x1;
|
|
|
}
|
|
|
break;
|
|
|
case CAM_FORMAT_PLAIN16_10:
|
|
@@ -707,7 +709,7 @@ static int cam_tfe_bus_acquire_rdi_wm(
|
|
|
rsrc_data->height = 0;
|
|
|
rsrc_data->stride =
|
|
|
CAM_TFE_RDI_BUS_DEFAULT_STRIDE;
|
|
|
- rsrc_data->en_cfg = (0x1 << 16) | 0x1;
|
|
|
+ rsrc_data->en_cfg = (0x1 << en_cfg_shift) | 0x1;
|
|
|
}
|
|
|
break;
|
|
|
|
|
@@ -725,7 +727,7 @@ static int cam_tfe_bus_acquire_rdi_wm(
|
|
|
rsrc_data->height = 0;
|
|
|
rsrc_data->stride =
|
|
|
CAM_TFE_RDI_BUS_DEFAULT_STRIDE;
|
|
|
- rsrc_data->en_cfg = (0x1 << 16) | 0x1;
|
|
|
+ rsrc_data->en_cfg = (0x1 << en_cfg_shift) | 0x1;
|
|
|
}
|
|
|
break;
|
|
|
default:
|
|
@@ -752,7 +754,6 @@ static int cam_tfe_bus_acquire_wm(
|
|
|
struct cam_tfe_bus_wm_resource_data *rsrc_data = NULL;
|
|
|
uint32_t wm_idx = 0;
|
|
|
int rc = 0;
|
|
|
-
|
|
|
*wm_res = NULL;
|
|
|
/* No need to allocate for BUS TFE OUT to WM is fixed. */
|
|
|
if (bus_priv->common_data.is_lite)
|
|
@@ -862,7 +863,7 @@ static int cam_tfe_bus_acquire_wm(
|
|
|
rsrc_data->width = 0;
|
|
|
rsrc_data->height = 0;
|
|
|
rsrc_data->stride = 1;
|
|
|
- rsrc_data->en_cfg = (0x1 << 16) | 0x1;
|
|
|
+ rsrc_data->en_cfg = (0x1 << rsrc_data->common_data->en_cfg_shift) | 0x1;
|
|
|
|
|
|
/*RS state packet format*/
|
|
|
if (rsrc_data->index == 15)
|
|
@@ -919,13 +920,15 @@ static int cam_tfe_bus_start_wm(struct cam_isp_resource_node *wm_res)
|
|
|
wm_res->res_priv;
|
|
|
struct cam_tfe_bus_common_data *common_data =
|
|
|
rsrc_data->common_data;
|
|
|
+ int height_shift = rsrc_data->common_data->height_shift;
|
|
|
|
|
|
/* Skip to overwrite if wm bandwidth limiter blob already sent */
|
|
|
if (!rsrc_data->limiter_blob_status)
|
|
|
cam_io_w(rsrc_data->common_data->counter_limit_mask,
|
|
|
common_data->mem_base + rsrc_data->hw_regs->bw_limit);
|
|
|
|
|
|
- cam_io_w((rsrc_data->height << 16) | rsrc_data->width,
|
|
|
+ cam_io_w(0xf, common_data->mem_base + rsrc_data->hw_regs->bw_limit);
|
|
|
+ cam_io_w((rsrc_data->height << height_shift) | rsrc_data->width,
|
|
|
common_data->mem_base + rsrc_data->hw_regs->image_cfg_0);
|
|
|
cam_io_w(rsrc_data->pack_fmt,
|
|
|
common_data->mem_base + rsrc_data->hw_regs->packer_cfg);
|
|
@@ -2118,7 +2121,8 @@ static int cam_tfe_bus_update_wm(void *priv, void *cmd_args,
|
|
|
|
|
|
wm_data = tfe_out_data->wm_res[i]->res_priv;
|
|
|
/* update width register */
|
|
|
- val = ((wm_data->height << 16) | (wm_data->width & 0xFFFF));
|
|
|
+ val = ((wm_data->height << wm_data->common_data->height_shift) |
|
|
|
+ (wm_data->width & 0xFFFF));
|
|
|
CAM_TFE_ADD_REG_VAL_PAIR(reg_val_pair, j,
|
|
|
wm_data->hw_regs->image_cfg_0, val);
|
|
|
CAM_DBG(CAM_ISP, "WM:%d image height and width 0x%x",
|
|
@@ -2728,6 +2732,8 @@ int cam_tfe_bus_init(
|
|
|
bus_priv->common_data.max_bw_counter_limit = hw_info->max_bw_counter_limit;
|
|
|
bus_priv->common_data.counter_limit_shift = hw_info->counter_limit_shift;
|
|
|
bus_priv->common_data.counter_limit_mask = hw_info->counter_limit_mask;
|
|
|
+ bus_priv->common_data.en_cfg_shift = hw_info->en_cfg_shift;
|
|
|
+ bus_priv->common_data.height_shift = hw_info->height_shift;
|
|
|
|
|
|
for (i = 0; i < CAM_TFE_BUS_IRQ_REGISTERS_MAX; i++)
|
|
|
bus_priv->bus_irq_error_mask[i] =
|