diff options
author | Super Liu <supercjliu@google.com> | 2020-04-21 13:41:22 +0800 |
---|---|---|
committer | Super Liu <supercjliu@google.com> | 2020-04-21 15:02:25 +0800 |
commit | 3b43beaaf667bdca8598ef5ae09e876d4cb78524 (patch) | |
tree | 89b01d4c5fdc6978afc2062a89ea116936a8d639 | |
parent | 3f0fc60d93b77acafaa31f635058bbb7f8d8bb66 (diff) | |
download | sec_touch-3b43beaaf667bdca8598ef5ae09e876d4cb78524.tar.gz |
sec_touch: correct the heatmap data as big-endian for unity
Bug: 154564993
Change-Id: Id2d76e26ee1621d33cd014bde1d9034992b277ce
Signed-off-by: Super Liu <supercjliu@google.com>
-rw-r--r-- | sec_ts.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -1356,7 +1356,7 @@ static bool read_heatmap_raw(struct v4l2_heatmap *v4l2) 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 big-endian order */ + /* big-endian order raw data into heatmap data type */ be16_to_cpus(&report.data[local_i]); heatmap_value = report.data[local_i]; @@ -1456,10 +1456,11 @@ static bool read_heatmap_raw(struct v4l2_heatmap *v4l2) return false; } + /* big-endian order raw data into heatmap data type */ for (i = max_y - 1; i >= 0; i--) for (j = max_x - 1; j >= 0 ; j--) - v4l2->frame[index++] = - ts->heatmap_buff[(j * max_y) + i]; + v4l2->frame[index++] = be16_to_cpup( + ts->heatmap_buff + (j * max_y) + i); } else return false; |