From 3719c7a767bd61f94587dc8c7b8768ce0a723404 Mon Sep 17 00:00:00 2001 From: "Mrozek, Michal" Date: Thu, 6 Dec 2018 16:06:51 +0100 Subject: [PATCH] Limit AUB SSH size to 64KB. Change-Id: I1a23aa2a253a93ed9633ab7fda0a6180050add83 --- runtime/command_stream/aub_command_stream_receiver_hw.inl | 1 + .../command_stream/aub_command_stream_receiver_2_tests.cpp | 5 +++++ unit_tests/mocks/mock_aub_csr.h | 2 ++ 3 files changed, 8 insertions(+) diff --git a/runtime/command_stream/aub_command_stream_receiver_hw.inl b/runtime/command_stream/aub_command_stream_receiver_hw.inl index a722418a80..ba66f4a8ef 100644 --- a/runtime/command_stream/aub_command_stream_receiver_hw.inl +++ b/runtime/command_stream/aub_command_stream_receiver_hw.inl @@ -87,6 +87,7 @@ AUBCommandStreamReceiverHw::AUBCommandStreamReceiverHw(const Hardware this->aubDeviceId = debugDeviceId == -1 ? hwInfoIn.capabilityTable.aubDeviceId : static_cast(debugDeviceId); + this->defaultSshSize = 64 * KB; } template diff --git a/unit_tests/command_stream/aub_command_stream_receiver_2_tests.cpp b/unit_tests/command_stream/aub_command_stream_receiver_2_tests.cpp index 0d7d71da75..94d4024707 100644 --- a/unit_tests/command_stream/aub_command_stream_receiver_2_tests.cpp +++ b/unit_tests/command_stream/aub_command_stream_receiver_2_tests.cpp @@ -842,3 +842,8 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenObtaini auto aubCsr = std::make_unique>(**platformDevices, "", true, *pDevice->executionEnvironment); EXPECT_EQ(1u, aubCsr->getPreferredTagPoolSize()); } + +HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenSshSizeIsObtainedItEqualsTo64KB) { + auto aubCsr = std::make_unique>(**platformDevices, "", true, *pDevice->executionEnvironment); + EXPECT_EQ(64 * KB, aubCsr->defaultSshSize); +} diff --git a/unit_tests/mocks/mock_aub_csr.h b/unit_tests/mocks/mock_aub_csr.h index b2b7f2a597..13209af523 100644 --- a/unit_tests/mocks/mock_aub_csr.h +++ b/unit_tests/mocks/mock_aub_csr.h @@ -53,6 +53,8 @@ struct MockAubCsr : public AUBCommandStreamReceiverHw { MockAubCsr(const HardwareInfo &hwInfoIn, const std::string &fileName, bool standalone, ExecutionEnvironment &executionEnvironment) : AUBCommandStreamReceiverHw(hwInfoIn, fileName, standalone, executionEnvironment){}; + using CommandStreamReceiverHw::defaultSshSize; + DispatchMode peekDispatchMode() const { return this->dispatchMode; }