2021-10-29 10:12:13 +00:00
|
|
|
/*
|
2023-01-16 15:30:27 +00:00
|
|
|
* Copyright (C) 2021-2023 Intel Corporation
|
2021-10-29 10:12:13 +00:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
2022-08-09 14:26:49 +00:00
|
|
|
#include "shared/test/unit_test/fixtures/implicit_scaling_fixture.h"
|
2021-10-29 10:12:13 +00:00
|
|
|
|
2022-07-24 04:21:16 +00:00
|
|
|
#include "shared/source/gmm_helper/gmm_helper.h"
|
2021-10-29 10:12:13 +00:00
|
|
|
#include "shared/source/helpers/aligned_memory.h"
|
|
|
|
|
#include "shared/source/os_interface/os_interface.h"
|
2021-11-10 19:56:42 +00:00
|
|
|
#include "shared/test/common/helpers/default_hw_info.h"
|
2023-01-16 15:30:27 +00:00
|
|
|
#include "shared/test/common/mocks/mock_device.h"
|
2021-10-29 10:12:13 +00:00
|
|
|
|
2022-08-11 14:01:11 +00:00
|
|
|
void ImplicitScalingFixture::setUp() {
|
|
|
|
|
CommandEncodeStatesFixture::setUp();
|
2021-10-29 10:12:13 +00:00
|
|
|
apiSupportBackup = std::make_unique<VariableBackup<bool>>(&ImplicitScaling::apiSupport, true);
|
|
|
|
|
osLocalMemoryBackup = std::make_unique<VariableBackup<bool>>(&OSInterface::osEnableLocalMemory, true);
|
|
|
|
|
|
|
|
|
|
singleTile = DeviceBitfield(static_cast<uint32_t>(maxNBitValue(1)));
|
|
|
|
|
twoTile = DeviceBitfield(static_cast<uint32_t>(maxNBitValue(2)));
|
|
|
|
|
|
|
|
|
|
alignedMemory = alignedMalloc(bufferSize, 4096);
|
|
|
|
|
|
2022-06-06 20:34:20 +00:00
|
|
|
auto gmmHelper = pDevice->getGmmHelper();
|
|
|
|
|
auto canonizedGpuAddress = gmmHelper->canonize(gpuVa);
|
|
|
|
|
cmdBufferAlloc.setCpuPtrAndGpuAddress(alignedMemory, canonizedGpuAddress);
|
2021-10-29 10:12:13 +00:00
|
|
|
|
|
|
|
|
commandStream.replaceBuffer(alignedMemory, bufferSize);
|
|
|
|
|
commandStream.replaceGraphicsAllocation(&cmdBufferAlloc);
|
2021-11-10 19:56:42 +00:00
|
|
|
|
|
|
|
|
testHardwareInfo = *defaultHwInfo;
|
2022-10-14 12:34:24 +00:00
|
|
|
|
|
|
|
|
dcFlushFlag = pDevice->getDefaultEngine().commandStreamReceiver->getDcFlushSupport();
|
2021-10-29 10:12:13 +00:00
|
|
|
}
|
|
|
|
|
|
2022-08-11 14:01:11 +00:00
|
|
|
void ImplicitScalingFixture::tearDown() {
|
2021-10-29 10:12:13 +00:00
|
|
|
alignedFree(alignedMemory);
|
2022-08-11 14:01:11 +00:00
|
|
|
CommandEncodeStatesFixture::tearDown();
|
2021-10-29 10:12:13 +00:00
|
|
|
}
|