[COMMON] fimc-is2: Remove ring-buffer concept for sensor tag data
authorSanghoon Lee <shoon114.lee@samsung.com>
Sat, 26 Jan 2019 05:39:06 +0000 (14:39 +0900)
committerKim Gunho <gunho.kim@samsung.com>
Wed, 7 Aug 2019 12:59:57 +0000 (21:59 +0900)
Ring buffer concept for sensor tagging data was applied to avoid the
data overwriting issue.
That issue was removed now and ring buffer is not necessary anymore.

PR JIRA ID: CPR-625

Change-Id: Ia85a84261b63e97e223585ebebbd84396fcb8579
Signed-off-by: Sanghoon Lee <shoon114.lee@samsung.com>
drivers/media/platform/exynos/fimc-is2/fimc-is-devicemgr.c
drivers/media/platform/exynos/fimc-is2/fimc-is-devicemgr.h

index a56e088e63c39d99c73ee7ecdadfcae8fef4c42a..958b1c8df3391f68b230f91fc53424e6c2e12dba 100644 (file)
@@ -274,7 +274,6 @@ int fimc_is_devicemgr_start(struct fimc_is_devicemgr *devicemgr,
        struct fimc_is_group *child_group;
        struct devicemgr_sensor_tag_data *tag_data;
        u32 stream;
-       int i;
 
        switch (type) {
        case FIMC_IS_DEVICE_SENSOR:
@@ -303,11 +302,9 @@ int fimc_is_devicemgr_start(struct fimc_is_devicemgr *devicemgr,
 
                        /* Only in case of OTF case, used tasklet. */
                        if (sensor->ischain && child_group) {
-                               for (i = 0; i < TAG_DATA_MAX; i++) {
-                                       tag_data = &devicemgr->sensor_tag_data[stream][i];
-                                       tasklet_init(&devicemgr->tasklet_sensor_tag[stream][i],
-                                                       tasklet_sensor_tag, (unsigned long)tag_data);
-                               }
+                               tag_data = &devicemgr->sensor_tag_data[stream];
+                               tasklet_init(&devicemgr->tasklet_sensor_tag[stream],
+                                               tasklet_sensor_tag, (unsigned long)tag_data);
                        }
                }
                break;
@@ -331,7 +328,6 @@ int fimc_is_devicemgr_stop(struct fimc_is_devicemgr *devicemgr,
        struct fimc_is_device_sensor *sensor;
        struct fimc_is_group *child_group;
        u32 stream;
-       int i;
 
        switch (type) {
        case FIMC_IS_DEVICE_SENSOR:
@@ -343,8 +339,7 @@ int fimc_is_devicemgr_stop(struct fimc_is_devicemgr *devicemgr,
                        stream = group->instance;
 
                        if (sensor->ischain && child_group)
-                               for (i = 0; i < TAG_DATA_MAX; i++)
-                                       tasklet_kill(&devicemgr->tasklet_sensor_tag[stream][i]);
+                               tasklet_kill(&devicemgr->tasklet_sensor_tag[stream]);
                }
 
                if (!test_bit(FIMC_IS_SENSOR_STAND_ALONE, &sensor->state) && sensor->ischain) {
@@ -424,7 +419,6 @@ int fimc_is_devicemgr_shot_callback(struct fimc_is_group *group,
        struct fimc_is_devicemgr *devicemgr;
        struct devicemgr_sensor_tag_data *tag_data;
        u32 stream;
-       u32 index;
 
        switch (type) {
        case FIMC_IS_DEVICE_SENSOR:
@@ -468,18 +462,16 @@ int fimc_is_devicemgr_shot_callback(struct fimc_is_group *group,
 
                devicemgr = group->device->devicemgr;
                stream = group->instance;
-               index = devicemgr->tasklet_index[stream]++ % TAG_DATA_MAX;
 
-               tag_data = &devicemgr->sensor_tag_data[stream][index];
+               tag_data = &devicemgr->sensor_tag_data[stream];
                tag_data->fcount = fcount;
                tag_data->devicemgr = devicemgr;
                tag_data->group = &devicemgr->sensor[stream]->group_sensor;
                tag_data->stream = stream;
 
                if (IS_ENABLED(CHAIN_USE_VC_TASKLET)) {
-                       mgrdbgs(1, " DEVICE TASKLET(%d) schedule\n", group->device, group,
-                                       frame, index);
-                       tasklet_schedule(&devicemgr->tasklet_sensor_tag[stream][index]);
+                       mgrdbgs(1, " DEVICE TASKLET schedule\n", group->device, group, frame);
+                       tasklet_schedule(&devicemgr->tasklet_sensor_tag[stream]);
                } else {
                        tasklet_sensor_tag((unsigned long)tag_data);
                }
index 8e1e00bb584db4a5058c9ab06eb910424fa19b53..c1a41c2f4a113c20af89654097b072b50b3b162f 100644 (file)
@@ -17,8 +17,6 @@
 #include "fimc-is-device-ischain.h"
 #include "fimc-is-device-sensor.h"
 
-#define TAG_DATA_MAX           8
-
 #ifdef CONFIG_USE_SENSOR_GROUP
 #define GET_DEVICE_TYPE_BY_GRP(group_id)       \
        ({enum fimc_is_device_type type;        \
@@ -69,9 +67,8 @@ struct devicemgr_sensor_tag_data {
 struct fimc_is_devicemgr {
        struct fimc_is_device_sensor            *sensor[FIMC_IS_STREAM_COUNT];
        struct fimc_is_device_ischain           *ischain[FIMC_IS_STREAM_COUNT];
-       u32                                     tasklet_index[FIMC_IS_STREAM_COUNT];
-       struct tasklet_struct                   tasklet_sensor_tag[FIMC_IS_STREAM_COUNT][TAG_DATA_MAX];
-       struct devicemgr_sensor_tag_data        sensor_tag_data[FIMC_IS_STREAM_COUNT][TAG_DATA_MAX];
+       struct tasklet_struct                   tasklet_sensor_tag[FIMC_IS_STREAM_COUNT];
+       struct devicemgr_sensor_tag_data        sensor_tag_data[FIMC_IS_STREAM_COUNT];
 };
 
 struct fimc_is_group *get_ischain_leader_group(struct fimc_is_device_ischain *device);