diff options
| author | 2021-04-30 00:18:32 +0800 | |
|---|---|---|
| committer | 2021-05-06 14:58:48 +0800 | |
| commit | ba40db5aa7906a22c0c8d74d196be186286c5a60 (patch) | |
| tree | e6a90a166d39bbd40748f0bba30ed1afc14dca77 /libs/ui/Gralloc4.cpp | |
| parent | b8e9586db0d2d2c16a5fe77c2e5802b0675afbf2 (diff) | |
libui: Add dataspace info into Gralloc4Mapper::bufferDumpHelper
Dataspace info is important to trace color transform artifacts. The
patch adds the info to make the tracing easier
Bug: 186738374
Test: dumpsys SurfaceFlinger
Change-Id: I1371c83ad1f86c8bbdbb5ad0a931dff3b0fc1985
Diffstat (limited to 'libs/ui/Gralloc4.cpp')
| -rw-r--r-- | libs/ui/Gralloc4.cpp | 10 | 
1 files changed, 9 insertions, 1 deletions
diff --git a/libs/ui/Gralloc4.cpp b/libs/ui/Gralloc4.cpp index 636fbde8d7..9dc9beb8e7 100644 --- a/libs/ui/Gralloc4.cpp +++ b/libs/ui/Gralloc4.cpp @@ -36,6 +36,7 @@ using android::hardware::graphics::common::V1_2::BufferUsage;  using android::hardware::graphics::mapper::V4_0::BufferDescriptor;  using android::hardware::graphics::mapper::V4_0::Error;  using android::hardware::graphics::mapper::V4_0::IMapper; +using AidlDataspace = ::aidl::android::hardware::graphics::common::Dataspace;  using BufferDump = android::hardware::graphics::mapper::V4_0::IMapper::BufferDump;  using MetadataDump = android::hardware::graphics::mapper::V4_0::IMapper::MetadataDump;  using MetadataType = android::hardware::graphics::mapper::V4_0::IMapper::MetadataType; @@ -597,7 +598,7 @@ status_t Gralloc4Mapper::getDataspace(buffer_handle_t bufferHandle,      if (!outDataspace) {          return BAD_VALUE;      } -    aidl::android::hardware::graphics::common::Dataspace dataspace; +    AidlDataspace dataspace;      status_t error = get(bufferHandle, gralloc4::MetadataType_Dataspace, gralloc4::decodeDataspace,                           &dataspace);      if (error) { @@ -841,6 +842,7 @@ status_t Gralloc4Mapper::bufferDumpHelper(const BufferDump& bufferDump, std::ost      uint32_t pixelFormatFourCC;      uint64_t pixelFormatModifier;      uint64_t usage; +    AidlDataspace dataspace;      uint64_t allocationSize;      uint64_t protectedContent;      ExtendableType compression; @@ -892,6 +894,11 @@ status_t Gralloc4Mapper::bufferDumpHelper(const BufferDump& bufferDump, std::ost      if (error != NO_ERROR) {          return error;      } +    error = metadataDumpHelper(bufferDump, StandardMetadataType::DATASPACE, +                               gralloc4::decodeDataspace, &dataspace); +    if (error != NO_ERROR) { +        return error; +    }      error = metadataDumpHelper(bufferDump, StandardMetadataType::ALLOCATION_SIZE,                                 gralloc4::decodeAllocationSize, &allocationSize);      if (error != NO_ERROR) { @@ -932,6 +939,7 @@ status_t Gralloc4Mapper::bufferDumpHelper(const BufferDump& bufferDump, std::ost               << "KiB, w/h:" << width << "x" << height << ", usage: 0x" << std::hex << usage               << std::dec << ", req fmt:" << static_cast<int32_t>(pixelFormatRequested)               << ", fourcc/mod:" << pixelFormatFourCC << "/" << pixelFormatModifier +             << ", dataspace: 0x" << std::hex << static_cast<uint32_t>(dataspace)               << ", compressed: ";      if (less) {  |