Expose GfxPartition to shared MemoryManager

Change-Id: I039e463f90e88c0ed8e9505cc770c373420ff567
Signed-off-by: Venevtsev, Igor <igor.venevtsev@intel.com>
This commit is contained in:
Venevtsev, Igor
2019-03-01 16:14:28 +01:00
committed by sys_ocldev
parent de212138b7
commit 74f1896c03
18 changed files with 343 additions and 17 deletions

View File

@@ -12,6 +12,7 @@
#include "runtime/gmm_helper/gmm.h"
#include "runtime/gmm_helper/gmm_helper.h"
#include "runtime/gmm_helper/resource_info.h"
#include "runtime/helpers/hw_info.h"
#include "runtime/helpers/options.h"
#include "runtime/helpers/ptr_math.h"
#include "runtime/helpers/surface_formats.h"
@@ -31,6 +32,7 @@ DrmMemoryManager::DrmMemoryManager(Drm *drm, gemCloseWorkerMode mode, bool force
pinBB(nullptr),
forcePinEnabled(forcePinAllowed),
validateHostPtrMemory(validateHostPtrMemory) {
gfxPartition.init(platformDevices[0]->capabilityTable.gpuAddressSpace);
MemoryManager::virtualPaddingAvailable = true;
if (mode != gemCloseWorkerMode::gemCloseWorkerInactive) {
gemCloseWorker.reset(new DrmGemCloseWorker(*this));

View File

@@ -797,6 +797,21 @@ bool Wddm::waitFromCpu(uint64_t lastFenceValue, const MonitoredFence &monitoredF
return status == STATUS_SUCCESS;
}
void Wddm::initGfxPartition(GfxPartition &outGfxPartition) const {
if (gfxPartition.SVM.Limit != 0) {
outGfxPartition.heapInit(HeapIndex::HEAP_SVM, gfxPartition.SVM.Base, gfxPartition.SVM.Limit - gfxPartition.SVM.Base + 1);
}
outGfxPartition.heapInit(HeapIndex::HEAP_STANDARD, gfxPartition.Standard.Base, gfxPartition.Standard.Limit - gfxPartition.Standard.Base + 1);
outGfxPartition.heapInit(HeapIndex::HEAP_STANDARD64KB, gfxPartition.Standard64KB.Base, gfxPartition.Standard64KB.Limit - gfxPartition.Standard64KB.Base + 1);
for (auto heap : GfxPartition::heap32Names) {
outGfxPartition.heapInit(heap, gfxPartition.Heap32[static_cast<uint32_t>(heap)].Base,
gfxPartition.Heap32[static_cast<uint32_t>(heap)].Limit - gfxPartition.Heap32[static_cast<uint32_t>(heap)].Base + 1);
}
}
uint64_t Wddm::getSystemSharedMemory() const {
return systemSharedMemory;
}

View File

@@ -9,6 +9,7 @@
#include "runtime/command_stream/preemption_mode.h"
#include "runtime/gmm_helper/gmm_lib.h"
#include "runtime/helpers/debug_helpers.h"
#include "runtime/memory_manager/gfx_partition.h"
#include "runtime/os_interface/os_context.h"
#include "runtime/utilities/spinlock.h"
@@ -106,6 +107,8 @@ class Wddm {
return gfxPartition;
}
void initGfxPartition(GfxPartition &outGfxPartition) const;
const std::string &getDeviceRegistryPath() const {
return deviceRegistryPath;
}

View File

@@ -40,6 +40,7 @@ WddmMemoryManager::WddmMemoryManager(bool enable64kbPages, bool enableLocalMemor
if (asyncDeleterEnabled)
deferredDeleter = createDeferredDeleter();
mallocRestrictions.minAddress = wddm->getWddmMinAddress();
wddm->initGfxPartition(gfxPartition);
}
GraphicsAllocation *WddmMemoryManager::allocateGraphicsMemoryForImageImpl(const AllocationData &allocationData, std::unique_ptr<Gmm> gmm) {