mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Refactor direct submission
Related-To: NEO-4338 Change-Id: Ic858a9324e5f892532d39c98a4029df9d2a64e46 Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:

committed by
sys_ocldev

parent
5caa8bc28d
commit
49d3c39fae
@ -177,17 +177,16 @@ bool WddmCommandStreamReceiver<GfxFamily>::initDirectSubmission(Device &device,
|
||||
}
|
||||
|
||||
if (directSubmissionProperty.engineSupported && startDirect) {
|
||||
if (contextEngineType == ENGINE_TYPE_BCS) {
|
||||
directSubmission = std::make_unique<WddmDirectSubmission<GfxFamily>>(device,
|
||||
std::make_unique<BlitterDispatcher<GfxFamily>>(),
|
||||
osContext);
|
||||
if (contextEngineType == aub_stream::ENGINE_BCS) {
|
||||
blitterDirectSubmission = std::make_unique<
|
||||
WddmDirectSubmission<GfxFamily, BlitterDispatcher<GfxFamily>>>(device, osContext);
|
||||
ret = blitterDirectSubmission->initialize(directSubmissionProperty.submitOnInit);
|
||||
} else {
|
||||
directSubmission = std::make_unique<WddmDirectSubmission<GfxFamily>>(device,
|
||||
std::make_unique<RenderDispatcher<GfxFamily>>(),
|
||||
osContext);
|
||||
directSubmission = std::make_unique<
|
||||
WddmDirectSubmission<GfxFamily, RenderDispatcher<GfxFamily>>>(device, osContext);
|
||||
ret = directSubmission->initialize(directSubmissionProperty.submitOnInit);
|
||||
this->dispatchMode = DispatchMode::ImmediateDispatch;
|
||||
}
|
||||
ret = directSubmission->initialize(directSubmissionProperty.submitOnInit);
|
||||
this->dispatchMode = DispatchMode::ImmediateDispatch;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
|
@ -35,6 +35,7 @@ class UltCommandStreamReceiver : public CommandStreamReceiverHw<GfxFamily>, publ
|
||||
using BaseClass::getScratchSpaceController;
|
||||
using BaseClass::indirectHeap;
|
||||
using BaseClass::iohState;
|
||||
using BaseClass::isBlitterDirectSubmissionEnabled;
|
||||
using BaseClass::isDirectSubmissionEnabled;
|
||||
using BaseClass::perDssBackedBuffer;
|
||||
using BaseClass::programEnginePrologue;
|
||||
@ -54,6 +55,7 @@ class UltCommandStreamReceiver : public CommandStreamReceiverHw<GfxFamily>, publ
|
||||
using BaseClass::CommandStreamReceiver::GSBAFor32BitProgrammed;
|
||||
using BaseClass::CommandStreamReceiver::initDirectSubmission;
|
||||
using BaseClass::CommandStreamReceiver::internalAllocationStorage;
|
||||
using BaseClass::CommandStreamReceiver::isBlitterDirectSubmissionEnabled;
|
||||
using BaseClass::CommandStreamReceiver::isDirectSubmissionEnabled;
|
||||
using BaseClass::CommandStreamReceiver::isEnginePrologueSent;
|
||||
using BaseClass::CommandStreamReceiver::isPreambleSent;
|
||||
@ -221,6 +223,17 @@ class UltCommandStreamReceiver : public CommandStreamReceiverHw<GfxFamily>, publ
|
||||
}
|
||||
return directSubmissionAvailable;
|
||||
}
|
||||
|
||||
bool isBlitterDirectSubmissionEnabled() const override {
|
||||
if (ultHwConfig.csrBaseCallBlitterDirectSubmissionAvailable) {
|
||||
return BaseClass::isBlitterDirectSubmissionEnabled();
|
||||
}
|
||||
if (ultHwConfig.csrSuperBaseCallBlitterDirectSubmissionAvailable) {
|
||||
return BaseClass::CommandStreamReceiver::isBlitterDirectSubmissionEnabled();
|
||||
}
|
||||
return blitterDirectSubmissionAvailable;
|
||||
}
|
||||
|
||||
std::atomic<uint32_t> recursiveLockCounter;
|
||||
bool createPageTableManagerCalled = false;
|
||||
bool recordFlusheBatchBuffer = false;
|
||||
@ -240,5 +253,6 @@ class UltCommandStreamReceiver : public CommandStreamReceiverHw<GfxFamily>, publ
|
||||
DispatchFlags recordedDispatchFlags;
|
||||
bool multiOsContextCapable = false;
|
||||
bool directSubmissionAvailable = false;
|
||||
bool blitterDirectSubmissionAvailable = false;
|
||||
};
|
||||
} // namespace NEO
|
||||
|
@ -87,6 +87,7 @@ struct MockWddmCsr : public WddmCommandStreamReceiver<GfxFamily> {
|
||||
using CommandStreamReceiver::commandStream;
|
||||
using CommandStreamReceiver::dispatchMode;
|
||||
using CommandStreamReceiver::getCS;
|
||||
using CommandStreamReceiverHw<GfxFamily>::blitterDirectSubmission;
|
||||
using CommandStreamReceiverHw<GfxFamily>::directSubmission;
|
||||
using WddmCommandStreamReceiver<GfxFamily>::commandBufferHeader;
|
||||
using WddmCommandStreamReceiver<GfxFamily>::WddmCommandStreamReceiver;
|
||||
@ -962,6 +963,7 @@ TEST_F(WddmCommandStreamTest, whenDirectSubmissionDisabledThenExpectNoFeatureAva
|
||||
bool ret = csr->initDirectSubmission(*device.get(), *osContext.get());
|
||||
EXPECT_TRUE(ret);
|
||||
EXPECT_FALSE(csr->isDirectSubmissionEnabled());
|
||||
EXPECT_FALSE(csr->isBlitterDirectSubmissionEnabled());
|
||||
}
|
||||
|
||||
TEST_F(WddmCommandStreamTest, whenDirectSubmissionEnabledOnRcsThenExpectFeatureAvailable) {
|
||||
@ -973,6 +975,7 @@ TEST_F(WddmCommandStreamTest, whenDirectSubmissionEnabledOnRcsThenExpectFeatureA
|
||||
bool ret = csr->initDirectSubmission(*device.get(), *osContext.get());
|
||||
EXPECT_TRUE(ret);
|
||||
EXPECT_TRUE(csr->isDirectSubmissionEnabled());
|
||||
EXPECT_FALSE(csr->isBlitterDirectSubmissionEnabled());
|
||||
}
|
||||
|
||||
TEST_F(WddmCommandStreamTest, givenDirectSubmissionEnabledWhenPlatformNotSupportsRcsThenExpectFeatureNotAvailable) {
|
||||
@ -999,7 +1002,8 @@ TEST_F(WddmCommandStreamTest, whenDirectSubmissionEnabledOnBcsThenExpectFeatureA
|
||||
|
||||
bool ret = csr->initDirectSubmission(*device.get(), *osContext.get());
|
||||
EXPECT_TRUE(ret);
|
||||
EXPECT_TRUE(csr->isDirectSubmissionEnabled());
|
||||
EXPECT_FALSE(csr->isDirectSubmissionEnabled());
|
||||
EXPECT_TRUE(csr->isBlitterDirectSubmissionEnabled());
|
||||
}
|
||||
|
||||
TEST_F(WddmCommandStreamTest, givenDirectSubmissionEnabledWhenPlatformNotSupportsBcsThenExpectFeatureNotAvailable) {
|
||||
@ -1016,6 +1020,7 @@ TEST_F(WddmCommandStreamTest, givenDirectSubmissionEnabledWhenPlatformNotSupport
|
||||
bool ret = csr->initDirectSubmission(*device.get(), *osContext.get());
|
||||
EXPECT_TRUE(ret);
|
||||
EXPECT_FALSE(csr->isDirectSubmissionEnabled());
|
||||
EXPECT_FALSE(csr->isBlitterDirectSubmissionEnabled());
|
||||
}
|
||||
|
||||
TEST_F(WddmCommandStreamTest, givenLowPriorityContextWhenDirectSubmissionDisabledOnLowPriorityThenExpectFeatureNotAvailable) {
|
||||
|
@ -30,7 +30,7 @@ void NEO::UltConfigListener::OnTestEnd(const ::testing::TestInfo &testInfo) {
|
||||
|
||||
// Ensure that global state is restored
|
||||
UltHwConfig expectedState{};
|
||||
static_assert(sizeof(UltHwConfig) == 7 * sizeof(bool), ""); // Ensure that there is no internal padding
|
||||
static_assert(sizeof(UltHwConfig) == 9 * sizeof(bool), ""); // Ensure that there is no internal padding
|
||||
EXPECT_EQ(0, memcmp(&expectedState, &ultHwConfig, sizeof(UltHwConfig)));
|
||||
EXPECT_EQ(0, memcmp(&referencedHwInfo, defaultHwInfo.get(), sizeof(HardwareInfo)));
|
||||
}
|
||||
|
Reference in New Issue
Block a user