From 9e1c9ec95ea9fd3821c926a896a331501bf868d2 Mon Sep 17 00:00:00 2001 From: Bartosz Dunajski Date: Mon, 6 Jun 2022 17:43:28 +0000 Subject: [PATCH] Use MMAP_OFFSET ioctl to lock BufferObject Signed-off-by: Bartosz Dunajski --- ...memory_manager_localmem_upstream_tests.cpp | 12 ++-- .../linux/drm_memory_manager_tests.cpp | 54 +++++---------- .../os_interface/linux/drm_memory_manager.cpp | 69 ++++--------------- .../os_interface/linux/drm_memory_manager.h | 5 +- .../mocks/linux/mock_drm_memory_manager.h | 5 +- .../linux/device_command_stream_fixture.cpp | 2 +- ...m_memory_manager_localmem_prelim_tests.cpp | 12 ++-- 7 files changed, 49 insertions(+), 110 deletions(-) diff --git a/opencl/test/unit_test/os_interface/linux/drm_memory_manager_localmem_upstream_tests.cpp b/opencl/test/unit_test/os_interface/linux/drm_memory_manager_localmem_upstream_tests.cpp index 0029c6c4a5..c0df2150ac 100644 --- a/opencl/test/unit_test/os_interface/linux/drm_memory_manager_localmem_upstream_tests.cpp +++ b/opencl/test/unit_test/os_interface/linux/drm_memory_manager_localmem_upstream_tests.cpp @@ -605,10 +605,10 @@ HWTEST2_F(DrmMemoryManagerLocalMemoryTest, givenSupportedTypeWhenAllocatingInDev } TEST_F(DrmMemoryManagerLocalMemoryTest, givenDrmMemoryManagerWithLocalMemoryWhenLockResourceIsCalledOnNullBufferObjectThenReturnNullPtr) { - auto ptr = memoryManager->lockResourceInLocalMemoryImpl(nullptr); + auto ptr = memoryManager->lockBufferObject(nullptr); EXPECT_EQ(nullptr, ptr); - memoryManager->unlockResourceInLocalMemoryImpl(nullptr); + memoryManager->unlockBufferObject(nullptr); } TEST_F(DrmMemoryManagerLocalMemoryWithCustomMockTest, givenDrmMemoryManagerWithLocalMemoryWhenLockResourceIsCalledOnBufferObjectThenReturnPtr) { @@ -617,11 +617,11 @@ TEST_F(DrmMemoryManagerLocalMemoryWithCustomMockTest, givenDrmMemoryManagerWithL DrmAllocation drmAllocation(0, AllocationType::UNKNOWN, &bo, nullptr, 0u, 0u, MemoryPool::LocalMemory); EXPECT_EQ(&bo, drmAllocation.getBO()); - auto ptr = memoryManager->lockResourceInLocalMemoryImpl(&bo); + auto ptr = memoryManager->lockBufferObject(&bo); EXPECT_NE(nullptr, ptr); EXPECT_EQ(ptr, bo.peekLockedAddress()); - memoryManager->unlockResourceInLocalMemoryImpl(&bo); + memoryManager->unlockBufferObject(&bo); EXPECT_EQ(nullptr, bo.peekLockedAddress()); } @@ -691,14 +691,14 @@ struct DrmMemoryManagerToTestCopyMemoryToAllocation : public DrmMemoryManager { } return nullptr; } - void *lockResourceInLocalMemoryImpl(BufferObject *bo) override { + void *lockBufferObject(BufferObject *bo) override { if (lockedLocalMemorySize > 0) { lockedLocalMemory.reset(new uint8_t[lockedLocalMemorySize]); return lockedLocalMemory.get(); } return nullptr; } - void unlockResourceInLocalMemoryImpl(BufferObject *bo) override { + void unlockBufferObject(BufferObject *bo) override { } void unlockResourceImpl(GraphicsAllocation &graphicsAllocation) override { } diff --git a/opencl/test/unit_test/os_interface/linux/drm_memory_manager_tests.cpp b/opencl/test/unit_test/os_interface/linux/drm_memory_manager_tests.cpp index e7dd669aa9..1b56304226 100644 --- a/opencl/test/unit_test/os_interface/linux/drm_memory_manager_tests.cpp +++ b/opencl/test/unit_test/os_interface/linux/drm_memory_manager_tests.cpp @@ -2626,8 +2626,9 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenLockUnlockIsCalledOnAlloca TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenLockUnlockIsCalledOnAllocationWithoutCpuPtrThenReturnLockedPtrAndSetCpuDomain) { mock->ioctl_expected.gemCreate = 1; - mock->ioctl_expected.gemMmap = 1; - mock->ioctl_expected.gemSetDomain = 1; + mock->ioctl_expected.gemMmapOffset = 1; + mock->ioctl_expected.gemMmap = 0; + mock->ioctl_expected.gemSetDomain = 0; mock->ioctl_expected.gemSetTiling = 1; mock->ioctl_expected.gemWait = 1; mock->ioctl_expected.gemClose = 1; @@ -2656,17 +2657,12 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenLockUnlockIsCalledOnAlloca EXPECT_NE(nullptr, drmAllocation->getBO()->peekLockedAddress()); // check DRM_IOCTL_I915_GEM_MMAP input params - EXPECT_EQ((uint32_t)drmAllocation->getBO()->peekHandle(), mock->mmapHandle); + EXPECT_EQ((uint32_t)drmAllocation->getBO()->peekHandle(), mock->mmapOffsetHandle); EXPECT_EQ(0u, mock->mmapPad); EXPECT_EQ(0u, mock->mmapOffset); - EXPECT_EQ(drmAllocation->getBO()->peekSize(), mock->mmapSize); + EXPECT_EQ(0u, mock->mmapSize); EXPECT_EQ(0u, mock->mmapFlags); - // check DRM_IOCTL_I915_GEM_SET_DOMAIN input params - EXPECT_EQ((uint32_t)drmAllocation->getBO()->peekHandle(), mock->setDomainHandle); - EXPECT_EQ((uint32_t)I915_GEM_DOMAIN_CPU, mock->setDomainReadDomains); - EXPECT_EQ(0u, mock->setDomainWriteDomain); - memoryManager->unlockResource(allocation); EXPECT_EQ(nullptr, drmAllocation->getBO()->peekLockedAddress()); @@ -2693,15 +2689,11 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenLockUnlockIsCalledOnAlloca } TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenLockUnlockIsCalledButFailsOnIoctlMmapThenReturnNullPtr) { - mock->ioctl_expected.gemMmap = 1; + mock->ioctl_expected.gemMmapOffset = 1; this->ioctlResExt = {mock->ioctl_cnt.total, -1}; mock->ioctl_res_ext = &ioctlResExt; - DrmMockCustom drmMock(*executionEnvironment->rootDeviceEnvironments[0]); - struct BufferObjectMock : public BufferObject { - BufferObjectMock(Drm *drm) : BufferObject(drm, 3, 1, 0, 1) {} - }; - BufferObjectMock bo(&drmMock); + BufferObject bo(mock, 3, 1, 0, 1); DrmAllocation drmAllocation(rootDeviceIndex, AllocationType::UNKNOWN, &bo, nullptr, 0u, static_cast(0u), MemoryPool::MemoryNull); EXPECT_NE(nullptr, drmAllocation.getBO()); @@ -2718,7 +2710,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenUnlockResourceIsCalledOnAl DrmMemoryManagerToTestUnlockResource(ExecutionEnvironment &executionEnvironment, bool localMemoryEnabled, size_t lockableLocalMemorySize) : DrmMemoryManager(gemCloseWorkerMode::gemCloseWorkerInactive, false, false, executionEnvironment) { } - void unlockResourceInLocalMemoryImpl(BufferObject *bo) override { + void unlockBufferObject(BufferObject *bo) override { unlockResourceInLocalMemoryImplParam.bo = bo; unlockResourceInLocalMemoryImplParam.called = true; } @@ -4727,11 +4719,11 @@ TEST_F(DrmMemoryManagerTest, givenDrmManagerWithoutLocalMemoryWhenGettingGlobalM } struct DrmMemoryManagerToTestLockInLocalMemory : public TestedDrmMemoryManager { - using TestedDrmMemoryManager::lockResourceInLocalMemoryImpl; + using TestedDrmMemoryManager::lockResourceImpl; DrmMemoryManagerToTestLockInLocalMemory(ExecutionEnvironment &executionEnvironment) : TestedDrmMemoryManager(true, false, false, executionEnvironment) {} - void *lockResourceInLocalMemoryImpl(BufferObject *bo) override { + void *lockBufferObject(BufferObject *bo) override { lockedLocalMemory.reset(new uint8_t[bo->peekSize()]); return lockedLocalMemory.get(); } @@ -4745,26 +4737,12 @@ TEST_F(DrmMemoryManagerTest, givenDrmManagerWithLocalMemoryWhenLockResourceIsCal DrmAllocation drmAllocation(0, AllocationType::WRITE_COMBINED, &bo, nullptr, 0u, 0u, MemoryPool::LocalMemory); EXPECT_EQ(&bo, drmAllocation.getBO()); - auto ptr = memoryManager.lockResourceInLocalMemoryImpl(drmAllocation); + auto ptr = memoryManager.lockResourceImpl(drmAllocation); EXPECT_NE(nullptr, ptr); EXPECT_EQ(ptr, bo.peekLockedAddress()); EXPECT_TRUE(isAligned(ptr)); - memoryManager.unlockResourceInLocalMemoryImpl(&bo); - EXPECT_EQ(nullptr, bo.peekLockedAddress()); -} - -TEST_F(DrmMemoryManagerTest, givenDrmManagerWithoutLocalMemoryWhenLockResourceIsCalledOnWriteCombinedAllocationThenReturnNullptr) { - TestedDrmMemoryManager memoryManager(false, false, false, *executionEnvironment); - BufferObject bo(mock, 3, 1, 1024, 0); - - DrmAllocation drmAllocation(0, AllocationType::WRITE_COMBINED, &bo, nullptr, 0u, 0u, MemoryPool::LocalMemory); - EXPECT_EQ(&bo, drmAllocation.getBO()); - - auto ptr = memoryManager.lockResourceInLocalMemoryImpl(drmAllocation); - EXPECT_EQ(nullptr, ptr); - - memoryManager.unlockResourceInLocalMemoryImpl(&bo); + memoryManager.unlockBufferObject(&bo); EXPECT_EQ(nullptr, bo.peekLockedAddress()); } @@ -4844,10 +4822,10 @@ TEST(DrmMemoryManagerSimpleTest, givenDrmMemoryManagerWhenLockResourceIsCalledOn TestedDrmMemoryManager memoryManager(executionEnvironment); DrmAllocation drmAllocation(0, AllocationType::UNKNOWN, nullptr, nullptr, 0u, 0u, MemoryPool::LocalMemory); - auto ptr = memoryManager.lockResourceInLocalMemoryImpl(drmAllocation.getBO()); + auto ptr = memoryManager.lockBufferObject(drmAllocation.getBO()); EXPECT_EQ(nullptr, ptr); - memoryManager.unlockResourceInLocalMemoryImpl(drmAllocation.getBO()); + memoryManager.unlockBufferObject(drmAllocation.getBO()); } TEST(DrmMemoryManagerSimpleTest, givenDrmMemoryManagerWhenFreeGraphicsMemoryIsCalledOnAllocationWithNullBufferObjectThenEarlyReturn) { @@ -5677,7 +5655,7 @@ struct DrmMemoryManagerToTestCopyMemoryToAllocationBanks : public DrmMemoryManag : DrmMemoryManager(gemCloseWorkerMode::gemCloseWorkerInactive, false, false, executionEnvironment) { lockedLocalMemorySize = lockableLocalMemorySize; } - void *lockResourceInLocalMemoryImpl(BufferObject *bo) override { + void *lockBufferObject(BufferObject *bo) override { if (lockedLocalMemorySize > 0) { if (static_cast(bo->peekHandle()) < lockedLocalMemory.size()) { lockedLocalMemory[bo->peekHandle()].reset(new uint8_t[lockedLocalMemorySize]); @@ -5686,7 +5664,7 @@ struct DrmMemoryManagerToTestCopyMemoryToAllocationBanks : public DrmMemoryManag } return nullptr; } - void unlockResourceInLocalMemoryImpl(BufferObject *bo) override { + void unlockBufferObject(BufferObject *bo) override { } std::array, 4> lockedLocalMemory; size_t lockedLocalMemorySize = 0; diff --git a/shared/source/os_interface/linux/drm_memory_manager.cpp b/shared/source/os_interface/linux/drm_memory_manager.cpp index 18226e8fef..7a44844937 100644 --- a/shared/source/os_interface/linux/drm_memory_manager.cpp +++ b/shared/source/os_interface/linux/drm_memory_manager.cpp @@ -1090,10 +1090,6 @@ bool DrmMemoryManager::setDomainCpu(GraphicsAllocation &graphicsAllocation, bool } void *DrmMemoryManager::lockResourceImpl(GraphicsAllocation &graphicsAllocation) { - if (MemoryPool::LocalMemory == graphicsAllocation.getMemoryPool()) { - return lockResourceInLocalMemoryImpl(graphicsAllocation); - } - auto cpuPtr = graphicsAllocation.getUnderlyingBuffer(); if (cpuPtr != nullptr) { [[maybe_unused]] auto success = setDomainCpu(graphicsAllocation, false); @@ -1102,41 +1098,23 @@ void *DrmMemoryManager::lockResourceImpl(GraphicsAllocation &graphicsAllocation) } auto bo = static_cast(graphicsAllocation).getBO(); - if (bo == nullptr) - return nullptr; - GemMmap mmapArg = {}; - mmapArg.handle = bo->peekHandle(); - mmapArg.size = bo->peekSize(); - if (getDrm(graphicsAllocation.getRootDeviceIndex()).ioctl(DrmIoctl::GemMmap, &mmapArg) != 0) { - return nullptr; + if (graphicsAllocation.getAllocationType() == AllocationType::WRITE_COMBINED) { + auto addr = lockBufferObject(bo); + auto alignedAddr = alignUp(addr, MemoryConstants::pageSize64k); + auto notUsedSize = ptrDiff(alignedAddr, addr); + // call unmap to free the unaligned pages preceding the BO allocation and + // adjust the pointer in the CPU mapping to the beginning of the BO allocation + munmapFunction(addr, notUsedSize); + bo->setLockedAddress(alignedAddr); + return bo->peekLockedAddress(); } - bo->setLockedAddress(reinterpret_cast(mmapArg.addrPtr)); - - [[maybe_unused]] auto success = setDomainCpu(graphicsAllocation, false); - DEBUG_BREAK_IF(!success); - - return bo->peekLockedAddress(); + return lockBufferObject(bo); } void DrmMemoryManager::unlockResourceImpl(GraphicsAllocation &graphicsAllocation) { - if (MemoryPool::LocalMemory == graphicsAllocation.getMemoryPool()) { - return unlockResourceInLocalMemoryImpl(static_cast(graphicsAllocation).getBO()); - } - - auto cpuPtr = graphicsAllocation.getUnderlyingBuffer(); - if (cpuPtr != nullptr) { - return; - } - - auto bo = static_cast(graphicsAllocation).getBO(); - if (bo == nullptr) - return; - - releaseReservedCpuAddressRange(bo->peekLockedAddress(), bo->peekSize(), graphicsAllocation.getRootDeviceIndex()); - - bo->setLockedAddress(nullptr); + return unlockBufferObject(static_cast(graphicsAllocation).getBO()); } int DrmMemoryManager::obtainFdFromHandle(int boHandle, uint32_t rootDeviceindex) { @@ -1277,23 +1255,6 @@ uint64_t DrmMemoryManager::getLocalMemorySize(uint32_t rootDeviceIndex, uint32_t return size; } -void *DrmMemoryManager::lockResourceInLocalMemoryImpl(GraphicsAllocation &graphicsAllocation) { - if (!isLocalMemorySupported(graphicsAllocation.getRootDeviceIndex())) { - return nullptr; - } - auto bo = static_cast(graphicsAllocation).getBO(); - if (graphicsAllocation.getAllocationType() == AllocationType::WRITE_COMBINED) { - auto addr = lockResourceInLocalMemoryImpl(bo); - auto alignedAddr = alignUp(addr, MemoryConstants::pageSize64k); - auto notUsedSize = ptrDiff(alignedAddr, addr); - // call unmap to free the unaligned pages preceding the BO allocation and - // adjust the pointer in the CPU mapping to the beginning of the BO allocation - munmapFunction(addr, notUsedSize); - bo->setLockedAddress(alignedAddr); - return bo->peekLockedAddress(); - } - return lockResourceInLocalMemoryImpl(bo); -} bool DrmMemoryManager::copyMemoryToAllocation(GraphicsAllocation *graphicsAllocation, size_t destinationOffset, const void *memoryToCopy, size_t sizeToCopy) { if (graphicsAllocation->getUnderlyingBuffer() || !isLocalMemorySupported(graphicsAllocation->getRootDeviceIndex())) { @@ -1310,17 +1271,17 @@ bool DrmMemoryManager::copyMemoryToAllocationBanks(GraphicsAllocation *graphicsA if (!handleMask.test(handleId)) { continue; } - auto ptr = lockResourceInLocalMemoryImpl(drmAllocation->getBOs()[handleId]); + auto ptr = lockBufferObject(drmAllocation->getBOs()[handleId]); if (!ptr) { return false; } memcpy_s(ptrOffset(ptr, destinationOffset), graphicsAllocation->getUnderlyingBufferSize() - destinationOffset, memoryToCopy, sizeToCopy); - this->unlockResourceInLocalMemoryImpl(drmAllocation->getBOs()[handleId]); + this->unlockBufferObject(drmAllocation->getBOs()[handleId]); } return true; } -void DrmMemoryManager::unlockResourceInLocalMemoryImpl(BufferObject *bo) { +void DrmMemoryManager::unlockBufferObject(BufferObject *bo) { if (bo == nullptr) return; @@ -1765,7 +1726,7 @@ DrmAllocation *DrmMemoryManager::createAllocWithAlignment(const AllocationData & } } -void *DrmMemoryManager::lockResourceInLocalMemoryImpl(BufferObject *bo) { +void *DrmMemoryManager::lockBufferObject(BufferObject *bo) { if (bo == nullptr) { return nullptr; } diff --git a/shared/source/os_interface/linux/drm_memory_manager.h b/shared/source/os_interface/linux/drm_memory_manager.h index aa3dea69d1..6763c7b4da 100644 --- a/shared/source/os_interface/linux/drm_memory_manager.h +++ b/shared/source/os_interface/linux/drm_memory_manager.h @@ -117,9 +117,8 @@ class DrmMemoryManager : public MemoryManager { GraphicsAllocation *createSharedUnifiedMemoryAllocation(const AllocationData &allocationData); void *lockResourceImpl(GraphicsAllocation &graphicsAllocation) override; - void *lockResourceInLocalMemoryImpl(GraphicsAllocation &graphicsAllocation); - MOCKABLE_VIRTUAL void *lockResourceInLocalMemoryImpl(BufferObject *bo); - MOCKABLE_VIRTUAL void unlockResourceInLocalMemoryImpl(BufferObject *bo); + MOCKABLE_VIRTUAL void *lockBufferObject(BufferObject *bo); + MOCKABLE_VIRTUAL void unlockBufferObject(BufferObject *bo); void unlockResourceImpl(GraphicsAllocation &graphicsAllocation) override; DrmAllocation *allocate32BitGraphicsMemoryImpl(const AllocationData &allocationData, bool useLocalMemory) override; void cleanupBeforeReturn(const AllocationData &allocationData, GfxPartition *gfxPartition, DrmAllocation *drmAllocation, GraphicsAllocation *graphicsAllocation, uint64_t &gpuAddress, size_t &sizeAllocated); diff --git a/shared/test/common/mocks/linux/mock_drm_memory_manager.h b/shared/test/common/mocks/linux/mock_drm_memory_manager.h index 30fae56279..a3ac026d29 100644 --- a/shared/test/common/mocks/linux/mock_drm_memory_manager.h +++ b/shared/test/common/mocks/linux/mock_drm_memory_manager.h @@ -83,7 +83,8 @@ class TestedDrmMemoryManager : public MemoryManagerCreate { using DrmMemoryManager::getUserptrAlignment; using DrmMemoryManager::gfxPartitions; using DrmMemoryManager::handleFenceCompletion; - using DrmMemoryManager::lockResourceInLocalMemoryImpl; + using DrmMemoryManager::lockBufferObject; + using DrmMemoryManager::lockResourceImpl; using DrmMemoryManager::memoryForPinBBs; using DrmMemoryManager::mmapFunction; using DrmMemoryManager::munmapFunction; @@ -96,7 +97,7 @@ class TestedDrmMemoryManager : public MemoryManagerCreate { using DrmMemoryManager::setDomainCpu; using DrmMemoryManager::sharingBufferObjects; using DrmMemoryManager::supportsMultiStorageResources; - using DrmMemoryManager::unlockResourceInLocalMemoryImpl; + using DrmMemoryManager::unlockBufferObject; using DrmMemoryManager::waitOnCompletionFence; using MemoryManager::allocateGraphicsMemoryInDevicePool; using MemoryManager::heapAssigner; diff --git a/shared/test/common/os_interface/linux/device_command_stream_fixture.cpp b/shared/test/common/os_interface/linux/device_command_stream_fixture.cpp index 0f5c86502d..ac9ce859c9 100644 --- a/shared/test/common/os_interface/linux/device_command_stream_fixture.cpp +++ b/shared/test/common/os_interface/linux/device_command_stream_fixture.cpp @@ -179,7 +179,7 @@ int DrmMockCustom::ioctl(DrmIoctl request, void *arg) { } break; case DrmIoctl::GemMmapOffset: { auto mmapOffsetParams = reinterpret_cast(arg); - mmapOffsetParams->handle = mmapOffsetHandle; + mmapOffsetHandle = mmapOffsetParams->handle; mmapOffsetParams->offset = mmapOffsetExpected; mmapOffsetFlags = mmapOffsetParams->flags; ioctl_cnt.gemMmapOffset++; diff --git a/shared/test/unit_test/os_interface/linux/drm_memory_manager_localmem_prelim_tests.cpp b/shared/test/unit_test/os_interface/linux/drm_memory_manager_localmem_prelim_tests.cpp index 13fc27cc99..1144dfa8b4 100644 --- a/shared/test/unit_test/os_interface/linux/drm_memory_manager_localmem_prelim_tests.cpp +++ b/shared/test/unit_test/os_interface/linux/drm_memory_manager_localmem_prelim_tests.cpp @@ -31,11 +31,11 @@ TEST_F(DrmMemoryManagerLocalMemoryWithCustomPrelimMockTest, givenDrmMemoryManage DrmAllocation drmAllocation(0, AllocationType::UNKNOWN, &bo, nullptr, 0u, 0u, MemoryPool::LocalMemory); EXPECT_EQ(&bo, drmAllocation.getBO()); - auto ptr = memoryManager->lockResourceInLocalMemoryImpl(&bo); + auto ptr = memoryManager->lockBufferObject(&bo); EXPECT_NE(nullptr, ptr); EXPECT_EQ(ptr, bo.peekLockedAddress()); - memoryManager->unlockResourceInLocalMemoryImpl(&bo); + memoryManager->unlockBufferObject(&bo); EXPECT_EQ(nullptr, bo.peekLockedAddress()); } @@ -1223,10 +1223,10 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenSupportedTypeWhenAllocatingIn } TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenDrmMemoryManagerWithLocalMemoryWhenLockResourceIsCalledOnNullBufferObjectThenReturnNullPtr) { - auto ptr = memoryManager->lockResourceInLocalMemoryImpl(nullptr); + auto ptr = memoryManager->lockBufferObject(nullptr); EXPECT_EQ(nullptr, ptr); - memoryManager->unlockResourceInLocalMemoryImpl(nullptr); + memoryManager->unlockBufferObject(nullptr); } TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenPrintBOCreateDestroyResultFlagSetWhileCreatingBufferObjectInMemoryRegionThenDebugInformationIsPrinted) { @@ -1455,7 +1455,7 @@ struct DrmMemoryManagerToTestCopyMemoryToAllocation : public DrmMemoryManager { } return nullptr; } - void *lockResourceInLocalMemoryImpl(BufferObject *bo) override { + void *lockBufferObject(BufferObject *bo) override { if (lockedLocalMemorySize > 0) { deviceIndex = (deviceIndex < 3) ? deviceIndex + 1u : 0u; lockedLocalMemory[deviceIndex].reset(new uint8_t[lockedLocalMemorySize]); @@ -1463,7 +1463,7 @@ struct DrmMemoryManagerToTestCopyMemoryToAllocation : public DrmMemoryManager { } return nullptr; } - void unlockResourceInLocalMemoryImpl(BufferObject *bo) override { + void unlockBufferObject(BufferObject *bo) override { } void unlockResourceImpl(GraphicsAllocation &graphicsAllocation) override { }