diff --git a/runtime/memory_manager/memory_manager.h b/runtime/memory_manager/memory_manager.h index 9471ccb54c..133bdaaf8b 100644 --- a/runtime/memory_manager/memory_manager.h +++ b/runtime/memory_manager/memory_manager.h @@ -137,7 +137,7 @@ class MemoryManager { GraphicsAllocation *allocateGraphicsMemoryForSVM(size_t size, bool coherent); - virtual GraphicsAllocation *createGraphicsAllocationFromSharedHandle(osHandle handle, bool requireSpecificBitness, bool reuseBO) = 0; + virtual GraphicsAllocation *createGraphicsAllocationFromSharedHandle(osHandle handle, bool requireSpecificBitness) = 0; virtual GraphicsAllocation *createGraphicsAllocationFromNTHandle(void *handle) = 0; diff --git a/runtime/memory_manager/os_agnostic_memory_manager.cpp b/runtime/memory_manager/os_agnostic_memory_manager.cpp index b345f3162c..3b74239de3 100644 --- a/runtime/memory_manager/os_agnostic_memory_manager.cpp +++ b/runtime/memory_manager/os_agnostic_memory_manager.cpp @@ -107,7 +107,7 @@ GraphicsAllocation *OsAgnosticMemoryManager::allocate32BitGraphicsMemory(size_t return memoryAllocation; } -GraphicsAllocation *OsAgnosticMemoryManager::createGraphicsAllocationFromSharedHandle(osHandle handle, bool requireSpecificBitness, bool reuseBO) { +GraphicsAllocation *OsAgnosticMemoryManager::createGraphicsAllocationFromSharedHandle(osHandle handle, bool requireSpecificBitness) { auto graphicsAllocation = new MemoryAllocation(false, reinterpret_cast(1), 1, 4096u, static_cast(handle), MemoryPool::SystemCpuInaccessible); graphicsAllocation->setSharedHandle(handle); graphicsAllocation->is32BitAllocation = requireSpecificBitness; diff --git a/runtime/memory_manager/os_agnostic_memory_manager.h b/runtime/memory_manager/os_agnostic_memory_manager.h index 70e4408e62..7cac3af544 100644 --- a/runtime/memory_manager/os_agnostic_memory_manager.h +++ b/runtime/memory_manager/os_agnostic_memory_manager.h @@ -65,7 +65,7 @@ class OsAgnosticMemoryManager : public MemoryManager { GraphicsAllocation *allocateGraphicsMemory(size_t size, size_t alignment, bool forcePin, bool uncacheable) override; GraphicsAllocation *allocateGraphicsMemory64kb(size_t size, size_t alignment, bool forcePin, bool preferRenderCompressed) override; GraphicsAllocation *allocate32BitGraphicsMemory(size_t size, const void *ptr, AllocationOrigin allocationOrigin) override; - GraphicsAllocation *createGraphicsAllocationFromSharedHandle(osHandle handle, bool requireSpecificBitness, bool reuseBO) override; + GraphicsAllocation *createGraphicsAllocationFromSharedHandle(osHandle handle, bool requireSpecificBitness) override; GraphicsAllocation *createGraphicsAllocationFromNTHandle(void *handle) override { return nullptr; } GraphicsAllocation *allocateGraphicsMemoryForImage(ImageInfo &imgInfo, Gmm *gmm) override; GraphicsAllocation *allocateGraphicsMemoryInDevicePool(const AllocationData &allocationData, AllocationStatus &status) override; diff --git a/runtime/os_interface/linux/drm_memory_manager.cpp b/runtime/os_interface/linux/drm_memory_manager.cpp index 856e7cc6f4..77aac75c17 100644 --- a/runtime/os_interface/linux/drm_memory_manager.cpp +++ b/runtime/os_interface/linux/drm_memory_manager.cpp @@ -351,12 +351,9 @@ BufferObject *DrmMemoryManager::createSharedBufferObject(int boHandle, size_t si return bo; } -GraphicsAllocation *DrmMemoryManager::createGraphicsAllocationFromSharedHandle(osHandle handle, bool requireSpecificBitness, bool reuseBO) { - std::unique_lock lock(mtx, std::defer_lock); +GraphicsAllocation *DrmMemoryManager::createGraphicsAllocationFromSharedHandle(osHandle handle, bool requireSpecificBitness) { + std::unique_lock lock(mtx); - if (reuseBO) { - lock.lock(); - } drm_prime_handle openFd = {0, 0, 0}; openFd.fd = handle; @@ -371,11 +368,7 @@ GraphicsAllocation *DrmMemoryManager::createGraphicsAllocationFromSharedHandle(o } auto boHandle = openFd.handle; - BufferObject *bo = nullptr; - - if (reuseBO) { - bo = findAndReferenceSharedBufferObject(boHandle); - } + auto bo = findAndReferenceSharedBufferObject(boHandle); if (bo == nullptr) { size_t size = lseekFunction(handle, 0, SEEK_END); @@ -385,14 +378,11 @@ GraphicsAllocation *DrmMemoryManager::createGraphicsAllocationFromSharedHandle(o return nullptr; } - if (reuseBO) { - pushSharedBufferObject(bo); - } - } - if (lock) { - lock.unlock(); + pushSharedBufferObject(bo); } + lock.unlock(); + auto drmAllocation = new DrmAllocation(bo, bo->address, bo->size, handle, MemoryPool::SystemCpuInaccessible); if (requireSpecificBitness && this->force32bitAllocations) { diff --git a/runtime/os_interface/linux/drm_memory_manager.h b/runtime/os_interface/linux/drm_memory_manager.h index b52053fdc1..ddfeb329be 100644 --- a/runtime/os_interface/linux/drm_memory_manager.h +++ b/runtime/os_interface/linux/drm_memory_manager.h @@ -52,7 +52,7 @@ class DrmMemoryManager : public MemoryManager { DrmAllocation *allocateGraphicsMemory(size_t size, const void *ptr, bool forcePin) override; GraphicsAllocation *allocateGraphicsMemoryForImage(ImageInfo &imgInfo, Gmm *gmm) override; DrmAllocation *allocate32BitGraphicsMemory(size_t size, const void *ptr, AllocationOrigin allocationOrigin) override; - GraphicsAllocation *createGraphicsAllocationFromSharedHandle(osHandle handle, bool requireSpecificBitness, bool reuseBO) override; + GraphicsAllocation *createGraphicsAllocationFromSharedHandle(osHandle handle, bool requireSpecificBitness) override; GraphicsAllocation *createPaddedAllocation(GraphicsAllocation *inputGraphicsAllocation, size_t sizeWithPadding) override; GraphicsAllocation *createGraphicsAllocationFromNTHandle(void *handle) override { return nullptr; } void *lockResource(GraphicsAllocation *graphicsAllocation) override; diff --git a/runtime/os_interface/windows/wddm_memory_manager.cpp b/runtime/os_interface/windows/wddm_memory_manager.cpp index c41ea76908..e61c46fef8 100644 --- a/runtime/os_interface/windows/wddm_memory_manager.cpp +++ b/runtime/os_interface/windows/wddm_memory_manager.cpp @@ -240,7 +240,7 @@ GraphicsAllocation *WddmMemoryManager::createAllocationFromHandle(osHandle handl return allocation; } -GraphicsAllocation *WddmMemoryManager::createGraphicsAllocationFromSharedHandle(osHandle handle, bool requireSpecificBitness, bool /*isReused*/) { +GraphicsAllocation *WddmMemoryManager::createGraphicsAllocationFromSharedHandle(osHandle handle, bool requireSpecificBitness) { return createAllocationFromHandle(handle, requireSpecificBitness, false); } diff --git a/runtime/os_interface/windows/wddm_memory_manager.h b/runtime/os_interface/windows/wddm_memory_manager.h index ba5243bfb9..fd4b24e74f 100644 --- a/runtime/os_interface/windows/wddm_memory_manager.h +++ b/runtime/os_interface/windows/wddm_memory_manager.h @@ -53,7 +53,7 @@ class WddmMemoryManager : public MemoryManager { GraphicsAllocation *allocateGraphicsMemory(size_t size, size_t alignment, bool forcePin, bool uncacheable) override; GraphicsAllocation *allocateGraphicsMemory(size_t size, const void *ptr) override; GraphicsAllocation *allocate32BitGraphicsMemory(size_t size, const void *ptr, AllocationOrigin allocationOrigin) override; - GraphicsAllocation *createGraphicsAllocationFromSharedHandle(osHandle handle, bool requireSpecificBitness, bool reuseBO) override; + GraphicsAllocation *createGraphicsAllocationFromSharedHandle(osHandle handle, bool requireSpecificBitness) override; GraphicsAllocation *createGraphicsAllocationFromNTHandle(void *handle) override; GraphicsAllocation *allocateGraphicsMemoryForImage(ImageInfo &imgInfo, Gmm *gmm) override; GraphicsAllocation *allocateGraphicsMemoryInDevicePool(const AllocationData &allocationData, AllocationStatus &status) override; diff --git a/runtime/sharings/d3d/d3d_buffer.h b/runtime/sharings/d3d/d3d_buffer.h index 40b5831d7a..7252ee677a 100644 --- a/runtime/sharings/d3d/d3d_buffer.h +++ b/runtime/sharings/d3d/d3d_buffer.h @@ -53,7 +53,7 @@ class D3DBuffer : public D3DSharing { } sharingFcns->getSharedHandle(bufferStaging, &sharedHandle); - auto alloc = context->getMemoryManager()->createGraphicsAllocationFromSharedHandle((osHandle)((UINT_PTR)sharedHandle), true, false); + auto alloc = context->getMemoryManager()->createGraphicsAllocationFromSharedHandle((osHandle)((UINT_PTR)sharedHandle), true); auto d3dBufferObj = new D3DBuffer(context, d3dBuffer, bufferStaging, sharedResource); diff --git a/runtime/sharings/d3d/d3d_surface.cpp b/runtime/sharings/d3d/d3d_surface.cpp index 9e6069a9a5..16bd3c1fc5 100644 --- a/runtime/sharings/d3d/d3d_surface.cpp +++ b/runtime/sharings/d3d/d3d_surface.cpp @@ -91,7 +91,8 @@ Image *D3DSurface::create(Context *context, cl_dx9_surface_info_khr *surfaceInfo GraphicsAllocation *alloc = nullptr; if (surfaceInfo->shared_handle) { isSharedResource = true; - alloc = context->getMemoryManager()->createGraphicsAllocationFromSharedHandle((osHandle)((UINT_PTR)surfaceInfo->shared_handle), false, false); + alloc = context->getMemoryManager()->createGraphicsAllocationFromSharedHandle((osHandle)((UINT_PTR)surfaceInfo->shared_handle), + false); updateImgInfo(alloc->gmm, imgInfo, imgDesc, oclPlane, 0u); } else { lockable = !(surfaceDesc.Usage & D3DResourceFlags::USAGE_RENDERTARGET) || oclPlane != OCLPlane::NO_PLANE; diff --git a/runtime/sharings/d3d/d3d_texture.cpp b/runtime/sharings/d3d/d3d_texture.cpp index 9ed1127081..6d54f257c9 100644 --- a/runtime/sharings/d3d/d3d_texture.cpp +++ b/runtime/sharings/d3d/d3d_texture.cpp @@ -82,7 +82,7 @@ Image *D3DTexture::create2d(Context *context, D3DTexture2d *d3dTexture, cl_ alloc = context->getMemoryManager()->createGraphicsAllocationFromNTHandle(sharedHandle); } else { sharingFcns->getSharedHandle(textureStaging, &sharedHandle); - alloc = context->getMemoryManager()->createGraphicsAllocationFromSharedHandle((osHandle)((UINT_PTR)sharedHandle), false, false); + alloc = context->getMemoryManager()->createGraphicsAllocationFromSharedHandle((osHandle)((UINT_PTR)sharedHandle), false); } DEBUG_BREAK_IF(!alloc); @@ -139,7 +139,7 @@ Image *D3DTexture::create3d(Context *context, D3DTexture3d *d3dTexture, cl_ alloc = context->getMemoryManager()->createGraphicsAllocationFromNTHandle(sharedHandle); } else { sharingFcns->getSharedHandle(textureStaging, &sharedHandle); - alloc = context->getMemoryManager()->createGraphicsAllocationFromSharedHandle((osHandle)((UINT_PTR)sharedHandle), false, false); + alloc = context->getMemoryManager()->createGraphicsAllocationFromSharedHandle((osHandle)((UINT_PTR)sharedHandle), false); } DEBUG_BREAK_IF(!alloc); diff --git a/runtime/sharings/va/va_surface.cpp b/runtime/sharings/va/va_surface.cpp index b83da48dec..cb7e9d6e72 100644 --- a/runtime/sharings/va/va_surface.cpp +++ b/runtime/sharings/va/va_surface.cpp @@ -72,7 +72,7 @@ Image *VASurface::createSharedVaSurface(Context *context, VASharingFunctions *sh sharingFunctions->extGetSurfaceHandle(surface, &sharedHandle); - auto alloc = memoryManager->createGraphicsAllocationFromSharedHandle(sharedHandle, false, true); + auto alloc = memoryManager->createGraphicsAllocationFromSharedHandle(sharedHandle, false); Gmm *gmm = new Gmm(imgInfo); DEBUG_BREAK_IF(alloc->gmm != nullptr); diff --git a/unit_tests/d3d_sharing/d3d9_tests.cpp b/unit_tests/d3d_sharing/d3d9_tests.cpp index ac08333b75..73ebf3c251 100644 --- a/unit_tests/d3d_sharing/d3d9_tests.cpp +++ b/unit_tests/d3d_sharing/d3d9_tests.cpp @@ -55,15 +55,15 @@ class D3D9Tests : public PlatformFixture, public ::testing::Test { class MockMM : public OsAgnosticMemoryManager { public: - GraphicsAllocation *createGraphicsAllocationFromSharedHandle(osHandle handle, bool requireSpecificBitness, bool /*reuseBO*/) override { - auto alloc = OsAgnosticMemoryManager::createGraphicsAllocationFromSharedHandle(handle, requireSpecificBitness, false); + GraphicsAllocation *createGraphicsAllocationFromSharedHandle(osHandle handle, bool requireSpecificBitness) override { + auto alloc = OsAgnosticMemoryManager::createGraphicsAllocationFromSharedHandle(handle, requireSpecificBitness); alloc->gmm = forceGmm; gmmOwnershipPassed = true; return alloc; } GraphicsAllocation *allocateGraphicsMemoryForImage(ImageInfo &imginfo, Gmm *gmm) override { delete gmm; - auto alloc = OsAgnosticMemoryManager::createGraphicsAllocationFromSharedHandle(1, false, false); + auto alloc = OsAgnosticMemoryManager::createGraphicsAllocationFromSharedHandle(1, false); alloc->gmm = forceGmm; gmmOwnershipPassed = true; return alloc; diff --git a/unit_tests/d3d_sharing/d3d_tests.cpp b/unit_tests/d3d_sharing/d3d_tests.cpp index 6da9fca372..9a44cad0b7 100644 --- a/unit_tests/d3d_sharing/d3d_tests.cpp +++ b/unit_tests/d3d_sharing/d3d_tests.cpp @@ -71,14 +71,14 @@ class D3DTests : public PlatformFixture, public ::testing::Test { class MockMM : public OsAgnosticMemoryManager { public: - GraphicsAllocation *createGraphicsAllocationFromSharedHandle(osHandle handle, bool requireSpecificBitness, bool /*reuseBO*/) override { - auto alloc = OsAgnosticMemoryManager::createGraphicsAllocationFromSharedHandle(handle, requireSpecificBitness, false); + GraphicsAllocation *createGraphicsAllocationFromSharedHandle(osHandle handle, bool requireSpecificBitness) override { + auto alloc = OsAgnosticMemoryManager::createGraphicsAllocationFromSharedHandle(handle, requireSpecificBitness); alloc->gmm = forceGmm; gmmOwnershipPassed = true; return alloc; } GraphicsAllocation *createGraphicsAllocationFromNTHandle(void *handle) override { - auto alloc = OsAgnosticMemoryManager::createGraphicsAllocationFromSharedHandle((osHandle)((UINT_PTR)handle), false, false); + auto alloc = OsAgnosticMemoryManager::createGraphicsAllocationFromSharedHandle((osHandle)((UINT_PTR)handle), false); alloc->gmm = forceGmm; gmmOwnershipPassed = true; return alloc; diff --git a/unit_tests/memory_manager/memory_manager_tests.cpp b/unit_tests/memory_manager/memory_manager_tests.cpp index 525d5beb45..f0048b8279 100644 --- a/unit_tests/memory_manager/memory_manager_tests.cpp +++ b/unit_tests/memory_manager/memory_manager_tests.cpp @@ -983,7 +983,7 @@ TEST(OsAgnosticMemoryManager, givenDefaultMemoryManagerWhenCreateGraphicsAllocat OsAgnosticMemoryManager memoryManager; osHandle handle = 1; auto size = 4096u; - auto sharedAllocation = memoryManager.createGraphicsAllocationFromSharedHandle(handle, false, false); + auto sharedAllocation = memoryManager.createGraphicsAllocationFromSharedHandle(handle, false); EXPECT_NE(nullptr, sharedAllocation); EXPECT_FALSE(sharedAllocation->isCoherent()); EXPECT_NE(nullptr, sharedAllocation->getUnderlyingBuffer()); diff --git a/unit_tests/mocks/mock_device.h b/unit_tests/mocks/mock_device.h index b32fa634d0..11e2041c7b 100644 --- a/unit_tests/mocks/mock_device.h +++ b/unit_tests/mocks/mock_device.h @@ -168,7 +168,7 @@ class FailMemoryManager : public MockMemoryManager { GraphicsAllocation *allocate32BitGraphicsMemory(size_t size, const void *ptr, AllocationOrigin allocationOrigin) override { return nullptr; }; - GraphicsAllocation *createGraphicsAllocationFromSharedHandle(osHandle handle, bool requireSpecificBitness, bool reuseBO) override { + GraphicsAllocation *createGraphicsAllocationFromSharedHandle(osHandle handle, bool requireSpecificBitness) override { return nullptr; }; GraphicsAllocation *createGraphicsAllocationFromNTHandle(void *handle) override { diff --git a/unit_tests/mt_tests/os_interface/linux/drm_memory_manager_mt_tests.cpp b/unit_tests/mt_tests/os_interface/linux/drm_memory_manager_mt_tests.cpp index ca16443dc4..f3f337f15f 100644 --- a/unit_tests/mt_tests/os_interface/linux/drm_memory_manager_mt_tests.cpp +++ b/unit_tests/mt_tests/os_interface/linux/drm_memory_manager_mt_tests.cpp @@ -58,7 +58,7 @@ TEST(DrmMemoryManagerTest, givenDrmMemoryManagerWhenSharedAllocationIsCreatedFro auto createFunction = [&]() { size_t indexFree = index++; - createdAllocations[indexFree] = memoryManager->createGraphicsAllocationFromSharedHandle(handle, false, true); + createdAllocations[indexFree] = memoryManager->createGraphicsAllocationFromSharedHandle(handle, false); EXPECT_NE(nullptr, createdAllocations[indexFree]); }; @@ -119,7 +119,7 @@ TEST(DrmMemoryManagerTest, givenMultipleThreadsWhenSharedAllocationIsCreatedThen auto createFunction = [&]() { size_t indexFree = index++; - createdAllocations[indexFree] = memoryManager->createGraphicsAllocationFromSharedHandle(handle, false, true); + createdAllocations[indexFree] = memoryManager->createGraphicsAllocationFromSharedHandle(handle, false); EXPECT_NE(nullptr, createdAllocations[indexFree]); this_thread::yield(); diff --git a/unit_tests/os_interface/linux/drm_memory_manager_tests.cpp b/unit_tests/os_interface/linux/drm_memory_manager_tests.cpp index c18b938f62..9b46ca7178 100644 --- a/unit_tests/os_interface/linux/drm_memory_manager_tests.cpp +++ b/unit_tests/os_interface/linux/drm_memory_manager_tests.cpp @@ -1424,7 +1424,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerAndOsHandleWhenCreateIsCalledT osHandle handle = 1u; this->mock->outputHandle = 2u; size_t size = 4096u; - auto graphicsAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(handle, false, false); + auto graphicsAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(handle, false); ASSERT_NE(nullptr, graphicsAllocation); EXPECT_NE(nullptr, graphicsAllocation->getUnderlyingBuffer()); @@ -1450,7 +1450,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerAndOsHandleWhenAllocationFails osHandle handle = 1u; InjectedFunction method = [this, &handle](size_t failureIndex) { - auto graphicsAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(handle, false, false); + auto graphicsAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(handle, false); if (nonfailingAllocation == failureIndex) { EXPECT_NE(nullptr, graphicsAllocation); memoryManager->freeGraphicsMemory(graphicsAllocation); @@ -1482,7 +1482,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerAndThreeOsHandlesWhenReuseCrea if (i == 2) this->mock->outputHandle = 3u; - graphicsAllocations[i] = memoryManager->createGraphicsAllocationFromSharedHandle(handles[i], false, true); + graphicsAllocations[i] = memoryManager->createGraphicsAllocationFromSharedHandle(handles[i], false); //Clang-tidy false positive WA if (graphicsAllocations[i] == nullptr) { ASSERT_FALSE(true); @@ -1522,7 +1522,7 @@ TEST_F(DrmMemoryManagerTest, given32BitAddressingWhenBufferFromSharedHandleAndBi memoryManager->setForce32BitAllocations(true); osHandle handle = 1u; this->mock->outputHandle = 2u; - auto graphicsAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(handle, true, false); + auto graphicsAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(handle, true); auto drmAllocation = (DrmAllocation *)graphicsAllocation; EXPECT_TRUE(graphicsAllocation->is32BitAllocation); EXPECT_EQ(1, lseekCalledCount); @@ -1540,7 +1540,7 @@ TEST_F(DrmMemoryManagerTest, given32BitAddressingWhenBufferFromSharedHandleIsCre memoryManager->setForce32BitAllocations(true); osHandle handle = 1u; this->mock->outputHandle = 2u; - auto graphicsAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(handle, false, false); + auto graphicsAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(handle, false); auto drmAllocation = (DrmAllocation *)graphicsAllocation; EXPECT_FALSE(graphicsAllocation->is32BitAllocation); EXPECT_EQ(1, lseekCalledCount); @@ -1558,7 +1558,7 @@ TEST_F(DrmMemoryManagerTest, givenNon32BitAddressingWhenBufferFromSharedHandleIs memoryManager->setForce32BitAllocations(false); osHandle handle = 1u; this->mock->outputHandle = 2u; - auto graphicsAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(handle, true, false); + auto graphicsAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(handle, true); auto drmAllocation = (DrmAllocation *)graphicsAllocation; EXPECT_FALSE(graphicsAllocation->is32BitAllocation); EXPECT_EQ(1, lseekCalledCount); @@ -1575,7 +1575,7 @@ TEST_F(DrmMemoryManagerTest, givenSharedHandleWhenAllocationIsCreatedAndIoctlPri osHandle handle = 1u; this->mock->outputHandle = 2u; - auto graphicsAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(handle, false, false); + auto graphicsAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(handle, false); EXPECT_EQ(nullptr, graphicsAllocation); memoryManager->freeGraphicsMemory(graphicsAllocation); } @@ -1814,7 +1814,7 @@ TEST_F(DrmMemoryManagerTest, givenSharedAllocationWithSmallerThenRealSizeWhenCre mock->ioctl_expected.gemClose = 1; osHandle sharedHandle = 1u; - auto graphicsAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(sharedHandle, false, false); + auto graphicsAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(sharedHandle, false); EXPECT_NE(nullptr, graphicsAllocation->getUnderlyingBuffer()); EXPECT_EQ(realSize, graphicsAllocation->getUnderlyingBufferSize()); @@ -2354,7 +2354,7 @@ TEST(DrmMemoryManager, givenMemoryManagerWith64KBPagesDisabledWhenAllocateGraphi TEST(DrmMemoryManager, givenMemoryManagerWhenCreateAllocationFromHandleIsCalledThenMemoryPoolIsSystemCpuInaccessible) { std::unique_ptr memoryManager(new (std::nothrow) TestedDrmMemoryManager(Drm::get(0), false, true)); auto osHandle = 1u; - auto allocation = memoryManager->createGraphicsAllocationFromSharedHandle(osHandle, false, false); + auto allocation = memoryManager->createGraphicsAllocationFromSharedHandle(osHandle, false); EXPECT_NE(nullptr, allocation); EXPECT_EQ(MemoryPool::SystemCpuInaccessible, allocation->getMemoryPool()); memoryManager->freeGraphicsMemory(allocation); diff --git a/unit_tests/os_interface/windows/wddm20_tests.cpp b/unit_tests/os_interface/windows/wddm20_tests.cpp index 34fa651b57..1baa17f2d3 100644 --- a/unit_tests/os_interface/windows/wddm20_tests.cpp +++ b/unit_tests/os_interface/windows/wddm20_tests.cpp @@ -414,7 +414,7 @@ TEST_F(Wddm20WithMockGdiDllTests, givenSharedHandleWhenCreateGraphicsAllocationF WddmMemoryManager mm(false, wddm); - auto graphicsAllocation = mm.createGraphicsAllocationFromSharedHandle(ALLOCATION_HANDLE, false, false); + auto graphicsAllocation = mm.createGraphicsAllocationFromSharedHandle(ALLOCATION_HANDLE, false); auto wddmAllocation = (WddmAllocation *)graphicsAllocation; ASSERT_NE(nullptr, wddmAllocation); @@ -451,7 +451,7 @@ TEST_F(Wddm20WithMockGdiDllTests, givenSharedHandleWhenCreateGraphicsAllocationF WddmMemoryManager mm(false, wddm); - auto graphicsAllocation = mm.createGraphicsAllocationFromSharedHandle(ALLOCATION_HANDLE, false, false); + auto graphicsAllocation = mm.createGraphicsAllocationFromSharedHandle(ALLOCATION_HANDLE, false); auto wddmAllocation = (WddmAllocation *)graphicsAllocation; ASSERT_NE(nullptr, wddmAllocation); diff --git a/unit_tests/os_interface/windows/wddm_memory_manager_tests.cpp b/unit_tests/os_interface/windows/wddm_memory_manager_tests.cpp index 607d4850d1..a35dcec8cd 100644 --- a/unit_tests/os_interface/windows/wddm_memory_manager_tests.cpp +++ b/unit_tests/os_interface/windows/wddm_memory_manager_tests.cpp @@ -180,7 +180,7 @@ TEST_F(WddmMemoryManagerSimpleTest, givenMemoryManagerWhenCreateAllocationFromHa gdi->getOpenResourceArgOut().pOpenAllocationInfo = &allocationInfo; - auto allocation = memoryManager->createGraphicsAllocationFromSharedHandle(osHandle, false, false); + auto allocation = memoryManager->createGraphicsAllocationFromSharedHandle(osHandle, false); EXPECT_NE(nullptr, allocation); EXPECT_EQ(MemoryPool::SystemCpuInaccessible, allocation->getMemoryPool()); memoryManager->freeGraphicsMemory(allocation); @@ -267,7 +267,7 @@ TEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWhenCreateFromSharedHandleIs std::unique_ptr gmm(new Gmm(pSysMem, 4096u, false)); auto status = setSizesFcn(gmm->gmmResourceInfo.get(), 1u, 1024u, 1u); - auto *gpuAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(osHandle, false, false); + auto *gpuAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(osHandle, false); auto wddmAlloc = static_cast(gpuAllocation); ASSERT_NE(nullptr, gpuAllocation); EXPECT_EQ(RESOURCE_HANDLE, wddmAlloc->resourceHandle); @@ -317,7 +317,7 @@ TEST_F(WddmMemoryManagerTest, createAllocationFromSharedHandleReturns32BitAllocW memoryManager->setForce32BitAllocations(true); - auto *gpuAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(osHandle, true, false); + auto *gpuAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(osHandle, true); ASSERT_NE(nullptr, gpuAllocation); if (is64bit) { EXPECT_TRUE(gpuAllocation->is32BitAllocation); @@ -339,7 +339,7 @@ TEST_F(WddmMemoryManagerTest, createAllocationFromSharedHandleDoesNotReturn32Bit memoryManager->setForce32BitAllocations(true); - auto *gpuAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(osHandle, false, false); + auto *gpuAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(osHandle, false); ASSERT_NE(nullptr, gpuAllocation); EXPECT_FALSE(gpuAllocation->is32BitAllocation); @@ -359,7 +359,7 @@ TEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWhenFreeAllocFromSharedHandl std::unique_ptr gmm(new Gmm(pSysMem, 4096u, false)); auto status = setSizesFcn(gmm->gmmResourceInfo.get(), 1u, 1024u, 1u); - auto gpuAllocation = (WddmAllocation *)memoryManager->createGraphicsAllocationFromSharedHandle(osHandle, false, false); + auto gpuAllocation = (WddmAllocation *)memoryManager->createGraphicsAllocationFromSharedHandle(osHandle, false); EXPECT_NE(nullptr, gpuAllocation); auto expectedDestroyHandle = gpuAllocation->resourceHandle; EXPECT_NE(0u, expectedDestroyHandle); @@ -380,7 +380,7 @@ TEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerSizeZeroWhenCreateFromShared std::unique_ptr gmm(new Gmm(pSysMem, size, false)); auto status = setSizesFcn(gmm->gmmResourceInfo.get(), 1u, 1024u, 1u); - auto *gpuAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(osHandle, false, false); + auto *gpuAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(osHandle, false); ASSERT_NE(nullptr, gpuAllocation); EXPECT_EQ(size, gpuAllocation->getUnderlyingBufferSize()); memoryManager->freeGraphicsMemory(gpuAllocation); @@ -396,7 +396,7 @@ TEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWhenCreateFromSharedHandleFa wddm->failOpenSharedHandle = true; - auto *gpuAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(osHandle, false, false); + auto *gpuAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(osHandle, false); EXPECT_EQ(nullptr, gpuAllocation); }