From 4541b5f27134d0f70c419c05a1d460e6090b870a Mon Sep 17 00:00:00 2001 From: Tao Jing Date: Mon, 5 Dec 2011 16:15:05 +0800 Subject: [PATCH] [PORT FROM R2] atomisp: restore default cc and ctc table BZ: 18089 the default cc and ctc table should be used when macc effect is enabled. Change-Id: I87c040e043e160dcedd50b2c32dc6d8e6cce3f9d Orig-Change-Id: Ieeafa2aea0a458683913062eaef0426eb5e462bc Signed-off-by: Tao Jing Reviewed-on: http://android.intel.com:8080/27282 Reviewed-by: buildbot Reviewed-by: Cohen, David A Reviewed-by: Gerasimow, Timo Reviewed-by: Xia, Yu Y Reviewed-by: Koski, Anttu Tested-by: Koski, Anttu Reviewed-on: http://android.intel.com:8080/29598 Reviewed-by: Lampila, KalleX Tested-by: buildbot --- drivers/media/video/atomisp/atomisp_cmd.c | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/drivers/media/video/atomisp/atomisp_cmd.c b/drivers/media/video/atomisp/atomisp_cmd.c index 4c2f0a4..5921e34 100644 --- a/drivers/media/video/atomisp/atomisp_cmd.c +++ b/drivers/media/video/atomisp/atomisp_cmd.c @@ -2157,9 +2157,9 @@ INVALID_PARM: */ int atomisp_color_effect(struct atomisp_device *isp, int flag, __s32 *effect) { - const struct sh_css_cc_config *cc_config = NULL; - const struct sh_css_macc_table *macc_table = NULL; - const struct sh_css_ctc_table *ctc_table = NULL; + const struct sh_css_cc_config *cc_config; + const struct sh_css_macc_table *macc_table; + const struct sh_css_ctc_table *ctc_table; if (flag == 0) { *effect = isp->params.color_effect; @@ -2169,12 +2169,24 @@ int atomisp_color_effect(struct atomisp_device *isp, int flag, __s32 *effect) if (*effect == isp->params.color_effect) return 0; + /* + * restore the default cc and ctc table config: + * when change from sepia/mono to macc effect, the default + * cc and ctc table should be used. + */ + cc_config = isp->params.default_cc_config; + ctc_table = isp->params.default_ctc_table; + + /* + * set macc enable to false by default: + * when change from macc to sepia/mono, + * isp->params.macc_en should be set to false. + */ + isp->params.macc_en = false; + macc_table = isp->params.default_macc_table; + switch (*effect) { case V4L2_COLORFX_NONE: - cc_config = isp->params.default_cc_config; - macc_table = isp->params.default_macc_table; - ctc_table = isp->params.default_ctc_table; - isp->params.macc_en = false; break; case V4L2_COLORFX_SEPIA: cc_config = &sepia_cc_config; -- 2.7.4