From a15ddc6e8ed8faf2b47dd10de8c9542341207e76 Mon Sep 17 00:00:00 2001 From: Michie Yamauchi Date: Thu, 31 May 2012 06:31:06 +0200 Subject: [PATCH] atomisp: CSS/FW release from Synergy baseline of 30May2012 BZ: 28761 This release of CSS/FW addresses the following issues: - Making thresholds for rejected AWB blocks tunable Change-Id: I8b382a28825f41f8af6665f189087e32c260ebb4 Signed-off-by: Michie Yamauchi Reviewed-on: http://android.intel.com:8080/51527 Reviewed-by: Kruger, Jozef Reviewed-by: Van Immerzeel, Ronald Reviewed-by: Koski, Anttu Tested-by: Koski, Anttu Reviewed-by: buildbot Tested-by: buildbot --- drivers/media/video/atomisp/css/sh_css_defs.h | 2 +- drivers/media/video/atomisp/css/sh_css_internal.h | 5 +++++ drivers/media/video/atomisp/css/sh_css_params.c | 20 +++++++++++++++++++- drivers/media/video/atomisp/css/sh_css_types.h | 3 +++ include/linux/atomisp.h | 4 ++++ 5 files changed, 32 insertions(+), 2 deletions(-) diff --git a/drivers/media/video/atomisp/css/sh_css_defs.h b/drivers/media/video/atomisp/css/sh_css_defs.h index 90756f0..91996ae 100644 --- a/drivers/media/video/atomisp/css/sh_css_defs.h +++ b/drivers/media/video/atomisp/css/sh_css_defs.h @@ -186,7 +186,7 @@ /* As an optimization we use DMEM to store the 3A statistics for fixed * resolution primary binaries on the ASIC system (not on FPGA). */ -#define _S3ATBL_USE_DMEM(var_res) (ISP_VEC_NELEMS != 64 || !(var_res)) +#define _S3ATBL_USE_DMEM(var_res) (!(var_res)) /* ******************************************************** * Statistics for Digital Image Stabilization diff --git a/drivers/media/video/atomisp/css/sh_css_internal.h b/drivers/media/video/atomisp/css/sh_css_internal.h index 838ce41..f570255 100644 --- a/drivers/media/video/atomisp/css/sh_css_internal.h +++ b/drivers/media/video/atomisp/css/sh_css_internal.h @@ -83,6 +83,11 @@ struct sh_css_isp_params { int ae_y_coef_g; int ae_y_coef_b; + /* S3A (3A Support): AWB level gate */ + int awb_lg_high_raw; + int awb_lg_low; + int awb_lg_high; + /* S3A (3A Support): af fir coefficients */ int af_fir1[7]; int af_fir2[7]; diff --git a/drivers/media/video/atomisp/css/sh_css_params.c b/drivers/media/video/atomisp/css/sh_css_params.c index 99a06ca..8d98b6d 100644 --- a/drivers/media/video/atomisp/css/sh_css_params.c +++ b/drivers/media/video/atomisp/css/sh_css_params.c @@ -847,6 +847,9 @@ static const struct sh_css_3a_config default_3a_config = { .ae_y_coef_r = 25559, .ae_y_coef_g = 32768, .ae_y_coef_b = 7209, + .awb_lg_high_raw = 65535, + .awb_lg_low = 0, + .awb_lg_high = 65535, .af_fir1_coef = {-3344, -6104, -19143, 19143, 6104, 3344, 0}, .af_fir2_coef = {1027, 0, -9219, 16384, -9219, 1027, 0} }; @@ -855,6 +858,9 @@ static const struct sh_css_3a_config disabled_3a_config = { .ae_y_coef_r = 25559, .ae_y_coef_g = 32768, .ae_y_coef_b = 7209, + .awb_lg_high_raw = 65535, + .awb_lg_low = 0, + .awb_lg_high = 65535, .af_fir1_coef = {-6689, -12207, -32768, 32767, 12207, 6689, 0}, .af_fir2_coef = {2053, 0, -18437, 32767, -18437, 2053, 0} }; @@ -1161,7 +1167,8 @@ get_3a_stats_from_vmem(struct sh_css_3a_output *output) static void sh_css_process_3a(void) { - unsigned int i; + unsigned int i, raw_bit_depth = 10; + /* coefficients to calculate Y */ isp_parameters.ae_y_coef_r = uDIGIT_FITTING(s3a_config->ae_y_coef_r, 16, SH_CSS_AE_YCOEF_SHIFT); @@ -1170,6 +1177,17 @@ sh_css_process_3a(void) isp_parameters.ae_y_coef_b = uDIGIT_FITTING(s3a_config->ae_y_coef_b, 16, SH_CSS_AE_YCOEF_SHIFT); + /* AWB level gate */ + if (current_3a_binary) + raw_bit_depth + = current_3a_binary->in_frame_info.raw_bit_depth; + isp_parameters.awb_lg_high_raw = + uDIGIT_FITTING(s3a_config->awb_lg_high_raw, 16, raw_bit_depth); + isp_parameters.awb_lg_low = + uDIGIT_FITTING(s3a_config->awb_lg_low, 16, SH_CSS_BAYER_BITS); + isp_parameters.awb_lg_high = + uDIGIT_FITTING(s3a_config->awb_lg_high, 16, SH_CSS_BAYER_BITS); + /* af fir coefficients */ for (i = 0; i < 7; ++i) { isp_parameters.af_fir1[i] = diff --git a/drivers/media/video/atomisp/css/sh_css_types.h b/drivers/media/video/atomisp/css/sh_css_types.h index a448f36..adba691 100644 --- a/drivers/media/video/atomisp/css/sh_css_types.h +++ b/drivers/media/video/atomisp/css/sh_css_types.h @@ -672,6 +672,9 @@ struct sh_css_3a_config { u0_16 ae_y_coef_r; /* [gain] Weight of R for Y */ u0_16 ae_y_coef_g; /* [gain] Weight of G for Y */ u0_16 ae_y_coef_b; /* [gain] Weight of B for Y */ + u0_16 awb_lg_high_raw; /* [intensity] AWB level gate high for raw */ + u0_16 awb_lg_low; /* [intensity] AWB level gate low */ + u0_16 awb_lg_high; /* [intensity] AWB level gate high */ s0_15 af_fir1_coef[7]; /* [factor] AF FIR coefficients of fir1 */ s0_15 af_fir2_coef[7]; /* [factor] AF FIR coefficients of fir2 */ }; diff --git a/include/linux/atomisp.h b/include/linux/atomisp.h index edb0693..316bb46 100644 --- a/include/linux/atomisp.h +++ b/include/linux/atomisp.h @@ -129,6 +129,10 @@ struct atomisp_3a_config { unsigned int ae_y_coef_r; /* [gain] Weight of R for Y */ unsigned int ae_y_coef_g; /* [gain] Weight of G for Y */ unsigned int ae_y_coef_b; /* [gain] Weight of B for Y */ + unsigned int awb_lg_high_raw; /* [intensity] + AWB level gate high for raw */ + unsigned int awb_lg_low; /* [intensity] AWB level gate low */ + unsigned int awb_lg_high; /* [intensity] AWB level gate high */ int af_fir1_coef[7]; /* [factor] AF FIR coefficients of fir1 */ int af_fir2_coef[7]; /* [factor] AF FIR coefficients of fir2 */ }; -- 2.7.4