Skip to content

Commit 7390e45

Browse files
committed
Add getter of Scratch Controller to the CommandStreamReceiver class
Change-Id: Iba0a9d7e4a9f141e1e31de428d50e7c745ad993a Signed-off-by: Zbigniew Zdanowicz <[email protected]>
1 parent b82cdd6 commit 7390e45

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

runtime/command_stream/command_stream_receiver.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,10 @@ class CommandStreamReceiver {
178178
BlitterConstants::BlitWithHostPtrDirection copyDirection, CsrDependencies &csrDependencies);
179179
virtual void blitBuffer(Buffer &dstBuffer, Buffer &srcBuffer, uint64_t sourceSize, CsrDependencies &csrDependencies) = 0;
180180

181+
ScratchSpaceController *getScratchSpaceController() const {
182+
return scratchSpaceController.get();
183+
}
184+
181185
protected:
182186
void cleanupResources();
183187

unit_tests/command_stream/command_stream_receiver_hw_tests.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandStreamReceiverHwTest, WhenCommandStreamReceiv
231231

232232
HWTEST_F(CommandStreamReceiverHwTest, WhenScratchSpaceIsNotRequiredThenScratchAllocationIsNotCreated) {
233233
auto commandStreamReceiver = std::make_unique<MockCsrHw<FamilyType>>(*pDevice->executionEnvironment);
234-
auto scratchController = commandStreamReceiver->scratchSpaceController.get();
234+
auto scratchController = commandStreamReceiver->getScratchSpaceController();
235235

236236
bool stateBaseAddressDirty = false;
237237
bool cfeStateDirty = false;
@@ -243,7 +243,7 @@ HWTEST_F(CommandStreamReceiverHwTest, WhenScratchSpaceIsNotRequiredThenScratchAl
243243

244244
HWTEST_F(CommandStreamReceiverHwTest, WhenScratchSpaceIsRequiredThenCorrectAddressIsReturned) {
245245
auto commandStreamReceiver = std::make_unique<MockCsrHw<FamilyType>>(*pDevice->executionEnvironment);
246-
auto scratchController = commandStreamReceiver->scratchSpaceController.get();
246+
auto scratchController = commandStreamReceiver->getScratchSpaceController();
247247

248248
bool cfeStateDirty = false;
249249
bool stateBaseAddressDirty = false;

unit_tests/libult/ult_command_stream_receiver.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ class UltCommandStreamReceiver : public CommandStreamReceiverHw<GfxFamily>, publ
2626
using BaseClass::deviceIndex;
2727
using BaseClass::dshState;
2828
using BaseClass::getScratchPatchAddress;
29+
using BaseClass::getScratchSpaceController;
2930
using BaseClass::indirectHeap;
3031
using BaseClass::iohState;
3132
using BaseClass::programPreamble;
@@ -58,7 +59,6 @@ class UltCommandStreamReceiver : public CommandStreamReceiverHw<GfxFamily>, publ
5859
using BaseClass::CommandStreamReceiver::requiredScratchSize;
5960
using BaseClass::CommandStreamReceiver::requiredThreadArbitrationPolicy;
6061
using BaseClass::CommandStreamReceiver::samplerCacheFlushRequired;
61-
using BaseClass::CommandStreamReceiver::scratchSpaceController;
6262
using BaseClass::CommandStreamReceiver::stallingPipeControlOnNextFlushRequired;
6363
using BaseClass::CommandStreamReceiver::submissionAggregator;
6464
using BaseClass::CommandStreamReceiver::taskCount;

0 commit comments

Comments
 (0)