diff options
author | davidycchen <davidycchen@google.com> | 2019-11-28 13:43:04 +0800 |
---|---|---|
committer | David Chen <davidycchen@google.com> | 2019-12-13 16:25:29 +0000 |
commit | 7383848e71b9d9390f35895f88f948df53eb1acf (patch) | |
tree | a3a25e4c730aa2daf170c319c6964fd2b9074b42 | |
parent | 48391fed58614cb20c80199537ddc4f9fcc3512b (diff) | |
download | fts_touch_s5-7383848e71b9d9390f35895f88f948df53eb1acf.tar.gz |
touch:fts: modify read_heatmap_raw signature
To remove the vla(variable-length arrays) used in heatmap driver,
we modify the signature of read_heatmap_raw function.
Bug: 139783401
Test: Use v4l-heatmap-viewer.apk(provided in bug) to check touch heatmap is workable.
Change-Id: I68284417bc3ea7123434eb7d610ac5991d7dbb20
Signed-off-by: davidycchen <davidycchen@google.com>
(cherry picked from commit 1a5fb2b6156b6f546c18b8c6a2184628a7d9f88e)
-rw-r--r-- | fts.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -3674,7 +3674,7 @@ static void heatmap_enable(void) fts_write(command, ARRAY_SIZE(command)); } -static bool read_heatmap_raw(struct v4l2_heatmap *v4l2, strength_t *data) +static bool read_heatmap_raw(struct v4l2_heatmap *v4l2) { struct fts_ts_info *info = container_of(v4l2, struct fts_ts_info, v4l2); @@ -3738,7 +3738,7 @@ static bool read_heatmap_raw(struct v4l2_heatmap *v4l2, strength_t *data) /* set all to zero, will only write to non-zero locations in * the loop */ - memset(data, 0, max_x * max_y * sizeof(data[0])); + memset(v4l2->frame, 0, v4l2->format.sizeimage); /* populate the data buffer, rearranging into final locations */ for (local_i = 0; local_i < num_elements; local_i++) { /* enforce little-endian order */ @@ -3760,7 +3760,7 @@ static bool read_heatmap_raw(struct v4l2_heatmap *v4l2, strength_t *data) return false; } frame_i = heatmap_y * max_x + heatmap_x; - data[frame_i] = heatmap_value; + v4l2->frame[frame_i] = heatmap_value; } } else if (info->heatmap_mode == FTS_HEATMAP_FULL) { MutualSenseFrame ms_frame = { 0 }; @@ -3788,7 +3788,7 @@ static bool read_heatmap_raw(struct v4l2_heatmap *v4l2, strength_t *data) ((max_x-1) - x) * max_y + ((max_y-1) - y)]; } - data[frame_index++] = heatmap_value; + v4l2->frame[frame_index++] = heatmap_value; } } |