Move Scratch Space functionality to dedicated class

Change-Id: Ic7655c4b971513961aba6823478a139ffc943466
This commit is contained in:
Zdanowicz, Zbigniew
2018-11-22 15:16:20 +01:00
parent a9d3575919
commit 7dbd0ea4f3
41 changed files with 934 additions and 91 deletions

View File

@ -10,6 +10,7 @@
#include "runtime/command_queue/command_queue_hw.h"
#include "runtime/command_stream/command_stream_receiver.h"
#include "runtime/command_stream/linear_stream.h"
#include "runtime/command_stream/scratch_space_controller.h"
#include "runtime/os_interface/debug_settings_manager.h"
#include "runtime/event/user_event.h"
#include "runtime/helpers/aligned_memory.h"
@ -210,3 +211,15 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandStreamReceiverHwTest, WhenCommandStreamReceiv
auto &commandStreamReceiver = pDevice->getCommandStreamReceiver();
EXPECT_EQ(64 * KB, commandStreamReceiver.defaultSshSize);
}
HWTEST_F(CommandStreamReceiverHwTest, WhenScratchSpaceIsNotRequiredThenScratchAllocationIsNotCreated) {
auto commandStreamReceiver = std::make_unique<MockCsrHw<FamilyType>>(*platformDevices[0], *pDevice->executionEnvironment);
auto scratchController = commandStreamReceiver->scratchSpaceController.get();
bool stateBaseAddressDirty = false;
bool cfeStateDirty = false;
scratchController->setRequiredScratchSpace(reinterpret_cast<void *>(0x2000), 0u, 0u, 0u, stateBaseAddressDirty, cfeStateDirty);
EXPECT_FALSE(cfeStateDirty);
EXPECT_FALSE(stateBaseAddressDirty);
EXPECT_EQ(nullptr, scratchController->getScratchSpaceAllocation());
}