summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnkit Goyal <layog@google.com>2023-03-01 16:56:10 -0800
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-03-03 04:12:55 +0000
commit7a05a6c0f7210e0ff9de7423a11d0695bb70a722 (patch)
treee39433855e4cd4ec2f1b03e32bfc6477282f153f
parentcc2761be3c8589240ff2b7956677354b836fffca (diff)
Revert "Revert "Revert "Remove hack of offset calculation from exynos formats"""
This reverts commit 2818a8cfe88388af03c45806e1fc8074335a1aba. Bug: 269705937 Test: No display artifacts after camera shot Change-Id: If74e97dda9dad7b63ae145386b76d9d8f6d14ee4 (cherry picked from commit e2735b6fde12fd39386d897c46c796b01fce8dd3) Merged-In: If74e97dda9dad7b63ae145386b76d9d8f6d14ee4
-rw-r--r--gralloc4/src/hidl_common/MapperMetadata.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/gralloc4/src/hidl_common/MapperMetadata.cpp b/gralloc4/src/hidl_common/MapperMetadata.cpp
index 7cd4c92..cb0a820 100644
--- a/gralloc4/src/hidl_common/MapperMetadata.cpp
+++ b/gralloc4/src/hidl_common/MapperMetadata.cpp
@@ -304,6 +304,12 @@ static android::status_t get_plane_layouts(const private_handle_t *handle, std::
int64_t sample_increment_in_bits = format_info.bpp[plane_index];
int64_t offset = handle->plane_info[plane_index].offset;
+ // TODO(b/182885532): Allocate the complete buffer contiguously
+ if (handle->plane_info[plane_index].fd_idx == plane_index)
+ {
+ offset = (int64_t)handle->bases[plane_index] - handle->bases[0];
+ }
+
PlaneLayout layout = {.offsetInBytes = offset,
.sampleIncrementInBits = sample_increment_in_bits,
.strideInBytes = handle->plane_info[plane_index].byte_stride,