2022-09-15 01:10:00 +00:00
|
|
|
/*
|
2023-01-16 15:30:27 +00:00
|
|
|
* Copyright (C) 2022-2023 Intel Corporation
|
2022-09-15 01:10:00 +00:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "shared/test/common/fixtures/command_stream_receiver_fixture.h"
|
|
|
|
|
|
|
|
|
|
#include "shared/source/command_stream/preemption.h"
|
2023-01-16 15:30:27 +00:00
|
|
|
#include "shared/test/common/mocks/mock_device.h"
|
2022-11-16 15:50:07 +00:00
|
|
|
#include "shared/test/common/mocks/mock_graphics_allocation.h"
|
2022-09-15 01:10:00 +00:00
|
|
|
|
|
|
|
|
using namespace NEO;
|
|
|
|
|
|
|
|
|
|
void CommandStreamReceiverFixture::setUp() {
|
|
|
|
|
DeviceFixture::setUp();
|
|
|
|
|
|
|
|
|
|
commandStream.replaceBuffer(cmdBuffer, bufferSize);
|
|
|
|
|
auto graphicsAllocation = new MockGraphicsAllocation(cmdBuffer, bufferSize);
|
|
|
|
|
commandStream.replaceGraphicsAllocation(graphicsAllocation);
|
|
|
|
|
|
|
|
|
|
dsh.replaceBuffer(dshBuffer, bufferSize);
|
|
|
|
|
graphicsAllocation = new MockGraphicsAllocation(dshBuffer, bufferSize);
|
|
|
|
|
dsh.replaceGraphicsAllocation(graphicsAllocation);
|
|
|
|
|
|
|
|
|
|
ioh.replaceBuffer(iohBuffer, bufferSize);
|
|
|
|
|
graphicsAllocation = new MockGraphicsAllocation(iohBuffer, bufferSize);
|
|
|
|
|
ioh.replaceGraphicsAllocation(graphicsAllocation);
|
|
|
|
|
|
|
|
|
|
ssh.replaceBuffer(sshBuffer, bufferSize);
|
|
|
|
|
graphicsAllocation = new MockGraphicsAllocation(sshBuffer, bufferSize);
|
|
|
|
|
ssh.replaceGraphicsAllocation(graphicsAllocation);
|
|
|
|
|
|
|
|
|
|
flushTaskFlags.preemptionMode = PreemptionHelper::getDefaultPreemptionMode(pDevice->getHardwareInfo());
|
|
|
|
|
}
|
2022-09-16 03:43:18 +00:00
|
|
|
|
2022-09-15 01:10:00 +00:00
|
|
|
void CommandStreamReceiverFixture::tearDown() {
|
|
|
|
|
DeviceFixture::tearDown();
|
|
|
|
|
|
|
|
|
|
delete dsh.getGraphicsAllocation();
|
|
|
|
|
delete ioh.getGraphicsAllocation();
|
|
|
|
|
delete ssh.getGraphicsAllocation();
|
|
|
|
|
delete commandStream.getGraphicsAllocation();
|
|
|
|
|
}
|