Commit 03385b8e authored by Sylwester Nawrocki's avatar Sylwester Nawrocki Committed by Mauro Carvalho Chehab

[media] exynos4-is: Remove meaningless test before bit setting

There is no need to check same bit before setting it, since we
always end up with a bit set. Remove some of the tests and make
set unconditional, in every place where all that needs to be done
is just setting a bit.
Signed-off-by: default avatarSylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 3530ef0a
...@@ -269,9 +269,7 @@ void __is_set_sensor(struct fimc_is *is, int fps) ...@@ -269,9 +269,7 @@ void __is_set_sensor(struct fimc_is *is, int fps)
unsigned int index = is->config_index; unsigned int index = is->config_index;
struct sensor_param *sensor; struct sensor_param *sensor;
struct isp_param *isp; struct isp_param *isp;
unsigned long *p_index;
p_index = &is->config[index].p_region_index1;
sensor = &is->config[index].sensor; sensor = &is->config[index].sensor;
isp = &is->config[index].isp; isp = &is->config[index].isp;
...@@ -286,10 +284,7 @@ void __is_set_sensor(struct fimc_is *is, int fps) ...@@ -286,10 +284,7 @@ void __is_set_sensor(struct fimc_is *is, int fps)
isp->otf_input.frametime_max = (u32)1000000 / fps; isp->otf_input.frametime_max = (u32)1000000 / fps;
} }
if (!test_bit(PARAM_SENSOR_FRAME_RATE, p_index))
fimc_is_set_param_bit(is, PARAM_SENSOR_FRAME_RATE); fimc_is_set_param_bit(is, PARAM_SENSOR_FRAME_RATE);
if (!test_bit(PARAM_ISP_OTF_INPUT, p_index))
fimc_is_set_param_bit(is, PARAM_ISP_OTF_INPUT); fimc_is_set_param_bit(is, PARAM_ISP_OTF_INPUT);
} }
...@@ -317,14 +312,12 @@ void __is_set_init_isp_aa(struct fimc_is *is) ...@@ -317,14 +312,12 @@ void __is_set_init_isp_aa(struct fimc_is *is)
void __is_set_isp_flash(struct fimc_is *is, u32 cmd, u32 redeye) void __is_set_isp_flash(struct fimc_is *is, u32 cmd, u32 redeye)
{ {
unsigned int index = is->config_index; unsigned int index = is->config_index;
struct chain_config *cfg = &is->config[index]; struct isp_param *isp = &is->config[index].isp;
struct isp_param *isp = &cfg->isp;
isp->flash.cmd = cmd; isp->flash.cmd = cmd;
isp->flash.redeye = redeye; isp->flash.redeye = redeye;
isp->flash.err = ISP_FLASH_ERROR_NONE; isp->flash.err = ISP_FLASH_ERROR_NONE;
if (!test_bit(PARAM_ISP_FLASH, &cfg->p_region_index1))
fimc_is_set_param_bit(is, PARAM_ISP_FLASH); fimc_is_set_param_bit(is, PARAM_ISP_FLASH);
} }
...@@ -332,16 +325,13 @@ void __is_set_isp_awb(struct fimc_is *is, u32 cmd, u32 val) ...@@ -332,16 +325,13 @@ void __is_set_isp_awb(struct fimc_is *is, u32 cmd, u32 val)
{ {
unsigned int index = is->config_index; unsigned int index = is->config_index;
struct isp_param *isp; struct isp_param *isp;
unsigned long *p_index;
p_index = &is->config[index].p_region_index1;
isp = &is->config[index].isp; isp = &is->config[index].isp;
isp->awb.cmd = cmd; isp->awb.cmd = cmd;
isp->awb.illumination = val; isp->awb.illumination = val;
isp->awb.err = ISP_AWB_ERROR_NONE; isp->awb.err = ISP_AWB_ERROR_NONE;
if (!test_bit(PARAM_ISP_AWB, p_index))
fimc_is_set_param_bit(is, PARAM_ISP_AWB); fimc_is_set_param_bit(is, PARAM_ISP_AWB);
} }
...@@ -349,15 +339,12 @@ void __is_set_isp_effect(struct fimc_is *is, u32 cmd) ...@@ -349,15 +339,12 @@ void __is_set_isp_effect(struct fimc_is *is, u32 cmd)
{ {
unsigned int index = is->config_index; unsigned int index = is->config_index;
struct isp_param *isp; struct isp_param *isp;
unsigned long *p_index;
p_index = &is->config[index].p_region_index1;
isp = &is->config[index].isp; isp = &is->config[index].isp;
isp->effect.cmd = cmd; isp->effect.cmd = cmd;
isp->effect.err = ISP_IMAGE_EFFECT_ERROR_NONE; isp->effect.err = ISP_IMAGE_EFFECT_ERROR_NONE;
if (!test_bit(PARAM_ISP_IMAGE_EFFECT, p_index))
fimc_is_set_param_bit(is, PARAM_ISP_IMAGE_EFFECT); fimc_is_set_param_bit(is, PARAM_ISP_IMAGE_EFFECT);
} }
...@@ -365,16 +352,13 @@ void __is_set_isp_iso(struct fimc_is *is, u32 cmd, u32 val) ...@@ -365,16 +352,13 @@ void __is_set_isp_iso(struct fimc_is *is, u32 cmd, u32 val)
{ {
unsigned int index = is->config_index; unsigned int index = is->config_index;
struct isp_param *isp; struct isp_param *isp;
unsigned long *p_index;
p_index = &is->config[index].p_region_index1;
isp = &is->config[index].isp; isp = &is->config[index].isp;
isp->iso.cmd = cmd; isp->iso.cmd = cmd;
isp->iso.value = val; isp->iso.value = val;
isp->iso.err = ISP_ISO_ERROR_NONE; isp->iso.err = ISP_ISO_ERROR_NONE;
if (!test_bit(PARAM_ISP_ISO, p_index))
fimc_is_set_param_bit(is, PARAM_ISP_ISO); fimc_is_set_param_bit(is, PARAM_ISP_ISO);
} }
...@@ -464,16 +448,13 @@ void __is_set_isp_afc(struct fimc_is *is, u32 cmd, u32 val) ...@@ -464,16 +448,13 @@ void __is_set_isp_afc(struct fimc_is *is, u32 cmd, u32 val)
{ {
unsigned int index = is->config_index; unsigned int index = is->config_index;
struct isp_param *isp; struct isp_param *isp;
unsigned long *p_index;
p_index = &is->config[index].p_region_index1;
isp = &is->config[index].isp; isp = &is->config[index].isp;
isp->afc.cmd = cmd; isp->afc.cmd = cmd;
isp->afc.manual = val; isp->afc.manual = val;
isp->afc.err = ISP_AFC_ERROR_NONE; isp->afc.err = ISP_AFC_ERROR_NONE;
if (!test_bit(PARAM_ISP_AFC, p_index))
fimc_is_set_param_bit(is, PARAM_ISP_AFC); fimc_is_set_param_bit(is, PARAM_ISP_AFC);
} }
...@@ -481,14 +462,11 @@ void __is_set_drc_control(struct fimc_is *is, u32 val) ...@@ -481,14 +462,11 @@ void __is_set_drc_control(struct fimc_is *is, u32 val)
{ {
unsigned int index = is->config_index; unsigned int index = is->config_index;
struct drc_param *drc; struct drc_param *drc;
unsigned long *p_index;
p_index = &is->config[index].p_region_index1;
drc = &is->config[index].drc; drc = &is->config[index].drc;
drc->control.bypass = val; drc->control.bypass = val;
if (!test_bit(PARAM_DRC_CONTROL, p_index))
fimc_is_set_param_bit(is, PARAM_DRC_CONTROL); fimc_is_set_param_bit(is, PARAM_DRC_CONTROL);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment