diff options
author | Ankit Goyal <layog@google.com> | 2023-02-16 16:20:56 -0800 |
---|---|---|
committer | Ankit Goyal <layog@google.com> | 2023-02-17 18:05:37 +0000 |
commit | 370e40a3db70425e6bae5dc9c22fc4bd6e0fa3b4 (patch) | |
tree | a8e47d1ad6af1b39f4751c317ee94a8831cd1ffa /gralloc4 | |
parent | fc18d4c806f9abd4098a8af576dad68331fccd70 (diff) |
gralloc4: Warn about multifd PlaneLayout once
Bug: 237824580
Test: Boot to home
Test: Camera viewfinder, video and shot
Change-Id: I7f7dc8bb955779ac00e6e7545c54c6ba3d99b4d6
Diffstat (limited to 'gralloc4')
-rw-r--r-- | gralloc4/src/hidl_common/MapperMetadata.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/gralloc4/src/hidl_common/MapperMetadata.cpp b/gralloc4/src/hidl_common/MapperMetadata.cpp index 1123270..fb79930 100644 --- a/gralloc4/src/hidl_common/MapperMetadata.cpp +++ b/gralloc4/src/hidl_common/MapperMetadata.cpp @@ -305,11 +305,15 @@ 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; - uint8_t fd_count = get_exynos_fd_count(base_format); - if (fd_count != 1) { - MALI_GRALLOC_LOGW("Offsets in plane layouts of multi-fd format (%s %" PRIu64 - ") are not reliable. This can lead to image corruption.", - format_name(base_format), handle->alloc_format); + static bool warn_multifd = true; + if (warn_multifd) { + uint8_t fd_count = get_exynos_fd_count(base_format); + if (fd_count != 1) { + warn_multifd = false; + MALI_GRALLOC_LOGW("Offsets in plane layouts of multi-fd format (%s %" PRIu64 + ") are not reliable. This can lead to image corruption.", + format_name(base_format), handle->alloc_format); + } } PlaneLayout layout = {.offsetInBytes = offset, |