P4 to Git Change 1270658 by gandryey@gera-w8 on 2016/05/18 17:53:45

SWDEV-86035 - Add PAL backend to OpenCL
	- Fix a crash in the pipe test. Device layer can't use device blit queue directly, but requires a blit manager call, which will perform correct wait for idle sequence.

Affected files ...

... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palblit.cpp#3 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palblit.hpp#3 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldevice.cpp#6 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palkernel.cpp#5 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palmemory.cpp#5 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palprogram.cpp#3 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palvirtual.cpp#8 edit
... //depot/stg/opencl/drivers/opencl/tests/ocltst/module/runtime/OCLRTQueue.cpp#2 edit
This commit is contained in:
foreman
2016-05-18 18:11:40 -04:00
parent 11c0c4e127
commit a94fa4eabb
7 changed files with 39 additions and 38 deletions
+9 -15
View File
@@ -149,8 +149,9 @@ VirtualGPU::Queue::addCmdMemRef(Pal::IGpuMemory* iMem)
void
VirtualGPU::Queue::removeCmdMemRef(Pal::IGpuMemory* iMem)
{
memReferences_.erase(iMem);
iDev_->RemoveGpuMemoryReferences(1, &iMem, iQueue_);
if (0 != memReferences_.erase(iMem)) {
iDev_->RemoveGpuMemoryReferences(1, &iMem, iQueue_);
}
}
uint
@@ -2264,39 +2265,32 @@ VirtualGPU::submitMarker(amd::Marker& vcmd)
GpuEvent*
VirtualGPU::getGpuEvent(Pal::IGpuMemory* iMem)
{
GpuEvents::iterator it = gpuEvents_.find(iMem);
if (it == gpuEvents_.end()) {
// queue(MainEngine).addMemRef(iMem);
// queue(SdmaEngine).addMemRef(iMem);
}
return &gpuEvents_[iMem];
}
void
VirtualGPU::assignGpuEvent(Pal::IGpuMemory* iMem, GpuEvent gpuEvent)
{
GpuEvents::iterator it = gpuEvents_.find(iMem);
auto it = gpuEvents_.find(iMem);
if (it != gpuEvents_.end()) {
it->second = gpuEvent;
}
else {
// queue(gpuEvent.engineId_).addMemRef(iMem);
gpuEvents_[iMem] = gpuEvent;
}
// queues_[gpuEvent.engineId_]->addCmdMemRef(iMem);
}
void
VirtualGPU::releaseMemory(Pal::IGpuMemory* iMem, bool wait)
{
auto it = gpuEvents_.find(iMem);
//! @note if there is no wait, then it's a view release
if (wait) {
waitForEvent(&gpuEvents_[iMem]);
//queue(MainEngine).removeMemRef(iMem);
//queue(SdmaEngine).removeMemRef(iMem);
if (wait && (it != gpuEvents_.end())) {
waitForEvent(&it->second);
queues_[MainEngine]->removeCmdMemRef(iMem);
queues_[SdmaEngine]->removeCmdMemRef(iMem);
gpuEvents_.erase(iMem);
gpuEvents_.erase(it);
}
}