mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-21 09:14:47 +08:00
Improve control of explicit residency flag
Signed-off-by: Milczarek, Slawomir <slawomir.milczarek@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
3e5d68deab
commit
8cf3e8ca94
@@ -73,6 +73,7 @@ void DrmAllocation::makeBOsResident(OsContext *osContext, uint32_t vmHandleId, s
|
||||
|
||||
void DrmAllocation::bindBO(BufferObject *bo, OsContext *osContext, uint32_t vmHandleId, std::vector<BufferObject *> *bufferObjects, bool bind) {
|
||||
if (bo) {
|
||||
bo->requireExplicitResidency(bo->peekDrm()->hasPageFaultSupport() && !shouldAllocationPageFault(bo->peekDrm()));
|
||||
if (bufferObjects) {
|
||||
if (bo->peekIsReusableAllocation()) {
|
||||
for (auto bufferObject : *bufferObjects) {
|
||||
@@ -138,7 +139,6 @@ void DrmAllocation::registerBOBindExtHandle(Drm *drm) {
|
||||
}
|
||||
|
||||
bo->requireImmediateBinding(true);
|
||||
bo->requireExplicitResidency(!shouldAllocationPageFault(drm));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ class DrmAllocation : public GraphicsAllocation {
|
||||
void freeRegisteredBOBindExtHandles(Drm *drm);
|
||||
void linkWithRegisteredHandle(uint32_t handle);
|
||||
MOCKABLE_VIRTUAL void markForCapture();
|
||||
bool shouldAllocationPageFault(Drm *drm);
|
||||
MOCKABLE_VIRTUAL bool shouldAllocationPageFault(const Drm *drm);
|
||||
|
||||
protected:
|
||||
BufferObjects bufferObjects{};
|
||||
|
||||
@@ -42,7 +42,7 @@ bool DrmAllocation::setMemAdvise(Drm *drm, MemAdviseFlags flags) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool DrmAllocation::shouldAllocationPageFault(Drm *drm) {
|
||||
bool DrmAllocation::shouldAllocationPageFault(const Drm *drm) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -37,6 +37,7 @@ BufferObject::BufferObject(Drm *drm, int handle, size_t size, size_t maxOsContex
|
||||
this->lockedAddress = nullptr;
|
||||
|
||||
perContextVmsUsed = drm->isPerContextVMRequired();
|
||||
requiresExplicitResidency = drm->hasPageFaultSupport();
|
||||
|
||||
if (perContextVmsUsed) {
|
||||
bindInfo.resize(maxOsContextCount);
|
||||
|
||||
@@ -876,4 +876,8 @@ int Drm::getMaxGpuFrequency(HardwareInfo &hwInfo, int &maxGpuFrequency) {
|
||||
return getMaxGpuFrequencyOfDevice(*this, sysFsPciPath, maxGpuFrequency);
|
||||
}
|
||||
|
||||
bool Drm::hasPageFaultSupport() const {
|
||||
return pageFaultSupported;
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
@@ -173,7 +173,7 @@ class Drm : public DriverModel {
|
||||
MOCKABLE_VIRTUAL bool registerResourceClasses();
|
||||
|
||||
void queryPageFaultSupport();
|
||||
bool hasPageFaultSupport();
|
||||
bool hasPageFaultSupport() const;
|
||||
|
||||
MOCKABLE_VIRTUAL uint32_t registerResource(ResourceClass classType, const void *data, size_t size);
|
||||
MOCKABLE_VIRTUAL void unregisterResource(uint32_t handle);
|
||||
|
||||
@@ -74,8 +74,4 @@ void Drm::appendDrmContextFlags(drm_i915_gem_context_create_ext &gcc, bool isSpe
|
||||
void Drm::queryPageFaultSupport() {
|
||||
}
|
||||
|
||||
bool Drm::hasPageFaultSupport() {
|
||||
return false;
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
Reference in New Issue
Block a user