mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 23:03:02 +08:00
refactor: correct naming of enum class constants 6/n
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
b802ebf7b7
commit
739d181026
@@ -52,10 +52,10 @@ WddmCommandStreamReceiver<GfxFamily>::WddmCommandStreamReceiver(ExecutionEnviron
|
||||
commandBufferHeader->NeedsMidBatchPreEmptionSupport = true;
|
||||
}
|
||||
|
||||
this->dispatchMode = DispatchMode::BatchedDispatch;
|
||||
this->dispatchMode = DispatchMode::batchedDispatch;
|
||||
|
||||
if (ApiSpecificConfig::getApiType() == ApiSpecificConfig::L0) {
|
||||
this->dispatchMode = DispatchMode::ImmediateDispatch;
|
||||
this->dispatchMode = DispatchMode::immediateDispatch;
|
||||
}
|
||||
|
||||
if (debugManager.flags.CsrDispatchMode.get()) {
|
||||
@@ -79,7 +79,7 @@ SubmissionStatus WddmCommandStreamReceiver<GfxFamily>::flush(BatchBuffer &batchB
|
||||
perfLogResidencyVariadicLog(wddm->getResidencyLogger(), "Wddm CSR processing residency set: %zu\n", allocationsForResidency.size());
|
||||
|
||||
auto submissionStatus = this->processResidency(allocationsForResidency, 0u);
|
||||
if (submissionStatus != SubmissionStatus::SUCCESS) {
|
||||
if (submissionStatus != SubmissionStatus::success) {
|
||||
return submissionStatus;
|
||||
}
|
||||
batchBuffer.allocationsForResidency = &allocationsForResidency;
|
||||
@@ -87,17 +87,17 @@ SubmissionStatus WddmCommandStreamReceiver<GfxFamily>::flush(BatchBuffer &batchB
|
||||
this->startControllingDirectSubmissions();
|
||||
auto ret = this->directSubmission->dispatchCommandBuffer(batchBuffer, *(this->flushStamp.get()));
|
||||
if (ret == false) {
|
||||
return SubmissionStatus::FAILED;
|
||||
return SubmissionStatus::failed;
|
||||
}
|
||||
return SubmissionStatus::SUCCESS;
|
||||
return SubmissionStatus::success;
|
||||
}
|
||||
if (this->blitterDirectSubmission.get()) {
|
||||
this->startControllingDirectSubmissions();
|
||||
auto ret = this->blitterDirectSubmission->dispatchCommandBuffer(batchBuffer, *(this->flushStamp.get()));
|
||||
if (ret == false) {
|
||||
return SubmissionStatus::FAILED;
|
||||
return SubmissionStatus::failed;
|
||||
}
|
||||
return SubmissionStatus::SUCCESS;
|
||||
return SubmissionStatus::success;
|
||||
}
|
||||
|
||||
COMMAND_BUFFER_HEADER *pHeader = reinterpret_cast<COMMAND_BUFFER_HEADER *>(commandBufferHeader);
|
||||
@@ -130,15 +130,15 @@ SubmissionStatus WddmCommandStreamReceiver<GfxFamily>::flush(BatchBuffer &batchB
|
||||
|
||||
this->flushStamp->setStamp(submitArgs.monitorFence->lastSubmittedFence);
|
||||
if (status == false) {
|
||||
return SubmissionStatus::FAILED;
|
||||
return SubmissionStatus::failed;
|
||||
}
|
||||
|
||||
return SubmissionStatus::SUCCESS;
|
||||
return SubmissionStatus::success;
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
SubmissionStatus WddmCommandStreamReceiver<GfxFamily>::processResidency(const ResidencyContainer &allocationsForResidency, uint32_t handleId) {
|
||||
return static_cast<OsContextWin *>(this->osContext)->getResidencyController().makeResidentResidencyAllocations(allocationsForResidency) ? SubmissionStatus::SUCCESS : SubmissionStatus::OUT_OF_MEMORY;
|
||||
return static_cast<OsContextWin *>(this->osContext)->getResidencyController().makeResidentResidencyAllocations(allocationsForResidency) ? SubmissionStatus::success : SubmissionStatus::outOfMemory;
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
|
||||
@@ -675,7 +675,7 @@ void WddmMemoryManager::unlockResourceImpl(GraphicsAllocation &graphicsAllocatio
|
||||
getWddm(graphicsAllocation.getRootDeviceIndex()).unlockResource(wddmAllocation.getDefaultHandle());
|
||||
if (wddmAllocation.needsMakeResidentBeforeLock) {
|
||||
[[maybe_unused]] auto evictionStatus = getWddm(graphicsAllocation.getRootDeviceIndex()).getTemporaryResourcesContainer()->evictResource(wddmAllocation.getDefaultHandle());
|
||||
DEBUG_BREAK_IF(evictionStatus == MemoryOperationsStatus::FAILED);
|
||||
DEBUG_BREAK_IF(evictionStatus == MemoryOperationsStatus::failed);
|
||||
}
|
||||
}
|
||||
void WddmMemoryManager::freeAssociatedResourceImpl(GraphicsAllocation &graphicsAllocation) {
|
||||
|
||||
@@ -20,7 +20,7 @@ WddmResidentAllocationsContainer::~WddmResidentAllocationsContainer() {
|
||||
MemoryOperationsStatus WddmResidentAllocationsContainer::isAllocationResident(const D3DKMT_HANDLE &handle) {
|
||||
auto lock = acquireLock(resourcesLock);
|
||||
auto position = std::find(resourceHandles.begin(), resourceHandles.end(), handle);
|
||||
return position != resourceHandles.end() ? MemoryOperationsStatus::SUCCESS : MemoryOperationsStatus::MEMORY_NOT_FOUND;
|
||||
return position != resourceHandles.end() ? MemoryOperationsStatus::success : MemoryOperationsStatus::memoryNotFound;
|
||||
}
|
||||
|
||||
MemoryOperationsStatus WddmResidentAllocationsContainer::evictAllResources() {
|
||||
@@ -32,12 +32,12 @@ MemoryOperationsStatus WddmResidentAllocationsContainer::evictAllResourcesNoLock
|
||||
decltype(resourceHandles) resourcesToEvict;
|
||||
resourceHandles.swap(resourcesToEvict);
|
||||
if (resourcesToEvict.empty()) {
|
||||
return MemoryOperationsStatus::MEMORY_NOT_FOUND;
|
||||
return MemoryOperationsStatus::memoryNotFound;
|
||||
}
|
||||
uint64_t sizeToTrim = 0;
|
||||
uint32_t evictedResources = static_cast<uint32_t>(resourcesToEvict.size());
|
||||
bool success = wddm->evict(resourcesToEvict.data(), evictedResources, sizeToTrim, true);
|
||||
return success ? MemoryOperationsStatus::SUCCESS : MemoryOperationsStatus::FAILED;
|
||||
return success ? MemoryOperationsStatus::success : MemoryOperationsStatus::failed;
|
||||
}
|
||||
|
||||
MemoryOperationsStatus WddmResidentAllocationsContainer::evictResource(const D3DKMT_HANDLE &handle) {
|
||||
@@ -48,16 +48,16 @@ MemoryOperationsStatus WddmResidentAllocationsContainer::evictResources(const D3
|
||||
auto lock = acquireLock(resourcesLock);
|
||||
auto position = std::find(resourceHandles.begin(), resourceHandles.end(), handles[0]);
|
||||
if (position == resourceHandles.end()) {
|
||||
return MemoryOperationsStatus::MEMORY_NOT_FOUND;
|
||||
return MemoryOperationsStatus::memoryNotFound;
|
||||
}
|
||||
auto distance = static_cast<size_t>(std::distance(resourceHandles.begin(), position));
|
||||
UNRECOVERABLE_IF(distance + count > resourceHandles.size());
|
||||
resourceHandles.erase(position, position + count);
|
||||
uint64_t sizeToTrim = 0;
|
||||
if (!wddm->evict(handles, count, sizeToTrim, true)) {
|
||||
return MemoryOperationsStatus::FAILED;
|
||||
return MemoryOperationsStatus::failed;
|
||||
}
|
||||
return MemoryOperationsStatus::SUCCESS;
|
||||
return MemoryOperationsStatus::success;
|
||||
}
|
||||
|
||||
MemoryOperationsStatus WddmResidentAllocationsContainer::makeResidentResource(const D3DKMT_HANDLE &handle, size_t size) {
|
||||
@@ -67,12 +67,12 @@ MemoryOperationsStatus WddmResidentAllocationsContainer::makeResidentResource(co
|
||||
MemoryOperationsStatus WddmResidentAllocationsContainer::makeResidentResources(const D3DKMT_HANDLE *handles, const uint32_t count, size_t size) {
|
||||
bool madeResident = false;
|
||||
while (!(madeResident = wddm->makeResident(handles, count, false, nullptr, size))) {
|
||||
if (evictAllResources() == MemoryOperationsStatus::SUCCESS) {
|
||||
if (evictAllResources() == MemoryOperationsStatus::success) {
|
||||
continue;
|
||||
}
|
||||
if (!wddm->makeResident(handles, count, false, nullptr, size)) {
|
||||
DEBUG_BREAK_IF(true);
|
||||
return MemoryOperationsStatus::OUT_OF_MEMORY;
|
||||
return MemoryOperationsStatus::outOfMemory;
|
||||
};
|
||||
break;
|
||||
}
|
||||
@@ -83,7 +83,7 @@ MemoryOperationsStatus WddmResidentAllocationsContainer::makeResidentResources(c
|
||||
}
|
||||
lock.unlock();
|
||||
wddm->waitOnPagingFenceFromCpu(false);
|
||||
return madeResident ? MemoryOperationsStatus::SUCCESS : MemoryOperationsStatus::FAILED;
|
||||
return madeResident ? MemoryOperationsStatus::success : MemoryOperationsStatus::failed;
|
||||
}
|
||||
|
||||
void WddmResidentAllocationsContainer::removeResource(const D3DKMT_HANDLE &handle) {
|
||||
|
||||
@@ -231,10 +231,10 @@ bool WddmResidencyController::makeResidentResidencyAllocations(const ResidencyCo
|
||||
const bool trimmingDone = this->trimResidencyToBudget(bytesToTrim);
|
||||
if (!trimmingDone) {
|
||||
auto evictionStatus = wddm.getTemporaryResourcesContainer()->evictAllResources();
|
||||
if (evictionStatus == MemoryOperationsStatus::SUCCESS) {
|
||||
if (evictionStatus == MemoryOperationsStatus::success) {
|
||||
continue;
|
||||
}
|
||||
DEBUG_BREAK_IF(evictionStatus != MemoryOperationsStatus::MEMORY_NOT_FOUND);
|
||||
DEBUG_BREAK_IF(evictionStatus != MemoryOperationsStatus::memoryNotFound);
|
||||
do {
|
||||
result = wddm.makeResident(&handlesForResidency[0], totalHandlesCount, true, &bytesToTrim, totalSize);
|
||||
} while (debugManager.flags.WaitForMemoryRelease.get() && result == false);
|
||||
|
||||
Reference in New Issue
Block a user