mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 14:55:24 +08:00
refactor: remove unused dc flush mitigation
Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
4e823f9e6e
commit
1d1414febc
@@ -672,8 +672,7 @@ cl_int CommandQueue::enqueueReleaseSharedObjects(cl_uint numObjects, const cl_me
|
||||
}
|
||||
|
||||
if (this->getGpgpuCommandStreamReceiver().isDirectSubmissionEnabled()) {
|
||||
if (this->getDevice().getProductHelper().isDcFlushMitigated() || isDisplayableReleased) {
|
||||
this->getGpgpuCommandStreamReceiver().registerDcFlushForDcMitigation();
|
||||
if (isDisplayableReleased) {
|
||||
this->getGpgpuCommandStreamReceiver().sendRenderStateCacheFlush();
|
||||
{
|
||||
TakeOwnershipWrapper<CommandQueue> queueOwnership(*this);
|
||||
|
||||
@@ -682,16 +682,6 @@ Buffer *Context::BufferPoolAllocator::allocateBufferFromPool(const MemoryPropert
|
||||
|
||||
bufferFromPool = this->allocateFromPools(memoryProperties, flags, flagsIntel, requestedSize, hostPtr, errcodeRet);
|
||||
if (bufferFromPool != nullptr) {
|
||||
for (const auto rootDeviceIndex : this->context->getRootDeviceIndices()) {
|
||||
auto cmdQ = this->context->getSpecialQueue(rootDeviceIndex);
|
||||
if (cmdQ->getDevice().getProductHelper().isDcFlushMitigated()) {
|
||||
auto &csr = cmdQ->getGpgpuCommandStreamReceiver();
|
||||
auto lock = csr.obtainUniqueOwnership();
|
||||
csr.registerDcFlushForDcMitigation();
|
||||
csr.flushTagUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
return bufferFromPool;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2020-2024 Intel Corporation
|
||||
* Copyright (C) 2020-2025 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -17,8 +17,4 @@ bool CommandQueue::isTimestampWaitEnabled() {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool checkIsGpuCopyRequiredForDcFlushMitigation(AllocationType type) {
|
||||
return type != AllocationType::bufferHostMemory;
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
@@ -204,8 +204,6 @@ Buffer *Buffer::create(Context *context,
|
||||
flags, 0, size, hostPtr, bufferCreateArgs, errcodeRet);
|
||||
}
|
||||
|
||||
extern bool checkIsGpuCopyRequiredForDcFlushMitigation(AllocationType type);
|
||||
|
||||
bool inline copyHostPointer(Buffer *buffer,
|
||||
Device &device,
|
||||
size_t size,
|
||||
@@ -217,8 +215,7 @@ bool inline copyHostPointer(Buffer *buffer,
|
||||
auto memory = buffer->getGraphicsAllocation(rootDeviceIndex);
|
||||
auto isCompressionEnabled = memory->isCompressionEnabled();
|
||||
const bool isLocalMemory = !MemoryPoolHelper::isSystemMemoryPool(memory->getMemoryPool());
|
||||
const bool isGpuCopyRequiredForDcFlushMitigation = productHelper.isDcFlushMitigated() && checkIsGpuCopyRequiredForDcFlushMitigation(memory->getAllocationType());
|
||||
const bool gpuCopyRequired = isCompressionEnabled || isLocalMemory || isGpuCopyRequiredForDcFlushMitigation;
|
||||
const bool gpuCopyRequired = isCompressionEnabled || isLocalMemory;
|
||||
if (gpuCopyRequired) {
|
||||
auto &hwInfo = device.getHardwareInfo();
|
||||
|
||||
@@ -241,14 +238,11 @@ bool inline copyHostPointer(Buffer *buffer,
|
||||
memory->setAubWritable(true, GraphicsAllocation::defaultBank);
|
||||
memory->setTbxWritable(true, GraphicsAllocation::defaultBank);
|
||||
memcpy_s(ptrOffset(lockedPointer, buffer->getOffset()), size, hostPtr, size);
|
||||
if (isGpuCopyRequiredForDcFlushMitigation) {
|
||||
CpuIntrinsics::sfence();
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
auto blitMemoryToAllocationResult = BlitOperationResult::unsupported;
|
||||
|
||||
if (productHelper.isBlitterFullySupported(hwInfo) && (isLocalMemory || isGpuCopyRequiredForDcFlushMitigation)) {
|
||||
if (productHelper.isBlitterFullySupported(hwInfo) && isLocalMemory) {
|
||||
device.stopDirectSubmissionForCopyEngine();
|
||||
blitMemoryToAllocationResult = BlitHelperFunctions::blitMemoryToAllocation(device, memory, buffer->getOffset(), hostPtr, {size, 1, 1});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user