P4 to Git Change 1455453 by gandryey@gera-w8 on 2017/09/05 17:49:48

SWDEV-131493 - [CQE OCL][Vega10][QR][DTB-Blocker] Soft Hang is observed while running 'Mipmaps-clCopyImage' tests of WF Conformance due to Faulty CL# 1451293
	Multiple runtime locks could conflict each other:
	- Remove PAL lock from the resource creation/destruction. PAL should be thread safe for those operations.
	- Avoid queue execution lock for a mipmap view destruction in submitUnmapMemory

Affected files ...

... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palresource.cpp#34 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palvirtual.cpp#55 edit
This commit is contained in:
foreman
2017-09-05 18:03:48 -04:00
orang tua 121ffcc6ec
melakukan 6b103f1bf6
2 mengubah file dengan 14 tambahan dan 14 penghapusan
+6 -11
Melihat File
@@ -168,15 +168,12 @@ GpuMemoryReference::~GpuMemoryReference() {
device_.vgpus()[0]->releaseMemory(this, &events_[0]);
}
{
amd::ScopedLock lk(device_.lockPAL());
if (cpuAddress_ != nullptr) {
iMem()->Unmap();
}
if (0 != iMem()) {
iMem()->Destroy();
gpuMem_ = nullptr;
}
if (cpuAddress_ != nullptr) {
iMem()->Unmap();
}
if (0 != iMem()) {
iMem()->Destroy();
gpuMem_ = nullptr;
}
device_.removeResource(this);
}
@@ -415,8 +412,6 @@ bool Resource::create(MemoryType memType, CreateParams* params) {
// This is a thread safe operation
const_cast<Device&>(dev()).initializeHeapResources();
amd::ScopedLock lk(dev().lockPAL());
if (memType == Shader) {
if (dev().settings().svmFineGrainSystem_) {
desc_.isAllocExecute_ = true;
+8 -3
Melihat File
@@ -1478,12 +1478,14 @@ void VirtualGPU::submitMapMemory(amd::MapMemoryCommand& vcmd) {
}
void VirtualGPU::submitUnmapMemory(amd::UnmapMemoryCommand& vcmd) {
bool unmapMip = false;
amd::Image* amdImage;
{
// Make sure VirtualGPU has an exclusive access to the resources
amd::ScopedLock lock(execution());
pal::Memory* memory = dev().getGpuMemory(&vcmd.memory());
amd::Memory* owner = memory->owner();
bool unmapMip = false;
const device::Memory::WriteMapInfo* writeMapInfo = memory->writeMapInfo(vcmd.mapPtr());
if (nullptr == writeMapInfo) {
LogError("Unmap without map call");
@@ -1492,7 +1494,7 @@ void VirtualGPU::submitUnmapMemory(amd::UnmapMemoryCommand& vcmd) {
profilingBegin(vcmd, true);
// Check if image is a mipmap and assign a saved view
amd::Image* amdImage = owner->asImage();
amdImage = owner->asImage();
if ((amdImage != nullptr) && (amdImage->getMipLevels() > 1) &&
(writeMapInfo->baseMip_ != nullptr)) {
// Assign mip level view
@@ -1571,11 +1573,14 @@ void VirtualGPU::submitUnmapMemory(amd::UnmapMemoryCommand& vcmd) {
// Clear unmap flags
memory->clearUnmapInfo(vcmd.mapPtr());
profilingEnd(vcmd);
}
// Release a view for a mipmap map
if (unmapMip) {
// Memory release should be outside of the execution lock,
// because mapMemory_ isn't marked for a specifc GPU
amdImage->release();
}
profilingEnd(vcmd);
}
bool VirtualGPU::fillMemory(cl_command_type type, amd::Memory* amdMemory, const void* pattern,