[COMMON] fimc-is2: Update tag_data only for sensor group
authorSanghoon Lee <shoon114.lee@samsung.com>
Fri, 25 Jan 2019 09:37:27 +0000 (18:37 +0900)
committerlingsen1 <lingsen1@lenovo.com>
Mon, 10 Jun 2019 03:24:53 +0000 (11:24 +0800)
To update sensor tagGing data through device manager's shot callback,
current group must be connected to sensor group with OTF path.
Because sensor tagGing data is being stored in global variable,
which is Defenderined in devicemgr structure,
the others should not update it to prevent the data overwriting.

PR JIRA ID: CPR-625

CRs-fixed: (CR)

Change-Id: Ib6f67e23216a62fbf33f402fd6d082d9427713ac
Signed-off-by: Sanghoon Lee <shoon114.lee@samsung.com>
Reviewed-on: https://gerrit.mot.com/1329482
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Dawei Wang <wangdw10@motorola.com>
Reviewed-by: Zhichao Chen <chenzc2@motorola.com>
Submit-Approved: Jira

drivers/media/platform/exynos/fimc-is2/fimc-is-devicemgr.c

index 1a00e2e50de0c047faa0f65e6f4bf85963172c31..a56e088e63c39d99c73ee7ecdadfcae8fef4c42a 100644 (file)
@@ -461,6 +461,11 @@ int fimc_is_devicemgr_shot_callback(struct fimc_is_group *group,
 
                break;
        case FIMC_IS_DEVICE_ISCHAIN:
+               /* Only for sensor group with OTF */
+               if (group->head->device_type != FIMC_IS_DEVICE_SENSOR ||
+                       frame->type != SHOT_TYPE_EXTERNAL)
+                       break;
+
                devicemgr = group->device->devicemgr;
                stream = group->instance;
                index = devicemgr->tasklet_index[stream]++ % TAG_DATA_MAX;
@@ -471,16 +476,14 @@ int fimc_is_devicemgr_shot_callback(struct fimc_is_group *group,
                tag_data->group = &devicemgr->sensor[stream]->group_sensor;
                tag_data->stream = stream;
 
-               /* OTF */
-               if (frame->type == SHOT_TYPE_EXTERNAL &&
-                       group->head->device_type == FIMC_IS_DEVICE_SENSOR) {
+               if (IS_ENABLED(CHAIN_USE_VC_TASKLET)) {
                        mgrdbgs(1, " DEVICE TASKLET(%d) schedule\n", group->device, group,
-                                                               frame, index);
-                       if (IS_ENABLED(CHAIN_USE_VC_TASKLET))
-                               tasklet_schedule(&devicemgr->tasklet_sensor_tag[stream][index]);
-                       else
-                               tasklet_sensor_tag((unsigned long)tag_data);
+                                       frame, index);
+                       tasklet_schedule(&devicemgr->tasklet_sensor_tag[stream][index]);
+               } else {
+                       tasklet_sensor_tag((unsigned long)tag_data);
                }
+
                break;
        default:
                mgerr("device type(%d) is invalid", group, group, group->device_type);