diff options
author | davidycchen <davidycchen@google.com> | 2019-11-28 13:43:04 +0800 |
---|---|---|
committer | Wilson Sung <wilsonsung@google.com> | 2020-03-17 15:03:56 +0800 |
commit | 94eda7a8ca9eebf58e0cefbf74fa705ca71ab133 (patch) | |
tree | 4966d88cd7e87b15d7965d2f2f5f650df8e6ff69 | |
parent | ea1b0d62e0797f57c814780c23c85c3b3fbed4c7 (diff) | |
download | fts_touch-94eda7a8ca9eebf58e0cefbf74fa705ca71ab133.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.
Signed-off-by: davidycchen <davidycchen@google.com>
Signed-off-by: Wilson Sung <wilsonsung@google.com>
(cherry picked from commit 1a5fb2b6156b6f546c18b8c6a2184628a7d9f88e)
Change-Id: Ic3b934f85531653a50b7611d7e2f576343d41080
-rw-r--r-- | fts.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -3652,7 +3652,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); @@ -3716,7 +3716,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 */ @@ -3738,7 +3738,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 }; @@ -3766,7 +3766,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; } } |