diff options
author | Tharaga Balachandran <tbalacha@codeaurora.org> | 2020-07-16 22:38:53 -0400 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2020-08-09 21:15:47 -0700 |
commit | e826cc1ce8095586e4219dfcd8faf5ba2860a4e2 (patch) | |
tree | d78c9405c0fc622df47c837692fdec44fc46bd3d | |
parent | 00b71c2184427165f1f23a38a6fd5f6c2458f7ed (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.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gralloc/gr_buf_mgr.cpp b/gralloc/gr_buf_mgr.cpp index f0b46395..3104a960 100644 --- a/gralloc/gr_buf_mgr.cpp +++ b/gralloc/gr_buf_mgr.cpp @@ -620,8 +620,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; |