P4 to Git Change 1968527 by gandryey@gera-win10 on 2019/07/16 14:52:45

SWDEV-195023 - [CQE OCL][Navi10][RESOLVE] corruption seen in thumbnail for mxf clip after enabling temporal denoiser in Davinci resolve app
	- Add a workaround for missing custom pitch in gfx10 HW. It can be disabled with GPU_IMAGE_BUFFER_WAR=0. Workaround implements double copy with an image without pitch.

Affected files ...

... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palmemory.cpp#26 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palmemory.hpp#12 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palsettings.cpp#89 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palsettings.hpp#24 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palvirtual.cpp#138 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palvirtual.hpp#62 edit
... //depot/stg/opencl/drivers/opencl/runtime/utils/flags.hpp#313 edit


[ROCm/clr commit: 582fae6820]
This commit is contained in:
foreman
2019-07-16 14:56:08 -04:00
parent 4d73993230
commit c1063c0ea1
7 changed files with 99 additions and 4 deletions
@@ -79,6 +79,10 @@ bool Memory::create(Resource::MemoryType memType, Resource::CreateParams* params
uint allocAttempt = 0;
// Reset the flag in case we reallocate the heap in local/remote
flags_ &= ~HostMemoryDirectAccess;
if (!ValidateMemory(memType)) {
return false;
}
do {
// Create a resource in CAL
@@ -1089,4 +1093,18 @@ void* Image::allocMapTarget(const amd::Coord3D& origin, const amd::Coord3D& regi
return mapAddress + offset;
}
bool Image::ValidateMemory(Resource::MemoryType memType) {
if (dev().settings().imageBufferWar_ && (memType == ImageBuffer) && (owner() != nullptr) &&
((owner()->asImage()->getWidth() * owner()->asImage()->getImageFormat().getElementSize()) <
owner()->asImage()->getRowPitch())) {
// Create a native image without pitch as a backing store
copyImageBuffer_ = new pal::Image(dev(), size(), desc().width_, desc().height_, desc().depth_,
desc().format_, desc().topology_, 0);
if ((copyImageBuffer_ == nullptr) || !copyImageBuffer_->create(Resource::Local)) {
return false;
}
}
return true;
}
} // namespace pal