mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-21 01:04:57 +08:00
fix: set correct initial DirectSubmission fence value
Related-To: HSD-18039278676 Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
85c8c09990
commit
4fc37f9afd
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022-2023 Intel Corporation
|
||||
* Copyright (C) 2022-2024 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -15,6 +15,7 @@ DirectSubmissionInputParams::DirectSubmissionInputParams(const CommandStreamRece
|
||||
globalFenceAllocation = commandStreamReceiver.getGlobalFenceAllocation();
|
||||
workPartitionAllocation = commandStreamReceiver.getWorkPartitionAllocation();
|
||||
completionFenceAllocation = commandStreamReceiver.getTagAllocation();
|
||||
initialCompletionFenceValue = commandStreamReceiver.peekLatestSentTaskCount();
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
@@ -68,6 +68,7 @@ struct DirectSubmissionInputParams : NonCopyableClass {
|
||||
const GraphicsAllocation *globalFenceAllocation = nullptr;
|
||||
GraphicsAllocation *workPartitionAllocation = nullptr;
|
||||
GraphicsAllocation *completionFenceAllocation = nullptr;
|
||||
TaskCountType initialCompletionFenceValue = 0;
|
||||
const uint32_t rootDeviceIndex;
|
||||
};
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ template <typename GfxFamily, typename Dispatcher>
|
||||
DrmDirectSubmission<GfxFamily, Dispatcher>::DrmDirectSubmission(const DirectSubmissionInputParams &inputParams)
|
||||
: DirectSubmissionHw<GfxFamily, Dispatcher>(inputParams) {
|
||||
|
||||
this->completionFenceValue = inputParams.initialCompletionFenceValue;
|
||||
if (debugManager.flags.OverrideUserFenceStartValue.get() != -1) {
|
||||
this->completionFenceValue = static_cast<decltype(completionFenceValue)>(debugManager.flags.OverrideUserFenceStartValue.get());
|
||||
}
|
||||
|
||||
@@ -204,6 +204,24 @@ HWTEST_F(DrmDirectSubmissionTest, givenDebugFlagSetWhenInitializingThenOverrideF
|
||||
EXPECT_EQ(fenceStartValue, directSubmission.completionFenceValue);
|
||||
}
|
||||
|
||||
HWTEST_F(DrmDirectSubmissionTest, givenLatestSentTaskCountWhenInitializingThenSetStartValue) {
|
||||
DebugManagerStateRestore restorer;
|
||||
|
||||
TaskCountType fenceStartValue = 1234;
|
||||
|
||||
debugManager.flags.EnableDrmCompletionFence.set(1);
|
||||
auto &commandStreamReceiver = device->getUltCommandStreamReceiver<FamilyType>();
|
||||
|
||||
commandStreamReceiver.latestSentTaskCount = fenceStartValue;
|
||||
|
||||
auto drm = executionEnvironment.rootDeviceEnvironments[0]->osInterface->getDriverModel()->as<Drm>();
|
||||
|
||||
ASSERT_TRUE(drm->completionFenceSupport());
|
||||
|
||||
MockDrmDirectSubmission<FamilyType, RenderDispatcher<FamilyType>> directSubmission(commandStreamReceiver);
|
||||
EXPECT_EQ(fenceStartValue, directSubmission.completionFenceValue);
|
||||
}
|
||||
|
||||
HWTEST_F(DrmDirectSubmissionTest, givenNoCompletionFenceSupportWhenGettingCompletionFencePointerThenNullptrIsReturned) {
|
||||
DebugManagerStateRestore restorer;
|
||||
debugManager.flags.EnableDrmCompletionFence.set(0);
|
||||
|
||||
Reference in New Issue
Block a user