summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTharaga Balachandran <tbalacha@codeaurora.org>2020-07-16 22:38:53 -0400
committerGerrit - the friendly Code Review server <code-review@localhost>2020-08-18 08:11:20 -0700
commitfe4cd075a525eb65ea1d82c6bc5116dd233494f1 (patch)
treea64b96e547150ed869324554da05a6fcf94cf0d3
parente7a6d320a5d563eac697e0bb4be96e17f91a0ecf (diff)
gralloc: Consider subsampling in width and height
This change takes subsampling into account when calculating the plane width and height in samples. It fixes mapper VTS failure for case YV12SubsampleMetadata. CRs-Fixed: 2734403 Change-Id: I7f2fae72207d8fb19cede05f78b486524ed2cd49
-rw-r--r--gralloc/gr_buf_mgr.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/gralloc/gr_buf_mgr.cpp b/gralloc/gr_buf_mgr.cpp
index dd9a0297..6dcf4ad4 100644
--- a/gralloc/gr_buf_mgr.cpp
+++ b/gralloc/gr_buf_mgr.cpp
@@ -661,8 +661,8 @@ static Error getFormatLayout(private_handle_t *handle, std::vector<PlaneLayout>
plane_info[i].sampleIncrementInBits = static_cast<int64_t>(plane_layout[i].step * 8);
plane_info[i].strideInBytes = static_cast<int64_t>(plane_layout[i].stride_bytes);
plane_info[i].totalSizeInBytes = static_cast<int64_t>(plane_layout[i].size);
- plane_info[i].widthInSamples = handle->unaligned_width;
- plane_info[i].heightInSamples = handle->unaligned_height;
+ plane_info[i].widthInSamples = handle->unaligned_width >> plane_layout[i].h_subsampling;
+ plane_info[i].heightInSamples = handle->unaligned_height >> plane_layout[i].v_subsampling;
}
*out = plane_info;
return Error::NONE;