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 <[email protected]>
Signed-off-by: Wilson Sung <[email protected]>
(cherry picked from commit 1a5fb2b6156b6f546c18b8c6a2184628a7d9f88e)
Change-Id: Ic3b934f85531653a50b7611d7e2f576343d41080
diff --git a/fts.c b/fts.c
index 69dc037..9ed95a4 100644
--- a/fts.c
+++ b/fts.c
@@ -3652,7 +3652,7 @@
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 @@
/* 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 @@
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 @@
((max_x-1) - x) * max_y +
((max_y-1) - y)];
}
- data[frame_index++] = heatmap_value;
+ v4l2->frame[frame_index++] = heatmap_value;
}
}