Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ab908705 authored by John Reck's avatar John Reck Committed by Automerger Merge Worker
Browse files

Merge "Fix USAGE_FRONT_BUFFER failure on Cuttlefish" into udc-dev am:...

Merge "Fix USAGE_FRONT_BUFFER failure on Cuttlefish" into udc-dev am: 1889c6a8 am: 3d1c934e am: 2aeec940

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/native/+/23413801



Change-Id: Iedb2c52fc719342ae2a5dc112cfe5d2f086a7db2
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 8d5340b3 2aeec940
Loading
Loading
Loading
Loading
+11 −8
Original line number Diff line number Diff line
@@ -343,14 +343,17 @@ status_t Gralloc5Mapper::validateBufferSize(buffer_handle_t bufferHandle, uint32
            return BAD_VALUE;
        }
    }
    {
        auto value = getStandardMetadata<StandardMetadataType::USAGE>(mMapper, bufferHandle);
        if (static_cast<BufferUsage>(usage) != value) {
            ALOGW("Usage didn't match, expected %" PRIu64 " got %" PRId64, usage,
                  static_cast<int64_t>(value.value_or(BufferUsage::CPU_READ_NEVER)));
            return BAD_VALUE;
        }
    }
    // TODO: This can false-positive fail if the allocator adjusted the USAGE bits internally
    //       Investigate further & re-enable or remove, but for now ignoring usage should be OK
    (void)usage;
    // {
    //     auto value = getStandardMetadata<StandardMetadataType::USAGE>(mMapper, bufferHandle);
    //     if (static_cast<BufferUsage>(usage) != value) {
    //         ALOGW("Usage didn't match, expected %" PRIu64 " got %" PRId64, usage,
    //               static_cast<int64_t>(value.value_or(BufferUsage::CPU_READ_NEVER)));
    //         return BAD_VALUE;
    //     }
    // }
    {
        auto value = getStandardMetadata<StandardMetadataType::STRIDE>(mMapper, bufferHandle);
        if (stride != value) {