summaryrefslogtreecommitdiff
path: root/gralloc/gr_utils.cpp
diff options
context:
space:
mode:
authorRamakant Singh <ramakant@codeaurora.org>2020-07-28 00:19:35 +0530
committerGerrit - the friendly Code Review server <code-review@localhost>2020-08-19 05:20:30 -0700
commit7540b7122a7af10ddd7b12494d1cf0e38f937174 (patch)
tree62b22d088360f91104fd511f06bf520651bed17a /gralloc/gr_utils.cpp
parent3b1c8dc4013ae3d9c47933dd27a02b72ecfe3814 (diff)
Gralloc: Fix stride bytes calculation for RAW.
Change-Id: Ic2af36994c081b102e2e33f059bd694d984d3bfc
Diffstat (limited to 'gralloc/gr_utils.cpp')
-rw-r--r--gralloc/gr_utils.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/gralloc/gr_utils.cpp b/gralloc/gr_utils.cpp
index 312058ed..bfbd0402 100644
--- a/gralloc/gr_utils.cpp
+++ b/gralloc/gr_utils.cpp
@@ -658,6 +658,9 @@ int GetRawPlaneInfo(int32_t format, int32_t width, int32_t height, PlaneLayoutIn
plane_info[0].step = step;
plane_info[0].stride = width;
plane_info[0].stride_bytes = static_cast<int32_t>(alignedWidth);
+ if (format == HAL_PIXEL_FORMAT_RAW16) {
+ plane_info[0].stride_bytes = static_cast<int32_t>(alignedWidth * GetBpp(format));
+ }
plane_info[0].scanlines = height;
plane_info[0].size = size;