Fix indexing of allocated bos in populateOsHandles

- when fragment is already allocated, allcoating is
skipped and index is incremented,
separate index must be used for allocated bos array

Change-Id: I856a99ba4ebdad5375829a43d721c7e1490b18d3
This commit is contained in:
Hoppe, Mateusz
2018-03-15 11:58:31 +01:00
parent 894060de50
commit 756aafe3dd
3 changed files with 71 additions and 2 deletions

View File

@@ -58,7 +58,7 @@ class BufferObject {
bool setTiling(uint32_t mode, uint32_t stride);
int pin(BufferObject *boToPin[], size_t numberOfBos);
MOCKABLE_VIRTUAL int pin(BufferObject *boToPin[], size_t numberOfBos);
int exec(uint32_t used, size_t startOffset, unsigned int flags, bool requiresCoherency = false, bool lowPriority = false);

View File

@@ -492,7 +492,7 @@ MemoryManager::AllocationStatus DrmMemoryManager::populateOsHandles(OsHandleStor
return AllocationStatus::Error;
}
allocatedBos[i] = handleStorage.fragmentStorageData[i].osHandleStorage->bo;
allocatedBos[numberOfBosAllocated] = handleStorage.fragmentStorageData[i].osHandleStorage->bo;
numberOfBosAllocated++;
hostPtrManager.storeFragment(handleStorage.fragmentStorageData[i]);