Store residency status for each osContext separately

Change-Id: I2f17f68dcef6db7b596a69579a435b7ccd24e44b
Signed-off-by: Maciej Dziuban <maciej.dziuban@intel.com>
This commit is contained in:
Maciej Dziuban
2018-11-28 11:01:41 +01:00
committed by sys_ocldev
parent 6be8aee45d
commit 1cd59e927a
8 changed files with 97 additions and 86 deletions

View File

@@ -111,9 +111,10 @@ void DrmCommandStreamReceiver<GfxFamily>::processResidency(ResidencyContainer &i
auto drmAlloc = static_cast<DrmAllocation *>(alloc);
if (drmAlloc->fragmentsStorage.fragmentCount) {
for (unsigned int f = 0; f < drmAlloc->fragmentsStorage.fragmentCount; f++) {
if (!drmAlloc->fragmentsStorage.fragmentStorageData[f].residency->resident) {
const auto osContextId = osContext->getContextId();
if (!drmAlloc->fragmentsStorage.fragmentStorageData[f].residency->resident[osContextId]) {
makeResident(drmAlloc->fragmentsStorage.fragmentStorageData[f].osHandleStorage->bo);
drmAlloc->fragmentsStorage.fragmentStorageData[f].residency->resident = true;
drmAlloc->fragmentsStorage.fragmentStorageData[f].residency->resident[osContextId] = true;
}
}
} else {
@@ -134,7 +135,7 @@ void DrmCommandStreamReceiver<GfxFamily>::makeNonResident(GraphicsAllocation &gf
}
if (gfxAllocation.fragmentsStorage.fragmentCount) {
for (auto fragmentId = 0u; fragmentId < gfxAllocation.fragmentsStorage.fragmentCount; fragmentId++) {
gfxAllocation.fragmentsStorage.fragmentStorageData[fragmentId].residency->resident = false;
gfxAllocation.fragmentsStorage.fragmentStorageData[fragmentId].residency->resident[osContext->getContextId()] = false;
}
}
}