mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-04 15:53:45 +08:00
CSR HW with AUB dump to accept images with no host ptr
This commit enables AUB dumps in scenarios with images with no host ptr when resource lock is required to get CPU address and dump image contents. Change-Id: I996efc5f520d0ac7b470870f7b4eeb9d2ef7b25b
This commit is contained in:
committed by
sys_ocldev
parent
ca33e029b7
commit
c135bd4c42
@@ -418,19 +418,29 @@ bool AUBCommandStreamReceiverHw<GfxFamily>::writeMemory(GraphicsAllocation &gfxA
|
||||
stream.addComment(str.str().c_str());
|
||||
}
|
||||
|
||||
if (cpuAddress == nullptr) {
|
||||
DEBUG_BREAK_IF(gfxAllocation.isLocked());
|
||||
cpuAddress = this->getMemoryManager()->lockResource(&gfxAllocation);
|
||||
gfxAllocation.setLocked(true);
|
||||
}
|
||||
|
||||
PageWalker walker = [&](uint64_t physAddress, size_t size, size_t offset) {
|
||||
static const size_t pageSize = 4096;
|
||||
auto vmAddr = (static_cast<uintptr_t>(gpuAddress) + offset) & ~(pageSize - 1);
|
||||
auto pAddr = physAddress & ~(pageSize - 1);
|
||||
|
||||
AUB::reserveAddressPPGTT(stream, vmAddr, pageSize, pAddr);
|
||||
|
||||
AUB::addMemoryWrite(stream, physAddress,
|
||||
reinterpret_cast<void *>(reinterpret_cast<uintptr_t>(cpuAddress) + offset),
|
||||
size, AubMemDump::AddressSpaceValues::TraceNonlocal);
|
||||
};
|
||||
ppgtt.pageWalk(static_cast<uintptr_t>(gpuAddress), size, 0, walker);
|
||||
|
||||
if (gfxAllocation.isLocked()) {
|
||||
this->getMemoryManager()->unlockResource(&gfxAllocation);
|
||||
gfxAllocation.setLocked(false);
|
||||
}
|
||||
|
||||
if (!!(allocType & GraphicsAllocation::ALLOCATION_TYPE_BUFFER) ||
|
||||
!!(allocType & GraphicsAllocation::ALLOCATION_TYPE_IMAGE))
|
||||
gfxAllocation.setAllocationType(allocType | GraphicsAllocation::ALLOCATION_TYPE_NON_AUB_WRITABLE);
|
||||
|
||||
Reference in New Issue
Block a user