SWDEV-416580 - Add condition when memory has direct access, only use host fill if image is small
Change-Id: I3509c4aa21f6413adad3b46273ec650f5c577ddd
Этот коммит содержится в:
коммит произвёл
Victor Zhang
родитель
0d3a5c4c81
Коммит
cb426df1bd
@@ -2325,9 +2325,12 @@ bool KernelBlitManager::fillImage(device::Memory& memory, const void* pattern,
|
||||
bool entire) const {
|
||||
amd::ScopedLock k(lockXferOps_);
|
||||
bool result = false;
|
||||
|
||||
// Use host fill if memory has direct access
|
||||
if (setup_.disableFillImage_ || gpuMem(memory).isHostMemDirectAccess()) {
|
||||
constexpr size_t kFillImageThreshold = 256 * 256;
|
||||
|
||||
// Use host fill if memory has direct access and image is small
|
||||
if (setup_.disableFillImage_ ||
|
||||
(gpuMem(memory).isHostMemDirectAccess() &&
|
||||
(size.c[0] * size.c[1] * size.c[2]) <= kFillImageThreshold)) {
|
||||
gpu().releaseGpuMemoryFence();
|
||||
|
||||
result = HostBlitManager::fillImage(memory, pattern, origin, size, entire);
|
||||
|
||||
@@ -2352,9 +2352,12 @@ bool KernelBlitManager::fillImage(device::Memory& memory, const void* pattern,
|
||||
|
||||
amd::ScopedLock k(lockXferOps_);
|
||||
bool result = false;
|
||||
|
||||
// Use host fill if memory has direct access
|
||||
if (setup_.disableFillImage_ || memory.isHostMemDirectAccess()) {
|
||||
constexpr size_t kFillImageThreshold = 256 * 256;
|
||||
|
||||
// Use host fill if memory has direct access and image is small
|
||||
if (setup_.disableFillImage_ ||
|
||||
(gpuMem(memory).isHostMemDirectAccess() &&
|
||||
(size.c[0] * size.c[1] * size.c[2]) <= kFillImageThreshold)) {
|
||||
// Stall GPU before CPU access
|
||||
gpu().releaseGpuMemoryFence();
|
||||
result = HostBlitManager::fillImage(memory, pattern, origin, size, entire);
|
||||
|
||||
Ссылка в новой задаче
Block a user