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

Commit 2b36465f authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 9939584 from 49ac5525 to udc-release

Change-Id: Ia9144686c18f6302197f4677547e0276d89e245f
parents 3aa802e7 49ac5525
Loading
Loading
Loading
Loading
+7 −8
Original line number Diff line number Diff line
@@ -23,9 +23,6 @@ rust_test {
    // this cannot be the same as the module name.
    stem: "rustBinderTestClientBinary",
    test_suites: ["general-tests"],
    data: [
        ":rustBinderTestService",
    ],
}

rust_test {
@@ -39,6 +36,10 @@ rust_test {
    // this cannot be the same as the module name.
    stem: "rustBinderTestServiceBinary",
    test_harness: false,
    // TODO(b/164473602): Remove this setting and add the module to `data`
    // attribute of rustBinderTest.
    auto_gen_config: false,
    test_suites: ["general-tests"],
}

cc_test {
@@ -99,7 +100,7 @@ cc_test {
        "libbase",
    ],
    static_libs: [
        "libbinder_rs_serialization_test",
        "libbinder_rs_serialization_test"
    ],
    srcs: [
        "serialization.cpp",
@@ -115,10 +116,8 @@ rust_bindgen {
    source_stem: "bindings",
    cpp_std: "gnu++17",
    bindgen_flags: [
        "--allowlist-type",
        "Transaction",
        "--allowlist-var",
        "TESTDATA_.*",
        "--allowlist-type", "Transaction",
        "--allowlist-var", "TESTDATA_.*",
    ],

    shared_libs: [
+5 −0
Original line number Diff line number Diff line
@@ -1126,6 +1126,11 @@ static bool testSupportVsockLoopback() {

    android::base::unique_fd serverFd(
            TEMP_FAILURE_RETRY(socket(AF_VSOCK, SOCK_STREAM | SOCK_CLOEXEC | SOCK_NONBLOCK, 0)));

    if (errno == EAFNOSUPPORT) {
        return false;
    }

    LOG_ALWAYS_FATAL_IF(serverFd == -1, "Could not create socket: %s", strerror(errno));

    sockaddr_vm serverAddr{
+1 −1
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@ cc_library_headers {
    export_include_dirs: ["include"],
}

cc_library_shared {
cc_library {
    name: "libbufferqueueconverter",
    vendor_available: true,
    vndk: {
+34 −28
Original line number Diff line number Diff line
@@ -582,7 +582,8 @@ status_t BLASTBufferQueue::acquireNextBufferLocked(
    // Only update mSize for destination bounds if the incoming buffer matches the requested size.
    // Otherwise, it could cause stretching since the destination bounds will update before the
    // buffer with the new size is acquired.
    if (mRequestedSize == getBufferSize(bufferItem)) {
    if (mRequestedSize == getBufferSize(bufferItem) ||
        bufferItem.mScalingMode != NATIVE_WINDOW_SCALING_MODE_FREEZE) {
        mSize = mRequestedSize;
    }
    Rect crop = computeCrop(bufferItem);
@@ -800,34 +801,24 @@ void BLASTBufferQueue::onFrameCancelled(const uint64_t bufferId) {
    mDequeueTimestamps.erase(bufferId);
};

void BLASTBufferQueue::syncNextTransaction(
bool BLASTBufferQueue::syncNextTransaction(
        std::function<void(SurfaceComposerClient::Transaction*)> callback,
        bool acquireSingleBuffer) {
    std::function<void(SurfaceComposerClient::Transaction*)> prevCallback = nullptr;
    SurfaceComposerClient::Transaction* prevTransaction = nullptr;
    LOG_ALWAYS_FATAL_IF(!callback,
                        "BLASTBufferQueue: callback passed in to syncNextTransaction must not be "
                        "NULL");

    {
    std::lock_guard _lock{mMutex};
    BBQ_TRACE();
        // We're about to overwrite the previous call so we should invoke that callback
        // immediately.
    if (mTransactionReadyCallback) {
            prevCallback = mTransactionReadyCallback;
            prevTransaction = mSyncTransaction;
        ALOGW("Attempting to overwrite transaction callback in syncNextTransaction");
        return false;
    }

    mTransactionReadyCallback = callback;
        if (callback) {
    mSyncTransaction = new SurfaceComposerClient::Transaction();
        } else {
            mSyncTransaction = nullptr;
        }
        mAcquireSingleBuffer = mTransactionReadyCallback ? acquireSingleBuffer : true;
    }

    if (prevCallback) {
        prevCallback(prevTransaction);
    }
    mAcquireSingleBuffer = acquireSingleBuffer;
    return true;
}

void BLASTBufferQueue::stopContinuousSyncTransaction() {
@@ -835,20 +826,35 @@ void BLASTBufferQueue::stopContinuousSyncTransaction() {
    SurfaceComposerClient::Transaction* prevTransaction = nullptr;
    {
        std::lock_guard _lock{mMutex};
        bool invokeCallback = mTransactionReadyCallback && !mAcquireSingleBuffer;
        if (invokeCallback) {
        if (mAcquireSingleBuffer || !mTransactionReadyCallback) {
            ALOGW("Attempting to stop continuous sync when none are active");
            return;
        }

        prevCallback = mTransactionReadyCallback;
        prevTransaction = mSyncTransaction;
        }

        mTransactionReadyCallback = nullptr;
        mSyncTransaction = nullptr;
        mAcquireSingleBuffer = true;
    }

    if (prevCallback) {
        prevCallback(prevTransaction);
    }
}

void BLASTBufferQueue::clearSyncTransaction() {
    std::lock_guard _lock{mMutex};
    if (!mAcquireSingleBuffer) {
        ALOGW("Attempting to clear sync transaction when none are active");
        return;
    }

    mTransactionReadyCallback = nullptr;
    mSyncTransaction = nullptr;
}

bool BLASTBufferQueue::rejectBuffer(const BufferItem& item) {
    if (item.mScalingMode != NATIVE_WINDOW_SCALING_MODE_FREEZE) {
        // Only reject buffers if scaling mode is freeze.
+2 −1
Original line number Diff line number Diff line
@@ -97,9 +97,10 @@ public:
    void releaseBufferCallbackLocked(const ReleaseCallbackId& id, const sp<Fence>& releaseFence,
                                     std::optional<uint32_t> currentMaxAcquiredBufferCount,
                                     bool fakeRelease) REQUIRES(mMutex);
    void syncNextTransaction(std::function<void(SurfaceComposerClient::Transaction*)> callback,
    bool syncNextTransaction(std::function<void(SurfaceComposerClient::Transaction*)> callback,
                             bool acquireSingleBuffer = true);
    void stopContinuousSyncTransaction();
    void clearSyncTransaction();

    void mergeWithNextTransaction(SurfaceComposerClient::Transaction* t, uint64_t frameNumber);
    void applyPendingTransactions(uint64_t frameNumber);
Loading