Change makeResidentResidencyAllocations argument to a reference

Change-Id: I7e8a73fdbe5371e29a53ec34201eddb42cb7f20a
Signed-off-by: Maciej Dziuban <maciej.dziuban@intel.com>
This commit is contained in:
Maciej Dziuban
2018-09-25 11:34:16 +02:00
parent c04d14f3bc
commit 9804bddd46
4 changed files with 17 additions and 19 deletions

View File

@@ -139,7 +139,7 @@ void WddmCommandStreamReceiver<GfxFamily>::makeResident(GraphicsAllocation &gfxA
template <typename GfxFamily>
void WddmCommandStreamReceiver<GfxFamily>::processResidency(ResidencyContainer &allocationsForResidency, OsContext &osContext) {
bool success = getMemoryManager()->makeResidentResidencyAllocations(&allocationsForResidency, osContext);
bool success = getMemoryManager()->makeResidentResidencyAllocations(allocationsForResidency, osContext);
DEBUG_BREAK_IF(!success);
}

View File

@@ -452,10 +452,8 @@ uint64_t WddmMemoryManager::getInternalHeapBaseAddress() {
return this->wddm->getGfxPartition().Heap32[1].Base;
}
bool WddmMemoryManager::makeResidentResidencyAllocations(ResidencyContainer *allocationsForResidency, OsContext &osContext) {
DEBUG_BREAK_IF(allocationsForResidency == nullptr);
size_t residencyCount = allocationsForResidency->size();
bool WddmMemoryManager::makeResidentResidencyAllocations(ResidencyContainer &allocationsForResidency, OsContext &osContext) {
size_t residencyCount = allocationsForResidency.size();
std::unique_ptr<D3DKMT_HANDLE[]> handlesForResidency(new D3DKMT_HANDLE[residencyCount * max_fragments_count]);
uint32_t totalHandlesCount = 0;
@@ -465,7 +463,7 @@ bool WddmMemoryManager::makeResidentResidencyAllocations(ResidencyContainer *all
DBG_LOG(ResidencyDebugEnable, "Residency:", __FUNCTION__, "currentFenceValue =", osContext.get()->getMonitoredFence().currentFenceValue);
for (uint32_t i = 0; i < residencyCount; i++) {
WddmAllocation *allocation = reinterpret_cast<WddmAllocation *>((*allocationsForResidency)[i]);
WddmAllocation *allocation = reinterpret_cast<WddmAllocation *>(allocationsForResidency[i]);
bool mainResidency = false;
bool fragmentResidency[3] = {false, false, false};
@@ -515,7 +513,7 @@ bool WddmMemoryManager::makeResidentResidencyAllocations(ResidencyContainer *all
if (result == true) {
for (uint32_t i = 0; i < residencyCount; i++) {
WddmAllocation *allocation = reinterpret_cast<WddmAllocation *>((*allocationsForResidency)[i]);
WddmAllocation *allocation = reinterpret_cast<WddmAllocation *>(allocationsForResidency[i]);
// Update fence value not to early destroy / evict allocation
auto currentFence = osContext.get()->getMonitoredFence().currentFenceValue;
allocation->getResidencyData().updateCompletionData(currentFence, &osContext);

View File

@@ -49,7 +49,7 @@ class WddmMemoryManager : public MemoryManager {
void *lockResource(GraphicsAllocation *graphicsAllocation) override;
void unlockResource(GraphicsAllocation *graphicsAllocation) override;
bool makeResidentResidencyAllocations(ResidencyContainer *allocationsForResidency, OsContext &osContext);
bool makeResidentResidencyAllocations(ResidencyContainer &allocationsForResidency, OsContext &osContext);
void makeNonResidentEvictionAllocations(ResidencyContainer &evictionAllocations);
AllocationStatus populateOsHandles(OsHandleStorage &handleStorage) override;