fix: Reset direct submission when reinitialize context

Resolves: HSD-15018564496
Related-To: NEO-16651

Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
Lukasz Jobczyk
2025-11-04 12:18:20 +00:00
committed by Compute-Runtime-Automation
parent 5cf3eeb615
commit 498f62d7a0
5 changed files with 22 additions and 0 deletions

View File

@@ -380,6 +380,7 @@ class CommandStreamReceiver : NEO::NonCopyableAndNonMovableClass {
}
virtual void stopDirectSubmission(bool blocking, bool needsLock) {}
virtual void resetDirectSubmission(){};
virtual QueueThrottle getLastDirectSubmissionThrottle() = 0;

View File

@@ -159,6 +159,7 @@ class CommandStreamReceiverHw : public CommandStreamReceiver {
uint32_t getDirectSubmissionRelaxedOrderingQueueDepth() const override;
void stopDirectSubmission(bool blocking, bool needsLock) override;
void resetDirectSubmission() override;
QueueThrottle getLastDirectSubmissionThrottle() override;

View File

@@ -1430,6 +1430,13 @@ inline void CommandStreamReceiverHw<GfxFamily>::stopDirectSubmission(bool blocki
}
}
template <typename GfxFamily>
inline void CommandStreamReceiverHw<GfxFamily>::resetDirectSubmission() {
this->unregisterDirectSubmissionFromController();
this->blitterDirectSubmission.reset();
this->directSubmission.reset();
}
template <typename GfxFamily>
inline QueueThrottle CommandStreamReceiverHw<GfxFamily>::getLastDirectSubmissionThrottle() {
if (this->isAnyDirectSubmissionEnabled()) {

View File

@@ -996,6 +996,17 @@ struct MockWddmDrmDirectSubmissionDispatchCommandBuffer : public MockWddmDirectS
uint32_t lastNotifyKmdParamValue = false;
};
HWTEST_TEMPLATED_F(WddmCommandStreamMockGdiTest, givenCsrWhenResetDirectSubmissionThenObjectDeleted) {
using Dispatcher = RenderDispatcher<FamilyType>;
using MockSubmission = MockWddmDrmDirectSubmissionDispatchCommandBuffer<FamilyType, Dispatcher>;
auto mockCsr = static_cast<MockWddmCsr<FamilyType> *>(csr);
mockCsr->directSubmission = std::make_unique<MockSubmission>(*device->getDefaultEngine().commandStreamReceiver);
mockCsr->resetDirectSubmission();
EXPECT_EQ(mockCsr->directSubmission.get(), nullptr);
}
HWTEST_TEMPLATED_F(WddmCommandStreamMockGdiTest, givenCsrWhenFlushMonitorFenceThenFlushMonitorFenceOnDirectSubmission) {
using Dispatcher = RenderDispatcher<FamilyType>;
using MockSubmission = MockWddmDrmDirectSubmissionDispatchCommandBuffer<FamilyType, Dispatcher>;