Improve wait function for Fence object

Related-To: NEO-6242

Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
Zbigniew Zdanowicz
2022-03-17 09:43:17 +00:00
committed by Compute-Runtime-Automation
parent cf9a5ed7d7
commit 814b0ecb87
3 changed files with 64 additions and 5 deletions

View File

@@ -366,7 +366,15 @@ WaitStatus CommandStreamReceiver::baseWaitFunction(volatile uint32_t *pollAddres
partitionAddress = ptrOffset(partitionAddress, this->postSyncWriteOffset);
}
return testTaskCountReady(pollAddress, taskCountToWait) ? WaitStatus::Ready : WaitStatus::NotReady;
partitionAddress = pollAddress;
for (uint32_t i = 0; i < activePartitions; i++) {
if (*partitionAddress < taskCountToWait) {
return WaitStatus::NotReady;
}
partitionAddress = ptrOffset(partitionAddress, this->postSyncWriteOffset);
}
return WaitStatus::Ready;
}
void CommandStreamReceiver::setTagAllocation(GraphicsAllocation *allocation) {
@@ -800,7 +808,7 @@ bool CommandStreamReceiver::checkImplicitFlushForGpuIdle() {
bool CommandStreamReceiver::testTaskCountReady(volatile uint32_t *pollAddress, uint32_t taskCountToWait) {
for (uint32_t i = 0; i < activePartitions; i++) {
if (*pollAddress < taskCountToWait) {
if (!WaitUtils::waitFunction(pollAddress, taskCountToWait)) {
return false;
}