Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion src/common/unix/nvidia-push/src/nvidia-push.c
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@ static NvBool nvWriteGpEntry(

NvU32 nextGpPut;
NvU32 *gpPointer;
NvU64 baseTime, currentTime;
const NvU32 entriesNeeded = NV_PUSH_NUM_GPFIFO_ENTRIES_PER_KICKOFF;
NvPushDevicePtr pDevice = push_buffer->pDevice;

Expand All @@ -359,11 +360,21 @@ static NvBool nvWriteGpEntry(
nvAssert((nextGpPut % 2) == 0);

// Wait for a free entry in the buffer
while (nextGpPut == ReadGpGetOffset(push_buffer)) {
for (baseTime = currentTime = nvPushImportGetMilliSeconds(pDevice);
nextGpPut == ReadGpGetOffset(push_buffer);
currentTime = nvPushImportGetMilliSeconds(pDevice)) {

if (nvPushCheckChannelError(push_buffer)) {
nvAssert(!"A channel error occurred in nvWriteGpEntry()");
return FALSE;
}

if (currentTime > (baseTime + NV_PUSH_NOTIFIER_SHORT_TIMEOUT) &&
!push_buffer->noTimeout) {
nvPushImportLogError(pDevice,
"Timed out waiting for a free GPFIFO entry.");
return FALSE;
}
}
gpPointer[0] = gpEntry0;
gpPointer[1] = gpEntry1;
Expand Down