mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-15 01:01:56 -04:00
Revert "(CR): milanf: modify ois vsync irq processing flow"
This reverts commit ac3ba34d7de8499bc123d3218f04464227fe8c62. The commit was causing FPS drops while using ActiveEIS on Tundra, the Ioctl calls to the OIS module were returning a timeout error. Change-Id: Ia6a68f351e44a6305a8193833302966a6e99f3e1 Reviewed-on: https://gerrit.mot.com/2511883 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Miguel Nicodemus <miguelh@motorola.com> Submit-Approved: Jira Key
This commit is contained in:
parent
7a9b63f36c
commit
e55c0873bf
2 changed files with 31 additions and 16 deletions
|
|
@ -302,13 +302,6 @@ static int cam_ois_apply_settings(struct cam_ois_ctrl_t *o_ctrl,
|
|||
else
|
||||
o_ctrl->is_video_mode = false;
|
||||
}
|
||||
if (o_ctrl->ic_name != NULL && strstr(o_ctrl->ic_name, "dw9781c")) {
|
||||
if (i2c_list->i2c_settings.reg_setting[0].reg_addr == 0x7014 &&
|
||||
i2c_list->i2c_settings.reg_setting[0].reg_data == 0x00)
|
||||
o_ctrl->is_video_mode = true;
|
||||
else
|
||||
o_ctrl->is_video_mode = false;
|
||||
}
|
||||
} else if (i2c_list->op_code == CAM_SENSOR_I2C_WRITE_SEQ) {
|
||||
rc = camera_io_dev_write_continuous(
|
||||
&(o_ctrl->io_master_info),
|
||||
|
|
@ -1248,8 +1241,6 @@ static int cam_ois_pkt_parse(struct cam_ois_ctrl_t *o_ctrl, void *arg)
|
|||
uint32_t size;
|
||||
unsigned long rem_jiffies = 0;
|
||||
|
||||
o_ctrl->is_need_eis_data = true;
|
||||
|
||||
if (o_ctrl->cam_ois_state < CAM_OIS_CONFIG) {
|
||||
rc = -EINVAL;
|
||||
CAM_WARN(CAM_OIS,
|
||||
|
|
|
|||
|
|
@ -403,6 +403,7 @@ static irqreturn_t cam_ois_vsync_irq_thread(int irq, void *data)
|
|||
struct timespec64 ts;
|
||||
uint8_t *read_buff;
|
||||
uint32_t k, read_len;
|
||||
uint32_t mode_val = 0xFFFF, enable_val = 0xFFFF;
|
||||
uint32_t data_ready = 0xFFFF;
|
||||
int i = 0;
|
||||
|
||||
|
|
@ -411,20 +412,43 @@ static irqreturn_t cam_ois_vsync_irq_thread(int irq, void *data)
|
|||
return IRQ_NONE;
|
||||
}
|
||||
|
||||
if (!mutex_trylock(&o_ctrl->vsync_mutex)) {
|
||||
CAM_ERR(CAM_OIS, "try lock fail, skip this irq");
|
||||
return IRQ_NONE;
|
||||
}
|
||||
|
||||
if (o_ctrl->cam_ois_state < CAM_OIS_CONFIG) {
|
||||
CAM_WARN(CAM_OIS, "Not in right state to read OIS: %d", o_ctrl->cam_ois_state);
|
||||
goto release_mutex;
|
||||
}
|
||||
|
||||
if(o_ctrl->is_video_mode == false ||
|
||||
o_ctrl->is_need_eis_data == false) {
|
||||
CAM_WARN(CAM_OIS, "No need to read Eis data %d %d", o_ctrl->is_video_mode, o_ctrl->is_need_eis_data);
|
||||
return IRQ_NONE;
|
||||
rc = camera_io_dev_read(
|
||||
&o_ctrl->io_master_info,
|
||||
MODE_ADDR,
|
||||
&mode_val,
|
||||
CAMERA_SENSOR_I2C_TYPE_WORD,
|
||||
CAMERA_SENSOR_I2C_TYPE_WORD);
|
||||
if (rc < 0) {
|
||||
CAM_ERR(CAM_OIS, "failed to read OIS 0x7014 reg rc: %d", rc);
|
||||
goto release_mutex;
|
||||
}
|
||||
|
||||
if (!mutex_trylock(&o_ctrl->vsync_mutex)) {
|
||||
CAM_ERR(CAM_OIS, "try lock fail, skip this irq");
|
||||
return IRQ_NONE;
|
||||
rc = camera_io_dev_read(
|
||||
&o_ctrl->io_master_info,
|
||||
ENABLE_ADDR,
|
||||
&enable_val,
|
||||
CAMERA_SENSOR_I2C_TYPE_WORD,
|
||||
CAMERA_SENSOR_I2C_TYPE_WORD);
|
||||
if (rc < 0) {
|
||||
CAM_ERR(CAM_OIS, "failed to read OIS 0x7015 reg rc: %d", rc);
|
||||
goto release_mutex;
|
||||
}
|
||||
|
||||
CAM_DBG(CAM_OIS, "mode_val = 0x%02x, enable_val = 0x%02x", mode_val, enable_val);
|
||||
|
||||
if (mode_val != 0 || enable_val != 0) {
|
||||
CAM_DBG(CAM_OIS, "ois is not in move mode, skip this irq");
|
||||
goto release_mutex;
|
||||
}
|
||||
|
||||
ktime_get_boottime_ts64(&ts);
|
||||
|
|
|
|||
Loading…
Reference in a new issue