[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)
committerKim Gunho <gunho.kim@samsung.com>
Wed, 7 Aug 2019 12:59:56 +0000 (21:59 +0900)
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 defined in devicemgr structure,
the others should not update it to prevent the data overwriting.

PR JIRA ID: CPR-625

Change-Id: Ib6f67e23216a62fbf33f402fd6d082d9427713ac
Signed-off-by: Sanghoon Lee <shoon114.lee@samsung.com>
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);