Dont use ClDevice in DrmMemoryManager fixture
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
parent
9d56939980
commit
98bee2bfb0
|
@ -12,8 +12,6 @@
|
|||
#include "shared/source/os_interface/linux/drm_neo.h"
|
||||
#include "shared/test/common/helpers/default_hw_info.h"
|
||||
|
||||
#include "opencl/test/unit_test/helpers/gtest_helpers.h"
|
||||
|
||||
#include "drm/i915_drm.h"
|
||||
#include "engine_node.h"
|
||||
#include "gmock/gmock.h"
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
#include "opencl/source/helpers/cl_memory_properties_helpers.h"
|
||||
#include "opencl/source/mem_obj/buffer.h"
|
||||
#include "opencl/source/mem_obj/image.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_cl_device.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_context.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_platform.h"
|
||||
#include "opencl/test/unit_test/os_interface/linux/drm_mock_cache_info.h"
|
||||
|
@ -1212,14 +1213,31 @@ TEST_F(DrmMemoryManagerTest, givenMemoryManagerWhenAskedFor32BitAllocationWhenLi
|
|||
memoryManager->freeGraphicsMemory(allocation);
|
||||
}
|
||||
|
||||
TEST_F(DrmMemoryManagerTest, Given32bitAllocatorWhenAskedForBufferAllocationThen32BitBufferIsReturned) {
|
||||
struct ClDrmMemoryManagerTest : public DrmMemoryManagerTest {
|
||||
void SetUp() override {
|
||||
MemoryManagementFixture::SetUp();
|
||||
|
||||
executionEnvironment = MockClDevice::prepareExecutionEnvironment(defaultHwInfo.get(), numRootDevices - 1);
|
||||
DrmMemoryManagerFixture::SetUp(new DrmMockCustom(*executionEnvironment->rootDeviceEnvironments[0]), false);
|
||||
pClDevice = new MockClDevice{device};
|
||||
device->incRefInternal();
|
||||
}
|
||||
void TearDown() override {
|
||||
delete pClDevice;
|
||||
DrmMemoryManagerTest::TearDown();
|
||||
}
|
||||
|
||||
MockClDevice *pClDevice = nullptr;
|
||||
};
|
||||
|
||||
TEST_F(ClDrmMemoryManagerTest, Given32bitAllocatorWhenAskedForBufferAllocationThen32BitBufferIsReturned) {
|
||||
DebugManagerStateRestore dbgRestorer;
|
||||
mock->ioctl_expected.gemUserptr = 1;
|
||||
mock->ioctl_expected.gemWait = 1;
|
||||
mock->ioctl_expected.gemClose = 1;
|
||||
|
||||
DebugManager.flags.Force32bitAddressing.set(true);
|
||||
MockContext context(device);
|
||||
MockContext context(pClDevice);
|
||||
memoryManager->setForce32BitAllocations(true);
|
||||
|
||||
auto size = MemoryConstants::pageSize;
|
||||
|
@ -1242,14 +1260,14 @@ TEST_F(DrmMemoryManagerTest, Given32bitAllocatorWhenAskedForBufferAllocationThen
|
|||
delete buffer;
|
||||
}
|
||||
|
||||
TEST_F(DrmMemoryManagerTest, Given32bitAllocatorWhenAskedForBufferCreatedFromHostPtrThen32BitBufferIsReturned) {
|
||||
TEST_F(ClDrmMemoryManagerTest, Given32bitAllocatorWhenAskedForBufferCreatedFromHostPtrThen32BitBufferIsReturned) {
|
||||
DebugManagerStateRestore dbgRestorer;
|
||||
mock->ioctl_expected.gemUserptr = 1;
|
||||
mock->ioctl_expected.gemWait = 1;
|
||||
mock->ioctl_expected.gemClose = 1;
|
||||
|
||||
DebugManager.flags.Force32bitAddressing.set(true);
|
||||
MockContext context(device);
|
||||
MockContext context(pClDevice);
|
||||
memoryManager->setForce32BitAllocations(true);
|
||||
|
||||
auto size = MemoryConstants::pageSize;
|
||||
|
@ -1298,7 +1316,7 @@ TEST_F(DrmMemoryManagerTest, Given32bitAllocatorWhenAskedForBufferCreatedFromHos
|
|||
delete buffer;
|
||||
}
|
||||
|
||||
TEST_F(DrmMemoryManagerTest, Given32bitAllocatorWhenAskedForBufferCreatedFrom64BitHostPtrThen32BitBufferIsReturned) {
|
||||
TEST_F(ClDrmMemoryManagerTest, Given32bitAllocatorWhenAskedForBufferCreatedFrom64BitHostPtrThen32BitBufferIsReturned) {
|
||||
DebugManagerStateRestore dbgRestorer;
|
||||
{
|
||||
if (is32bit) {
|
||||
|
@ -1309,7 +1327,7 @@ TEST_F(DrmMemoryManagerTest, Given32bitAllocatorWhenAskedForBufferCreatedFrom64B
|
|||
mock->ioctl_expected.gemClose = 1;
|
||||
|
||||
DebugManager.flags.Force32bitAddressing.set(true);
|
||||
MockContext context(device);
|
||||
MockContext context(pClDevice);
|
||||
memoryManager->setForce32BitAllocations(true);
|
||||
|
||||
auto size = MemoryConstants::pageSize;
|
||||
|
@ -1425,11 +1443,11 @@ TEST_F(DrmMemoryManagerTest, givenLimitedRangeAllocatorWhenAskedForInternal32Bit
|
|||
mock->ioctl_res_ext = &mock->NONE;
|
||||
}
|
||||
|
||||
TEST_F(DrmMemoryManagerTest, GivenSizeAbove2GBWhenUseHostPtrAndAllocHostPtrAreCreatedThenFirstSucceedsAndSecondFails) {
|
||||
TEST_F(ClDrmMemoryManagerTest, GivenSizeAbove2GBWhenUseHostPtrAndAllocHostPtrAreCreatedThenFirstSucceedsAndSecondFails) {
|
||||
DebugManagerStateRestore dbgRestorer;
|
||||
mock->ioctl_expected.total = -1;
|
||||
DebugManager.flags.Force32bitAddressing.set(true);
|
||||
MockContext context(device);
|
||||
MockContext context(pClDevice);
|
||||
memoryManager->setForce32BitAllocations(true);
|
||||
|
||||
size_t size = 2 * GB;
|
||||
|
@ -1466,11 +1484,11 @@ TEST_F(DrmMemoryManagerTest, GivenSizeAbove2GBWhenUseHostPtrAndAllocHostPtrAreCr
|
|||
delete buffer;
|
||||
}
|
||||
|
||||
TEST_F(DrmMemoryManagerTest, GivenSizeAbove2GBWhenAllocHostPtrAndUseHostPtrAreCreatedThenFirstSucceedsAndSecondFails) {
|
||||
TEST_F(ClDrmMemoryManagerTest, GivenSizeAbove2GBWhenAllocHostPtrAndUseHostPtrAreCreatedThenFirstSucceedsAndSecondFails) {
|
||||
DebugManagerStateRestore dbgRestorer;
|
||||
mock->ioctl_expected.total = -1;
|
||||
DebugManager.flags.Force32bitAddressing.set(true);
|
||||
MockContext context(device);
|
||||
MockContext context(pClDevice);
|
||||
memoryManager->setForce32BitAllocations(true);
|
||||
|
||||
size_t size = 2 * GB;
|
||||
|
@ -1507,10 +1525,10 @@ TEST_F(DrmMemoryManagerTest, GivenSizeAbove2GBWhenAllocHostPtrAndUseHostPtrAreCr
|
|||
delete buffer;
|
||||
}
|
||||
|
||||
TEST_F(DrmMemoryManagerTest, givenDrmBufferWhenItIsQueriedForInternalAllocationThenBoIsReturned) {
|
||||
TEST_F(ClDrmMemoryManagerTest, givenDrmBufferWhenItIsQueriedForInternalAllocationThenBoIsReturned) {
|
||||
mock->ioctl_expected.total = -1;
|
||||
mock->outputFd = 1337;
|
||||
MockContext context(device);
|
||||
MockContext context(pClDevice);
|
||||
|
||||
size_t size = 1u;
|
||||
auto retVal = CL_SUCCESS;
|
||||
|
@ -1594,7 +1612,7 @@ TEST_F(DrmMemoryManagerTest, GivenMemoryManagerWhenAllocateGraphicsMemoryForImag
|
|||
memoryManager->freeGraphicsMemory(imageGraphicsAllocation);
|
||||
}
|
||||
|
||||
HWTEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenTiledImageWithMipCountZeroIsBeingCreatedThenallocateGraphicsMemoryForImageIsUsed) {
|
||||
HWTEST_F(ClDrmMemoryManagerTest, givenDrmMemoryManagerWhenTiledImageWithMipCountZeroIsBeingCreatedThenallocateGraphicsMemoryForImageIsUsed) {
|
||||
if (!UnitTestHelper<FamilyType>::tiledImagesSupported) {
|
||||
GTEST_SKIP();
|
||||
}
|
||||
|
@ -1603,7 +1621,7 @@ HWTEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenTiledImageWithMipCountZe
|
|||
mock->ioctl_expected.gemWait = 1;
|
||||
mock->ioctl_expected.gemClose = 1;
|
||||
|
||||
MockContext context(device);
|
||||
MockContext context(pClDevice);
|
||||
|
||||
cl_image_format imageFormat;
|
||||
imageFormat.image_channel_data_type = CL_UNORM_INT8;
|
||||
|
@ -1641,7 +1659,7 @@ HWTEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenTiledImageWithMipCountZe
|
|||
EXPECT_EQ(1u, this->mock->setTilingHandle);
|
||||
}
|
||||
|
||||
HWTEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenTiledImageWithMipCountNonZeroIsBeingCreatedThenallocateGraphicsMemoryForImageIsUsed) {
|
||||
HWTEST_F(ClDrmMemoryManagerTest, givenDrmMemoryManagerWhenTiledImageWithMipCountNonZeroIsBeingCreatedThenallocateGraphicsMemoryForImageIsUsed) {
|
||||
if (!UnitTestHelper<FamilyType>::tiledImagesSupported) {
|
||||
GTEST_SKIP();
|
||||
}
|
||||
|
@ -1650,7 +1668,7 @@ HWTEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenTiledImageWithMipCountNo
|
|||
mock->ioctl_expected.gemWait = 1;
|
||||
mock->ioctl_expected.gemClose = 1;
|
||||
|
||||
MockContext context(device);
|
||||
MockContext context(pClDevice);
|
||||
|
||||
cl_image_format imageFormat;
|
||||
imageFormat.image_channel_data_type = CL_UNORM_INT8;
|
||||
|
@ -1690,8 +1708,8 @@ HWTEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenTiledImageWithMipCountNo
|
|||
EXPECT_EQ(1u, this->mock->setTilingHandle);
|
||||
}
|
||||
|
||||
TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenTiledImageIsBeingCreatedAndAllocationFailsThenReturnNullptr) {
|
||||
MockContext context(device);
|
||||
TEST_F(ClDrmMemoryManagerTest, givenDrmMemoryManagerWhenTiledImageIsBeingCreatedAndAllocationFailsThenReturnNullptr) {
|
||||
MockContext context(pClDevice);
|
||||
|
||||
cl_image_format imageFormat;
|
||||
imageFormat.image_channel_data_type = CL_UNORM_INT8;
|
||||
|
@ -1722,7 +1740,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenTiledImageIsBeingCreatedAn
|
|||
mock->reset();
|
||||
}
|
||||
|
||||
HWTEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenTiledImageIsBeingCreatedFromHostPtrThenAllocateGraphicsMemoryForImageIsUsed) {
|
||||
HWTEST_F(ClDrmMemoryManagerTest, givenDrmMemoryManagerWhenTiledImageIsBeingCreatedFromHostPtrThenAllocateGraphicsMemoryForImageIsUsed) {
|
||||
if (!UnitTestHelper<FamilyType>::tiledImagesSupported) {
|
||||
GTEST_SKIP();
|
||||
}
|
||||
|
@ -1764,7 +1782,7 @@ HWTEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenTiledImageIsBeingCreated
|
|||
additionalDestroyDeviceIoctls.gemWait++;
|
||||
}
|
||||
|
||||
MockContext context(device);
|
||||
MockContext context(pClDevice);
|
||||
|
||||
cl_image_format imageFormat;
|
||||
imageFormat.image_channel_data_type = CL_UNORM_INT8;
|
||||
|
@ -1806,12 +1824,12 @@ HWTEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenTiledImageIsBeingCreated
|
|||
alignedFree(data);
|
||||
}
|
||||
|
||||
TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenMemoryAllocatedForImageThenUnmapSizeCorrectlySetWhenLimitedRangeAllocationUsedOrNotUsed) {
|
||||
TEST_F(ClDrmMemoryManagerTest, givenDrmMemoryManagerWhenMemoryAllocatedForImageThenUnmapSizeCorrectlySetWhenLimitedRangeAllocationUsedOrNotUsed) {
|
||||
mock->ioctl_expected.gemUserptr = 2;
|
||||
mock->ioctl_expected.gemWait = 2;
|
||||
mock->ioctl_expected.gemClose = 2;
|
||||
|
||||
MockContext context(device);
|
||||
MockContext context(pClDevice);
|
||||
|
||||
cl_image_format imageFormat;
|
||||
imageFormat.image_channel_data_type = CL_UNORM_INT8;
|
||||
|
@ -1839,12 +1857,12 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenMemoryAllocatedForImageThe
|
|||
alignedFree(data);
|
||||
}
|
||||
|
||||
TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenNonTiledImgWithMipCountZeroisBeingCreatedThenAllocateGraphicsMemoryIsUsed) {
|
||||
TEST_F(ClDrmMemoryManagerTest, givenDrmMemoryManagerWhenNonTiledImgWithMipCountZeroisBeingCreatedThenAllocateGraphicsMemoryIsUsed) {
|
||||
mock->ioctl_expected.gemUserptr = 2;
|
||||
mock->ioctl_expected.gemWait = 2;
|
||||
mock->ioctl_expected.gemClose = 2;
|
||||
|
||||
MockContext context(device);
|
||||
MockContext context(pClDevice);
|
||||
|
||||
cl_image_format imageFormat;
|
||||
imageFormat.image_channel_data_type = CL_UNORM_INT8;
|
||||
|
@ -1885,12 +1903,12 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenNonTiledImgWithMipCountZer
|
|||
alignedFree(data);
|
||||
}
|
||||
|
||||
TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenNonTiledImgWithMipCountNonZeroisBeingCreatedThenAllocateGraphicsMemoryIsUsed) {
|
||||
TEST_F(ClDrmMemoryManagerTest, givenDrmMemoryManagerWhenNonTiledImgWithMipCountNonZeroisBeingCreatedThenAllocateGraphicsMemoryIsUsed) {
|
||||
mock->ioctl_expected.gemUserptr = 1;
|
||||
mock->ioctl_expected.gemWait = 1;
|
||||
mock->ioctl_expected.gemClose = 1;
|
||||
|
||||
MockContext context(device);
|
||||
MockContext context(pClDevice);
|
||||
|
||||
cl_image_format imageFormat;
|
||||
imageFormat.image_channel_data_type = CL_UNORM_INT8;
|
||||
|
@ -1934,12 +1952,12 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenNonTiledImgWithMipCountNon
|
|||
alignedFree(data);
|
||||
}
|
||||
|
||||
TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhen1DarrayImageIsBeingCreatedFromHostPtrThenTilingIsNotCalled) {
|
||||
TEST_F(ClDrmMemoryManagerTest, givenDrmMemoryManagerWhen1DarrayImageIsBeingCreatedFromHostPtrThenTilingIsNotCalled) {
|
||||
mock->ioctl_expected.gemUserptr = 2;
|
||||
mock->ioctl_expected.gemWait = 2;
|
||||
mock->ioctl_expected.gemClose = 2;
|
||||
|
||||
MockContext context(device);
|
||||
MockContext context(pClDevice);
|
||||
|
||||
cl_image_format imageFormat;
|
||||
imageFormat.image_channel_data_type = CL_UNORM_INT8;
|
||||
|
@ -1976,7 +1994,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhen1DarrayImageIsBeingCreated
|
|||
alignedFree(data);
|
||||
}
|
||||
|
||||
TEST_F(DrmMemoryManagerTest, givenHostPointerNotRequiringCopyWhenAllocateGraphicsMemoryForImageIsCalledThenGraphicsAllocationIsReturned) {
|
||||
TEST_F(ClDrmMemoryManagerTest, givenHostPointerNotRequiringCopyWhenAllocateGraphicsMemoryForImageIsCalledThenGraphicsAllocationIsReturned) {
|
||||
mock->ioctl_expected.gemUserptr = 1;
|
||||
mock->ioctl_expected.gemWait = 1;
|
||||
mock->ioctl_expected.gemClose = 1;
|
||||
|
@ -1991,7 +2009,7 @@ TEST_F(DrmMemoryManagerTest, givenHostPointerNotRequiringCopyWhenAllocateGraphic
|
|||
imageFormat.image_channel_order = CL_R;
|
||||
|
||||
cl_mem_flags flags = CL_MEM_READ_WRITE | CL_MEM_USE_HOST_PTR;
|
||||
MockContext context(device);
|
||||
MockContext context(pClDevice);
|
||||
auto surfaceFormat = &Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features)->surfaceFormat;
|
||||
|
||||
auto imgInfo = MockGmm::initImgInfo(imgDesc, 0, surfaceFormat);
|
||||
|
@ -2112,7 +2130,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerAndOsHandleWhenCreateIsCalledA
|
|||
|
||||
memoryManager->freeGraphicsMemory(graphicsAllocation);
|
||||
}
|
||||
TEST_F(DrmMemoryManagerTest, givenOsHandleWithNonTiledObjectWhenCreateFromSharedHandleIsCalledThenNonTiledGmmIsCreatedAndSetInAllocation) {
|
||||
TEST_F(ClDrmMemoryManagerTest, givenOsHandleWithNonTiledObjectWhenCreateFromSharedHandleIsCalledThenNonTiledGmmIsCreatedAndSetInAllocation) {
|
||||
mock->ioctl_expected.primeFdToHandle = 1;
|
||||
mock->ioctl_expected.gemWait = 1;
|
||||
mock->ioctl_expected.gemClose = 1;
|
||||
|
@ -2134,7 +2152,7 @@ TEST_F(DrmMemoryManagerTest, givenOsHandleWithNonTiledObjectWhenCreateFromShared
|
|||
imgDesc.image_type = CL_MEM_OBJECT_IMAGE2D;
|
||||
|
||||
imgInfo.imgDesc = Image::convertDescriptor(imgDesc);
|
||||
MockContext context(device);
|
||||
MockContext context(pClDevice);
|
||||
gmmSurfaceFormat = Image::getSurfaceFormatFromTable(flags, &gmmImgFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
imgInfo.surfaceFormat = &gmmSurfaceFormat->surfaceFormat;
|
||||
imgInfo.plane = GMM_PLANE_Y;
|
||||
|
@ -2154,7 +2172,7 @@ TEST_F(DrmMemoryManagerTest, givenOsHandleWithNonTiledObjectWhenCreateFromShared
|
|||
memoryManager->freeGraphicsMemory(graphicsAllocation);
|
||||
}
|
||||
|
||||
TEST_F(DrmMemoryManagerTest, givenOsHandleWithTileYObjectWhenCreateFromSharedHandleIsCalledThenTileYGmmIsCreatedAndSetInAllocation) {
|
||||
TEST_F(ClDrmMemoryManagerTest, givenOsHandleWithTileYObjectWhenCreateFromSharedHandleIsCalledThenTileYGmmIsCreatedAndSetInAllocation) {
|
||||
mock->ioctl_expected.primeFdToHandle = 1;
|
||||
mock->ioctl_expected.gemWait = 1;
|
||||
mock->ioctl_expected.gemClose = 1;
|
||||
|
@ -2176,7 +2194,7 @@ TEST_F(DrmMemoryManagerTest, givenOsHandleWithTileYObjectWhenCreateFromSharedHan
|
|||
imgDesc.image_type = CL_MEM_OBJECT_IMAGE2D;
|
||||
|
||||
imgInfo.imgDesc = Image::convertDescriptor(imgDesc);
|
||||
MockContext context(device);
|
||||
MockContext context(pClDevice);
|
||||
gmmSurfaceFormat = Image::getSurfaceFormatFromTable(flags, &gmmImgFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
imgInfo.surfaceFormat = &gmmSurfaceFormat->surfaceFormat;
|
||||
imgInfo.plane = GMM_PLANE_Y;
|
||||
|
@ -2195,7 +2213,7 @@ TEST_F(DrmMemoryManagerTest, givenOsHandleWithTileYObjectWhenCreateFromSharedHan
|
|||
memoryManager->freeGraphicsMemory(graphicsAllocation);
|
||||
}
|
||||
|
||||
TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenCreateFromSharedHandleFailsToCallGetTilingThenNonLinearStorageIsAssumed) {
|
||||
TEST_F(ClDrmMemoryManagerTest, givenDrmMemoryManagerWhenCreateFromSharedHandleFailsToCallGetTilingThenNonLinearStorageIsAssumed) {
|
||||
mock->ioctl_expected.primeFdToHandle = 1;
|
||||
mock->ioctl_expected.gemGetTiling = 1;
|
||||
mock->ioctl_expected.gemWait = 1;
|
||||
|
@ -2218,7 +2236,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenCreateFromSharedHandleFail
|
|||
imgDesc.image_type = CL_MEM_OBJECT_IMAGE2D;
|
||||
|
||||
imgInfo.imgDesc = Image::convertDescriptor(imgDesc);
|
||||
MockContext context(device);
|
||||
MockContext context(pClDevice);
|
||||
gmmSurfaceFormat = Image::getSurfaceFormatFromTable(flags, &gmmImgFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
imgInfo.surfaceFormat = &gmmSurfaceFormat->surfaceFormat;
|
||||
imgInfo.plane = GMM_PLANE_Y;
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
|
||||
#include "opencl/test/unit_test/fixtures/memory_management_fixture.h"
|
||||
#include "opencl/test/unit_test/mocks/linux/mock_drm_command_stream_receiver.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_cl_device.h"
|
||||
#include "opencl/test/unit_test/os_interface/linux/device_command_stream_fixture.h"
|
||||
|
||||
#include <memory>
|
||||
|
@ -51,12 +50,12 @@ class DrmMemoryManagerFixture : public MemoryManagementFixture {
|
|||
const uint32_t rootDeviceIndex = 1u;
|
||||
const uint32_t numRootDevices = 2u;
|
||||
TestedDrmMemoryManager *memoryManager = nullptr;
|
||||
MockClDevice *device = nullptr;
|
||||
MockDevice *device = nullptr;
|
||||
|
||||
void SetUp() override {
|
||||
MemoryManagementFixture::SetUp();
|
||||
|
||||
executionEnvironment = MockClDevice::prepareExecutionEnvironment(defaultHwInfo.get(), numRootDevices - 1);
|
||||
executionEnvironment = MockDevice::prepareExecutionEnvironment(defaultHwInfo.get(), numRootDevices - 1);
|
||||
SetUp(new DrmMockCustom(*executionEnvironment->rootDeviceEnvironments[0]), false);
|
||||
}
|
||||
|
||||
|
@ -86,7 +85,7 @@ class DrmMemoryManagerFixture : public MemoryManagementFixture {
|
|||
if (memoryManager->getgemCloseWorker()) {
|
||||
memoryManager->getgemCloseWorker()->close(true);
|
||||
}
|
||||
device = new MockClDevice{MockDevice::create<MockDevice>(executionEnvironment, rootDeviceIndex)};
|
||||
device = MockDevice::create<MockDevice>(executionEnvironment, rootDeviceIndex);
|
||||
mock->reset();
|
||||
}
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ class DrmMemoryManagerFixtureExp : public DrmMemoryManagerFixture {
|
|||
ultHwConfig.csrBaseCallCreatePreemption = false;
|
||||
|
||||
MemoryManagementFixture::SetUp();
|
||||
executionEnvironment = MockClDevice::prepareExecutionEnvironment(defaultHwInfo.get(), numRootDevices - 1);
|
||||
executionEnvironment = MockDevice::prepareExecutionEnvironment(defaultHwInfo.get(), numRootDevices - 1);
|
||||
mockExp = new DrmMockCustomExp(*executionEnvironment->rootDeviceEnvironments[0]);
|
||||
DrmMemoryManagerFixture::SetUp(mockExp, true);
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2020 Intel Corporation
|
||||
* Copyright (C) 2020-2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
|
@ -7,6 +7,7 @@
|
|||
|
||||
#include "opencl/source/mem_obj/image.h"
|
||||
#include "opencl/source/sharings/va/va_surface.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_cl_device.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_context.h"
|
||||
#include "opencl/test/unit_test/os_interface/linux/drm_memory_manager_tests.h"
|
||||
#include "opencl/test/unit_test/sharings/va/mock_va_sharing.h"
|
||||
|
@ -18,8 +19,9 @@ using DrmVaSharingTest = Test<DrmMemoryManagerFixture>;
|
|||
|
||||
TEST_F(DrmVaSharingTest, givenDrmMemoryManagerWhenSharedVaSurfaceIsImportedWithDrmPrimeFdToHandleThenDrmPrimeFdCanBeClosed) {
|
||||
mock->ioctl_expected.total = -1;
|
||||
|
||||
MockContext context(device);
|
||||
device->incRefInternal();
|
||||
MockClDevice clDevice{device};
|
||||
MockContext context(&clDevice);
|
||||
MockVaSharing vaSharing;
|
||||
VASurfaceID vaSurfaceId = 0u;
|
||||
|
||||
|
|
Loading…
Reference in New Issue