void fimc_is_scaler_set_h_init_phase_offset(void __iomem *base_addr, u32 output_id, u32 h_offset);
void fimc_is_scaler_set_v_init_phase_offset(void __iomem *base_addr, u32 output_id, u32 v_offset);
void fimc_is_scaler_set_poly_scaler_coef(void __iomem *base_addr, u32 output_id,
- u32 hratio, u32 vratio, enum exynos_sensor_position sensor_position);
+ u32 hratio, u32 vratio, struct scaler_coef_cfg *sc_coef,
+ enum exynos_sensor_position sensor_position);
void fimc_is_scaler_set_poly_round_mode(void __iomem *base_addr, u32 output_id, u32 mode);
void fimc_is_scaler_set_post_scaler_enable(void __iomem *base_addr, u32 output_id, u32 enable);
void fimc_is_scaler_set_post_dst_size(void __iomem *base_addr, u32 output_id, u32 width, u32 height);
void fimc_is_scaler_get_post_dst_size(void __iomem *base_addr, u32 output_id, u32 *width, u32 *height);
void fimc_is_scaler_set_post_scaling_ratio(void __iomem *base_addr, u32 output_id, u32 hratio, u32 vratio);
-void fimc_is_scaler_set_post_scaler_coef(void __iomem *base_addr, u32 output_id, u32 hratio, u32 vratio);
+void fimc_is_scaler_set_post_scaler_coef(void __iomem *base_addr, u32 output_id,
+ u32 hratio, u32 vratio, struct scaler_coef_cfg *sc_coef);
void fimc_is_scaler_set_post_round_mode(void __iomem *base_addr, u32 output_id, u32 mode);
void fimc_is_scaler_set_420_conversion(void __iomem *base_addr, u32 output_id, u32 conv420_weight, u32 conv420_en);
return coef;
}
+u32 get_scaler_coef_ver2(u32 ratio, struct scaler_coef_cfg *sc_coef)
+{
+ u32 coef;
+
+ if (ratio <= RATIO_X8_8)
+ coef = sc_coef->ratio_x8_8;
+ else if (ratio > RATIO_X8_8 && ratio <= RATIO_X7_8)
+ coef = sc_coef->ratio_x7_8;
+ else if (ratio > RATIO_X7_8 && ratio <= RATIO_X6_8)
+ coef = sc_coef->ratio_x6_8;
+ else if (ratio > RATIO_X6_8 && ratio <= RATIO_X5_8)
+ coef = sc_coef->ratio_x5_8;
+ else if (ratio > RATIO_X5_8 && ratio <= RATIO_X4_8)
+ coef = sc_coef->ratio_x4_8;
+ else if (ratio > RATIO_X4_8 && ratio <= RATIO_X3_8)
+ coef = sc_coef->ratio_x3_8;
+ else if (ratio > RATIO_X3_8 && ratio <= RATIO_X2_8)
+ coef = sc_coef->ratio_x2_8;
+ else
+ coef = sc_coef->ratio_x2_8;
+
+ return coef;
+}
+
void fimc_is_scaler_set_poly_scaler_coef(void __iomem *base_addr, u32 output_id,
- u32 hratio, u32 vratio,
+ u32 hratio, u32 vratio, struct scaler_coef_cfg *sc_coef,
enum exynos_sensor_position sensor_position)
{
u32 h_coef = 0, v_coef = 0;
/* this value equals 0 - scale-down operation */
u32 h_phase_offset = 0, v_phase_offset = 0;
+#if defined(LHM_ENABLE_EVT0)
bool adjust_coef = false;
/* M/M dev team guided, x7/8 ~ x5/8 => x8/8 ~ x7/8
h_coef = get_scaler_coef_ver1(hratio, adjust_coef);
v_coef = get_scaler_coef_ver1(vratio, adjust_coef);
+#else
+ if (sc_coef) {
+ h_coef = get_scaler_coef_ver2(hratio, sc_coef);
+ v_coef = get_scaler_coef_ver2(vratio, sc_coef);
+ }
+#endif
/* scale up case */
if (hratio < RATIO_X8_8)
}
}
-void fimc_is_scaler_set_post_scaler_coef(void __iomem *base_addr, u32 output_id, u32 hratio, u32 vratio)
+void fimc_is_scaler_set_post_scaler_coef(void __iomem *base_addr, u32 output_id,
+ u32 hratio, u32 vratio, struct scaler_coef_cfg *sc_coef)
{
u32 h_coef = 0, v_coef = 0;
/* this value equals 0 - scale-down operation */
u32 h_phase_offset = 0, v_phase_offset = 0;
+#if defined(LHM_ENABLE_EVT0)
h_coef = get_scaler_coef_ver1(hratio, false);
v_coef = get_scaler_coef_ver1(vratio, false);
+#else
+ if (sc_coef) {
+ h_coef = get_scaler_coef_ver2(hratio, sc_coef);
+ v_coef = get_scaler_coef_ver2(vratio, sc_coef);
+ }
+#endif
/* scale up case */
if (hratio < RATIO_X8_8)