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

Commit 6c6da4b3 authored by Jeff Tinker's avatar Jeff Tinker Committed by android-build-merger
Browse files

Merge "Unmap shared memory when no longer used" into pi-dev am: e70022cf

am: c60ca767

Change-Id: Icd7886942148b7eae17f56f6c5009ff7fba8bc77
parents 77bc2fca c60ca767
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -262,6 +262,17 @@ int32_t CryptoHal::setHeapBase(const sp<IMemoryHeap>& heap) {
void CryptoHal::clearHeapBase(int32_t seqNum) {
    Mutex::Autolock autoLock(mLock);

    /*
     * Clear the remote shared memory mapping by setting the shared
     * buffer base to a null hidl_memory.
     *
     * TODO: Add a releaseSharedBuffer method in a future DRM HAL
     * API version to make this explicit.
     */
    uint32_t bufferId = mHeapBases.valueFor(seqNum).getBufferId();
    Return<void> hResult = mPlugin->setSharedBufferBase(hidl_memory(), bufferId);
    ALOGE_IF(!hResult.isOk(), "setSharedBufferBase(): remote call failed");

    mHeapBases.removeItem(seqNum);
}