Add Unrecoverable if GraphicsAllocation in use is being destroyed.

Change-Id: I74a54ef023c62e12d711db07d79942166e002188
This commit is contained in:
Mrozek, Michal
2018-01-17 16:23:51 +01:00
committed by sys_ocldev
parent a9a24e82e5
commit e923c2211b
4 changed files with 19 additions and 5 deletions

View File

@@ -87,11 +87,6 @@ Device::~Device() {
performanceCounters->shutdown();
}
delete commandStreamReceiver;
if (memoryManager) {
memoryManager->freeGraphicsMemory(tagAllocation);
}
tagAllocation = nullptr;
commandStreamReceiver = nullptr;
if (memoryManager) {
if (preemptionAllocation) {
memoryManager->freeGraphicsMemory(preemptionAllocation);
@@ -99,6 +94,11 @@ Device::~Device() {
}
memoryManager->waitForDeletions();
}
if (memoryManager) {
memoryManager->freeGraphicsMemory(tagAllocation);
}
tagAllocation = nullptr;
commandStreamReceiver = nullptr;
delete memoryManager;
memoryManager = nullptr;
alignedFree(this->slmWindowStartAddress);

View File

@@ -90,6 +90,8 @@ class Device : public BaseObject<_cl_device_id> {
}
CommandStreamReceiver &getCommandStreamReceiver();
CommandStreamReceiver *peekCommandStreamReceiver();
volatile uint32_t *getTagAddress() const;
const char *getProductAbbrev() const;
@@ -176,6 +178,10 @@ inline CommandStreamReceiver &Device::getCommandStreamReceiver() {
return *commandStreamReceiver;
}
inline CommandStreamReceiver *Device::peekCommandStreamReceiver() {
return commandStreamReceiver;
}
inline volatile uint32_t *Device::getTagAddress() const {
return tagAddress;
}

View File

@@ -20,6 +20,8 @@
* OTHER DEALINGS IN THE SOFTWARE.
*/
#include "runtime/command_stream/command_stream_receiver_hw.h"
#include "runtime/device/device.h"
#include "runtime/helpers/aligned_memory.h"
#include "runtime/helpers/ptr_math.h"
#include "runtime/gmm_helper/gmm_helper.h"
@@ -268,6 +270,8 @@ void WddmMemoryManager::freeGraphicsMemoryImpl(GraphicsAllocation *gfxAllocation
releaseResidencyLock();
UNRECOVERABLE_IF(gfxAllocation->taskCount != ObjectNotUsed && this->device && this->device->peekCommandStreamReceiver() && gfxAllocation->taskCount > *this->device->getCommandStreamReceiver().getTagAddress());
if (input->gmm) {
if (input->gmm->isRenderCompressed) {
status = unmapAuxVA(input->gmm, input->gpuPtr);