mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-10 12:53:42 +08:00
Revert "Assign BCS at first blit enqueue"
This reverts commit 5f5a1a6f81
.
Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
652ca907b0
commit
e8e3355a93
@ -77,22 +77,19 @@ CommandQueue::CommandQueue(Context *context, ClDevice *device, const cl_queue_pr
|
||||
|
||||
UNRECOVERABLE_IF(gpgpuEngine->getEngineType() >= aub_stream::EngineType::NUM_ENGINES);
|
||||
|
||||
bcsAllowed = hwInfoConfig->isBlitterFullySupported(hwInfo) &&
|
||||
hwHelper.isSubDeviceEngineSupported(hwInfo, device->getDeviceBitfield(), aub_stream::EngineType::ENGINE_BCS);
|
||||
bool bcsAllowed = hwInfoConfig->isBlitterFullySupported(hwInfo) &&
|
||||
hwHelper.isSubDeviceEngineSupported(hwInfo, device->getDeviceBitfield(), aub_stream::EngineType::ENGINE_BCS);
|
||||
|
||||
if (bcsAllowed || gpgpuEngine->commandStreamReceiver->peekTimestampPacketWriteEnabled()) {
|
||||
timestampPacketContainer = std::make_unique<TimestampPacketContainer>();
|
||||
deferredTimestampPackets = std::make_unique<TimestampPacketContainer>();
|
||||
}
|
||||
|
||||
auto deferCmdQBcsInitialization = true;
|
||||
|
||||
if (DebugManager.flags.DeferCmdQBcsInitialization.get() != -1) {
|
||||
deferCmdQBcsInitialization = DebugManager.flags.DeferCmdQBcsInitialization.get();
|
||||
}
|
||||
|
||||
if (!deferCmdQBcsInitialization) {
|
||||
this->initializeBcsEngine(internalUsage);
|
||||
if (bcsAllowed) {
|
||||
auto &neoDevice = device->getNearestGenericSubDevice(0)->getDevice();
|
||||
auto &selectorCopyEngine = neoDevice.getSelectorCopyEngine();
|
||||
auto bcsEngineType = EngineHelpers::getBcsEngineType(hwInfo, device->getDeviceBitfield(), selectorCopyEngine, internalUsage);
|
||||
bcsEngines[EngineHelpers::getBcsIndex(bcsEngineType)] = neoDevice.tryGetEngine(bcsEngineType, EngineUsage::Regular);
|
||||
bcsEngineTypes.push_back(bcsEngineType);
|
||||
}
|
||||
}
|
||||
|
||||
@ -137,8 +134,7 @@ CommandStreamReceiver &CommandQueue::getGpgpuCommandStreamReceiver() const {
|
||||
return *gpgpuEngine->commandStreamReceiver;
|
||||
}
|
||||
|
||||
CommandStreamReceiver *CommandQueue::getBcsCommandStreamReceiver(aub_stream::EngineType bcsEngineType) {
|
||||
initializeBcsEngine(isSpecial());
|
||||
CommandStreamReceiver *CommandQueue::getBcsCommandStreamReceiver(aub_stream::EngineType bcsEngineType) const {
|
||||
const EngineControl *engine = this->bcsEngines[EngineHelpers::getBcsIndex(bcsEngineType)];
|
||||
if (engine == nullptr) {
|
||||
return nullptr;
|
||||
@ -147,8 +143,7 @@ CommandStreamReceiver *CommandQueue::getBcsCommandStreamReceiver(aub_stream::Eng
|
||||
}
|
||||
}
|
||||
|
||||
CommandStreamReceiver *CommandQueue::getBcsForAuxTranslation() {
|
||||
initializeBcsEngine(isSpecial());
|
||||
CommandStreamReceiver *CommandQueue::getBcsForAuxTranslation() const {
|
||||
for (const EngineControl *engine : this->bcsEngines) {
|
||||
if (engine != nullptr) {
|
||||
return engine->commandStreamReceiver;
|
||||
@ -157,8 +152,7 @@ CommandStreamReceiver *CommandQueue::getBcsForAuxTranslation() {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
CommandStreamReceiver &CommandQueue::selectCsrForBuiltinOperation(const CsrSelectionArgs &args) {
|
||||
initializeBcsEngine(isSpecial());
|
||||
CommandStreamReceiver &CommandQueue::selectCsrForBuiltinOperation(const CsrSelectionArgs &args) const {
|
||||
if (isCopyOnly) {
|
||||
return *getBcsCommandStreamReceiver(bcsEngineTypes[0]);
|
||||
}
|
||||
@ -226,17 +220,6 @@ CommandStreamReceiver &CommandQueue::selectCsrForBuiltinOperation(const CsrSelec
|
||||
return *selectedCsr;
|
||||
}
|
||||
|
||||
void CommandQueue::initializeBcsEngine(bool internalUsage) {
|
||||
if (bcsAllowed && !bcsInitialized) {
|
||||
auto &neoDevice = device->getNearestGenericSubDevice(0)->getDevice();
|
||||
auto &selectorCopyEngine = neoDevice.getSelectorCopyEngine();
|
||||
auto bcsEngineType = EngineHelpers::getBcsEngineType(device->getHardwareInfo(), device->getDeviceBitfield(), selectorCopyEngine, internalUsage);
|
||||
bcsEngines[EngineHelpers::getBcsIndex(bcsEngineType)] = neoDevice.tryGetEngine(bcsEngineType, EngineUsage::Regular);
|
||||
bcsEngineTypes.push_back(bcsEngineType);
|
||||
bcsInitialized = true;
|
||||
}
|
||||
}
|
||||
|
||||
Device &CommandQueue::getDevice() const noexcept {
|
||||
return device->getDevice();
|
||||
}
|
||||
@ -250,7 +233,7 @@ volatile uint32_t *CommandQueue::getHwTagAddress() const {
|
||||
return getGpgpuCommandStreamReceiver().getTagAddress();
|
||||
}
|
||||
|
||||
bool CommandQueue::isCompleted(uint32_t gpgpuTaskCount, CopyEngineState bcsState) {
|
||||
bool CommandQueue::isCompleted(uint32_t gpgpuTaskCount, CopyEngineState bcsState) const {
|
||||
DEBUG_BREAK_IF(getHwTag() == CompletionStamp::notReady);
|
||||
|
||||
if (getGpgpuCommandStreamReceiver().testTaskCountReady(getHwTagAddress(), gpgpuTaskCount)) {
|
||||
@ -998,7 +981,6 @@ void CommandQueue::overrideEngine(aub_stream::EngineType engineType, EngineUsage
|
||||
timestampPacketContainer = std::make_unique<TimestampPacketContainer>();
|
||||
deferredTimestampPackets = std::make_unique<TimestampPacketContainer>();
|
||||
isCopyOnly = true;
|
||||
bcsInitialized = true;
|
||||
} else {
|
||||
gpgpuEngine = &device->getEngine(engineType, engineUsage);
|
||||
}
|
||||
|
@ -202,7 +202,7 @@ class CommandQueue : public BaseObject<_cl_command_queue> {
|
||||
|
||||
volatile uint32_t *getHwTagAddress() const;
|
||||
|
||||
bool isCompleted(uint32_t gpgpuTaskCount, CopyEngineState bcsState);
|
||||
bool isCompleted(uint32_t gpgpuTaskCount, CopyEngineState bcsState) const;
|
||||
|
||||
bool isWaitForTimestampsEnabled() const;
|
||||
virtual bool waitForTimestamps(Range<CopyEngineState> copyEnginesToWait, uint32_t taskCount) = 0;
|
||||
@ -223,10 +223,9 @@ class CommandQueue : public BaseObject<_cl_command_queue> {
|
||||
const cl_event *eventWaitList);
|
||||
|
||||
MOCKABLE_VIRTUAL CommandStreamReceiver &getGpgpuCommandStreamReceiver() const;
|
||||
MOCKABLE_VIRTUAL CommandStreamReceiver *getBcsCommandStreamReceiver(aub_stream::EngineType bcsEngineType);
|
||||
CommandStreamReceiver *getBcsForAuxTranslation();
|
||||
MOCKABLE_VIRTUAL CommandStreamReceiver &selectCsrForBuiltinOperation(const CsrSelectionArgs &args);
|
||||
void initializeBcsEngine(bool internalUsage);
|
||||
MOCKABLE_VIRTUAL CommandStreamReceiver *getBcsCommandStreamReceiver(aub_stream::EngineType bcsEngineType) const;
|
||||
CommandStreamReceiver *getBcsForAuxTranslation() const;
|
||||
MOCKABLE_VIRTUAL CommandStreamReceiver &selectCsrForBuiltinOperation(const CsrSelectionArgs &args) const;
|
||||
Device &getDevice() const noexcept;
|
||||
ClDevice &getClDevice() const { return *device; }
|
||||
Context &getContext() const { return *context; }
|
||||
@ -409,8 +408,6 @@ class CommandQueue : public BaseObject<_cl_command_queue> {
|
||||
bool perfCountersEnabled = false;
|
||||
|
||||
bool isCopyOnly = false;
|
||||
bool bcsAllowed = false;
|
||||
bool bcsInitialized = false;
|
||||
|
||||
LinearStream *commandStream = nullptr;
|
||||
|
||||
|
@ -1067,7 +1067,7 @@ struct WaitUntilCompletionTests : public ::testing::Test {
|
||||
|
||||
MyCmdQueue(Context *context, ClDevice *device) : CommandQueueHw<Family>(context, device, nullptr, false){};
|
||||
|
||||
CommandStreamReceiver *getBcsCommandStreamReceiver(aub_stream::EngineType bcsEngineType) override {
|
||||
CommandStreamReceiver *getBcsCommandStreamReceiver(aub_stream::EngineType bcsEngineType) const override {
|
||||
return bcsCsrToReturn;
|
||||
}
|
||||
|
||||
|
@ -84,46 +84,6 @@ HWTEST2_F(CommandQueuePvcAndLaterTests, givenAdditionalBcsWhenCreatingCommandQue
|
||||
EXPECT_EQ(1u, queue->countBcsEngines());
|
||||
}
|
||||
|
||||
HWTEST2_F(CommandQueuePvcAndLaterTests, givenDeferCmdQBcsInitializationEnabledWhenCreateCommandQueueThenBcsCountIsZero, IsAtLeastXeHpcCore) {
|
||||
DebugManagerStateRestore restorer;
|
||||
DebugManager.flags.DeferCmdQBcsInitialization.set(1u);
|
||||
|
||||
HardwareInfo hwInfo = *defaultHwInfo;
|
||||
hwInfo.featureTable.ftrBcsInfo = maxNBitValue(9);
|
||||
hwInfo.capabilityTable.blitterOperationsSupported = true;
|
||||
MockDevice *device = MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hwInfo, 0);
|
||||
MockClDevice clDevice{device};
|
||||
cl_device_id clDeviceId = static_cast<cl_device_id>(&clDevice);
|
||||
ClDeviceVector clDevices{&clDeviceId, 1u};
|
||||
cl_int retVal{};
|
||||
auto context = std::unique_ptr<Context>{Context::create<Context>(nullptr, clDevices, nullptr, nullptr, retVal)};
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
auto queue = std::make_unique<MockCommandQueue>(*context);
|
||||
|
||||
EXPECT_EQ(0u, queue->countBcsEngines());
|
||||
}
|
||||
|
||||
HWTEST2_F(CommandQueuePvcAndLaterTests, givenDeferCmdQBcsInitializationDisabledWhenCreateCommandQueueThenBcsIsInitialized, IsAtLeastXeHpcCore) {
|
||||
DebugManagerStateRestore restorer;
|
||||
DebugManager.flags.DeferCmdQBcsInitialization.set(0u);
|
||||
|
||||
HardwareInfo hwInfo = *defaultHwInfo;
|
||||
hwInfo.featureTable.ftrBcsInfo = maxNBitValue(9);
|
||||
hwInfo.capabilityTable.blitterOperationsSupported = true;
|
||||
MockDevice *device = MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hwInfo, 0);
|
||||
MockClDevice clDevice{device};
|
||||
cl_device_id clDeviceId = static_cast<cl_device_id>(&clDevice);
|
||||
ClDeviceVector clDevices{&clDeviceId, 1u};
|
||||
cl_int retVal{};
|
||||
auto context = std::unique_ptr<Context>{Context::create<Context>(nullptr, clDevices, nullptr, nullptr, retVal)};
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
auto queue = std::make_unique<MockCommandQueue>(*context);
|
||||
|
||||
EXPECT_NE(0u, queue->countBcsEngines());
|
||||
}
|
||||
|
||||
HWTEST2_F(CommandQueuePvcAndLaterTests, givenQueueWithMainBcsIsReleasedWhenNewQueueIsCreatedThenMainBcsCanBeUsedAgain, IsAtLeastXeHpcCore) {
|
||||
HardwareInfo hwInfo = *defaultHwInfo;
|
||||
hwInfo.featureTable.ftrBcsInfo = maxNBitValue(9);
|
||||
@ -142,9 +102,9 @@ HWTEST2_F(CommandQueuePvcAndLaterTests, givenQueueWithMainBcsIsReleasedWhenNewQu
|
||||
auto queue4 = std::make_unique<MockCommandQueue>(*context);
|
||||
|
||||
EXPECT_EQ(aub_stream::EngineType::ENGINE_BCS, queue1->getBcsCommandStreamReceiver(aub_stream::ENGINE_BCS)->getOsContext().getEngineType());
|
||||
EXPECT_EQ(aub_stream::EngineType::ENGINE_BCS2, queue2->getBcsCommandStreamReceiver(aub_stream::ENGINE_BCS2)->getOsContext().getEngineType());
|
||||
EXPECT_EQ(aub_stream::EngineType::ENGINE_BCS1, queue3->getBcsCommandStreamReceiver(aub_stream::ENGINE_BCS1)->getOsContext().getEngineType());
|
||||
EXPECT_EQ(aub_stream::EngineType::ENGINE_BCS2, queue4->getBcsCommandStreamReceiver(aub_stream::ENGINE_BCS2)->getOsContext().getEngineType());
|
||||
EXPECT_EQ(aub_stream::EngineType::ENGINE_BCS1, queue2->getBcsCommandStreamReceiver(aub_stream::ENGINE_BCS1)->getOsContext().getEngineType());
|
||||
EXPECT_EQ(aub_stream::EngineType::ENGINE_BCS2, queue3->getBcsCommandStreamReceiver(aub_stream::ENGINE_BCS2)->getOsContext().getEngineType());
|
||||
EXPECT_EQ(aub_stream::EngineType::ENGINE_BCS1, queue4->getBcsCommandStreamReceiver(aub_stream::ENGINE_BCS1)->getOsContext().getEngineType());
|
||||
|
||||
// Releasing main BCS. Next creation should be able to grab it
|
||||
queue1.reset();
|
||||
@ -154,7 +114,7 @@ HWTEST2_F(CommandQueuePvcAndLaterTests, givenQueueWithMainBcsIsReleasedWhenNewQu
|
||||
// Releasing link BCS. Shouldn't change anything
|
||||
queue2.reset();
|
||||
queue2 = std::make_unique<MockCommandQueue>(*context);
|
||||
EXPECT_EQ(aub_stream::EngineType::ENGINE_BCS1, queue2->getBcsCommandStreamReceiver(aub_stream::ENGINE_BCS1)->getOsContext().getEngineType());
|
||||
EXPECT_EQ(aub_stream::EngineType::ENGINE_BCS2, queue2->getBcsCommandStreamReceiver(aub_stream::ENGINE_BCS2)->getOsContext().getEngineType());
|
||||
}
|
||||
|
||||
HWTEST2_F(CommandQueuePvcAndLaterTests, givenCooperativeEngineUsageHintAndCcsWhenCreatingCommandQueueThenCreateQueueWithCooperativeEngine, IsAtLeastXeHpcCore) {
|
||||
@ -495,10 +455,10 @@ HWTEST2_F(BcsCsrSelectionCommandQueueTests, givenMultipleEnginesInQueueWhenSelec
|
||||
aub_stream::ENGINE_BCS7,
|
||||
aub_stream::ENGINE_BCS8,
|
||||
});
|
||||
EXPECT_EQ(queue->getBcsCommandStreamReceiver(aub_stream::ENGINE_BCS2), &queue->selectCsrForBuiltinOperation(args));
|
||||
EXPECT_EQ(queue->getBcsCommandStreamReceiver(aub_stream::ENGINE_BCS1), &queue->selectCsrForBuiltinOperation(args));
|
||||
EXPECT_EQ(queue->getBcsCommandStreamReceiver(aub_stream::ENGINE_BCS2), &queue->selectCsrForBuiltinOperation(args));
|
||||
EXPECT_EQ(queue->getBcsCommandStreamReceiver(aub_stream::ENGINE_BCS1), &queue->selectCsrForBuiltinOperation(args));
|
||||
EXPECT_EQ(queue->getBcsCommandStreamReceiver(aub_stream::ENGINE_BCS2), &queue->selectCsrForBuiltinOperation(args));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -144,7 +144,6 @@ TEST(Event, givenBcsCsrSetInEventWhenPeekingBcsTaskCountThenReturnCorrectTaskCou
|
||||
new MockClDevice{MockDevice::createWithNewExecutionEnvironment<MockAlignedMallocManagerDevice>(&hwInfo)}};
|
||||
MockContext context{device.get()};
|
||||
MockCommandQueue queue{context};
|
||||
queue.initializeBcsEngine(false);
|
||||
queue.updateBcsTaskCount(queue.bcsEngines[0]->getEngineType(), 19);
|
||||
Event event{&queue, CL_COMMAND_READ_BUFFER, 0, 0};
|
||||
|
||||
|
@ -257,7 +257,6 @@ class MockCommandQueueHw : public CommandQueueHw<GfxFamily> {
|
||||
MockCommandQueueHw(Context *context,
|
||||
ClDevice *device,
|
||||
cl_queue_properties *properties) : BaseClass(context, device, properties, false) {
|
||||
this->initializeBcsEngine(false);
|
||||
}
|
||||
|
||||
void clearBcsEngines() {
|
||||
|
@ -382,7 +382,6 @@ ForceExtendedKernelIsaSize = -1
|
||||
MakeIndirectAllocationsResidentAsPack = -1
|
||||
MakeEachAllocationResident = -1
|
||||
AssignBCSAtEnqueue = -1
|
||||
DeferCmdQBcsInitialization = -1
|
||||
ReuseKernelBinaries = -1
|
||||
EnableChipsetUniqueUUID = -1
|
||||
ForceSimdMessageSizeInWalker = -1
|
||||
|
@ -267,7 +267,6 @@ DECLARE_DEBUG_VARIABLE(int32_t, ResolveDependenciesViaPipeControls, -1, "-1: def
|
||||
DECLARE_DEBUG_VARIABLE(int32_t, MakeIndirectAllocationsResidentAsPack, -1, "-1: default, 0:disabled, 1: enabled. If enabled, driver handles all indirect allocations as one pack instead of making them resident individually.")
|
||||
DECLARE_DEBUG_VARIABLE(int32_t, MakeEachAllocationResident, -1, "-1: default, 0: disabled, 1: bind every allocation at creation time, 2: bind all created allocations in flush")
|
||||
DECLARE_DEBUG_VARIABLE(int32_t, AssignBCSAtEnqueue, -1, "-1: default, 0:disabled, 1: enabled.")
|
||||
DECLARE_DEBUG_VARIABLE(int32_t, DeferCmdQBcsInitialization, -1, "-1: default, 0:disabled, 1: enabled.")
|
||||
DECLARE_DEBUG_VARIABLE(int32_t, ReuseKernelBinaries, -1, "-1: default, 0:disabled, 1: enabled. If enabled, driver reuses kernel binaries.")
|
||||
|
||||
/*DIRECT SUBMISSION FLAGS*/
|
||||
|
Reference in New Issue
Block a user