Revert "fix: propagate error createInternalHandle wddm"

This reverts commit eeddd779f0.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
This commit is contained in:
Compute-Runtime-Validation 2025-05-16 02:04:44 +02:00 committed by Compute-Runtime-Automation
parent 05dbbcab6c
commit 0a096f1d50
5 changed files with 7 additions and 7 deletions

View File

@ -770,7 +770,7 @@ ze_result_t ContextImp::getIpcMemHandlesImpl(const void *ptr,
for (uint32_t i = 0u; i < loopCount; i++) {
uint64_t handle = 0;
int ret = alloc->createInternalHandle(memoryManager, i, handle);
if (ret != 0) {
if (ret < 0) {
return ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY;
}

View File

@ -16,12 +16,12 @@ int WddmAllocation::createInternalHandle(MemoryManager *memoryManager, uint32_t
WddmMemoryManager *wddmMemoryManager = reinterpret_cast<WddmMemoryManager *>(memoryManager);
auto status = wddmMemoryManager->createInternalNTHandle(&resourceHandle, &ntSharedHandle, this->getRootDeviceIndex());
if (status != STATUS_SUCCESS) {
return -1;
return handle == 0;
}
ntSecureHandle = castToUint64(ntSharedHandle);
handle = ntSecureHandle;
}
return handle == 0 ? -1 : 0;
return handle == 0;
}
void WddmAllocation::clearInternalHandle(uint32_t handleId) {
ntSecureHandle = 0u;

View File

@ -247,7 +247,7 @@ TEST(GraphicsAllocationTest, givenDefaultGraphicsAllocationWhenInternalHandleIsB
TEST(GraphicsAllocationTest, givenDefaultGraphicsAllocationWhenInternalHandleIsBeingObtainedOrCreatedThenZeroIsReturned) {
MockGraphicsAllocation graphicsAllocation;
uint64_t handle = 0;
EXPECT_EQ(0, graphicsAllocation.createInternalHandle(nullptr, 0u, handle));
graphicsAllocation.createInternalHandle(nullptr, 0u, handle);
EXPECT_EQ(0ull, handle);
graphicsAllocation.clearInternalHandle(0u);
}

View File

@ -734,7 +734,7 @@ TEST_F(WddmLinuxTest, givenAllocatedMemoryAndCloseInternalHandleWithoutAllocatio
memoryManager.freeGraphicsMemoryImpl(alloc);
}
TEST_F(WddmLinuxTest, givenAllocatedMemoryAndCreateInternalHandleFailedThenEmptyHandleReturned) {
TEST_F(WddmLinuxTest, givenAllocatedMemoryAndCreateInternalHandleFailedThenEmpyHandleReturned) {
osEnvironment->gdi->reserveGpuVirtualAddress = reserveDeviceAddressSpaceMock;
osEnvironment->gdi->createAllocation2 = createAllocation2Mock;
osEnvironment->gdi->mapGpuVirtualAddress = mapGpuVirtualAddressMock;
@ -756,7 +756,7 @@ TEST_F(WddmLinuxTest, givenAllocatedMemoryAndCreateInternalHandleFailedThenEmpty
memoryManager.closeInternalHandle(handle, 0u, alloc);
memoryManager.failCreateInternalNTHandle = true;
EXPECT_EQ(-1, alloc->createInternalHandle(&memoryManager, 0u, handle));
EXPECT_EQ(1, alloc->createInternalHandle(&memoryManager, 0u, handle));
memoryManager.freeGraphicsMemoryImpl(alloc);
}

View File

@ -397,7 +397,7 @@ TEST_F(WddmMemoryManagerAllocPathTests, GivenValidAllocationWithFailingCreateInt
memoryManager->closeInternalHandle(handle, 0u, graphicsAllocation);
memoryManager->failCreateInternalNTHandle = true;
EXPECT_EQ(-1, graphicsAllocation->createInternalHandle(memoryManager, 0u, handle));
EXPECT_EQ(1, graphicsAllocation->createInternalHandle(memoryManager, 0u, handle));
memoryManager->freeGraphicsMemory(graphicsAllocation);
}