mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-24 21:18:24 +08:00
refactor: Rename member variables to camelCase 2/n
Signed-off-by: Fabian Zwolinski <fabian.zwolinski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
c84c7a0c91
commit
e351a90f81
@@ -84,17 +84,17 @@ template <typename GfxFamily>
|
||||
void dumpBufferInBinFormat(GraphicsAllocation &gfxAllocation, AubMemDump::AubFileStream *stream, uint32_t context) {
|
||||
AubMemDump::AubCaptureBinaryDumpHD cmd;
|
||||
memset(&cmd, 0, sizeof(cmd));
|
||||
cmd.Header.Type = 0x7;
|
||||
cmd.Header.Opcode = 0x1;
|
||||
cmd.Header.SubOp = 0x15;
|
||||
cmd.Header.DwordLength = ((sizeof(cmd) - sizeof(cmd.Header)) / sizeof(uint32_t)) - 1;
|
||||
cmd.header.type = 0x7;
|
||||
cmd.header.opcode = 0x1;
|
||||
cmd.header.subOp = 0x15;
|
||||
cmd.header.dwordLength = ((sizeof(cmd) - sizeof(cmd.header)) / sizeof(uint32_t)) - 1;
|
||||
|
||||
cmd.setHeight(1);
|
||||
cmd.setWidth(gfxAllocation.getUnderlyingBufferSize());
|
||||
cmd.setBaseAddr(gfxAllocation.getGpuAddress());
|
||||
cmd.setPitch(gfxAllocation.getUnderlyingBufferSize());
|
||||
cmd.GttType = 1;
|
||||
cmd.DirectoryHandle = context;
|
||||
cmd.gttType = 1;
|
||||
cmd.directoryHandle = context;
|
||||
|
||||
stream->write(reinterpret_cast<char *>(&cmd), sizeof(cmd));
|
||||
}
|
||||
@@ -105,31 +105,31 @@ void dumpImageInBmpFormat(GraphicsAllocation &gfxAllocation, AubMemDump::AubFile
|
||||
|
||||
AubMemDump::AubCmdDumpBmpHd cmd;
|
||||
memset(&cmd, 0, sizeof(cmd));
|
||||
cmd.Header.Type = 0x7;
|
||||
cmd.Header.Opcode = 0x1;
|
||||
cmd.Header.SubOp = 0x44;
|
||||
cmd.Header.DwordLength = ((sizeof(cmd) - sizeof(cmd.Header)) / sizeof(uint32_t)) - 1;
|
||||
cmd.header.type = 0x7;
|
||||
cmd.header.opcode = 0x1;
|
||||
cmd.header.subOp = 0x44;
|
||||
cmd.header.dwordLength = ((sizeof(cmd) - sizeof(cmd.header)) / sizeof(uint32_t)) - 1;
|
||||
|
||||
cmd.Xmin = 0;
|
||||
cmd.Ymin = 0;
|
||||
cmd.xMin = 0;
|
||||
cmd.yMin = 0;
|
||||
auto pitch = gmm->gmmResourceInfo->getRenderPitch();
|
||||
auto bitsPerPixel = gmm->gmmResourceInfo->getBitsPerPixel();
|
||||
auto pitchInPixels = static_cast<uint32_t>(8 * pitch / bitsPerPixel);
|
||||
cmd.BufferPitch = pitchInPixels;
|
||||
cmd.BitsPerPixel = bitsPerPixel;
|
||||
cmd.Format = gmm->gmmResourceInfo->getResourceFormatSurfaceState();
|
||||
cmd.Xsize = static_cast<uint32_t>(gmm->gmmResourceInfo->getBaseWidth());
|
||||
cmd.Ysize = static_cast<uint32_t>(gmm->gmmResourceInfo->getBaseHeight());
|
||||
cmd.bufferPitch = pitchInPixels;
|
||||
cmd.bitsPerPixel = bitsPerPixel;
|
||||
cmd.format = gmm->gmmResourceInfo->getResourceFormatSurfaceState();
|
||||
cmd.xSize = static_cast<uint32_t>(gmm->gmmResourceInfo->getBaseWidth());
|
||||
cmd.ySize = static_cast<uint32_t>(gmm->gmmResourceInfo->getBaseHeight());
|
||||
cmd.setBaseAddr(gfxAllocation.getGpuAddress());
|
||||
cmd.Secure = 0;
|
||||
cmd.UseFence = 0;
|
||||
cmd.secure = 0;
|
||||
cmd.useFence = 0;
|
||||
auto flagInfo = gmm->gmmResourceInfo->getResourceFlags()->Info;
|
||||
cmd.TileOn = flagInfo.TiledW || flagInfo.TiledX || flagInfo.TiledY || flagInfo.TiledYf || flagInfo.TiledYs;
|
||||
cmd.WalkY = flagInfo.TiledY;
|
||||
cmd.UsePPGTT = 1;
|
||||
cmd.Use32BitDump = 1; // Dump out in 32bpp vs 24bpp
|
||||
cmd.UseFullFormat = 1;
|
||||
cmd.DirectoryHandle = context;
|
||||
cmd.tileOn = flagInfo.TiledW || flagInfo.TiledX || flagInfo.TiledY || flagInfo.TiledYf || flagInfo.TiledYs;
|
||||
cmd.walkY = flagInfo.TiledY;
|
||||
cmd.usePPGTT = 1;
|
||||
cmd.use32BitDump = 1; // Dump out in 32bpp vs 24bpp
|
||||
cmd.useFullFormat = 1;
|
||||
cmd.directoryHandle = context;
|
||||
|
||||
stream->write(reinterpret_cast<char *>(&cmd), sizeof(cmd));
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2022 Intel Corporation
|
||||
* Copyright (C) 2018-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -27,88 +27,88 @@ inline uint64_t getMisalignedUint64(const uint64_t *address) {
|
||||
}
|
||||
|
||||
struct AubCmdHdr {
|
||||
uint32_t DwordLength : 16,
|
||||
SubOp : 7,
|
||||
Opcode : 6,
|
||||
Type : 3;
|
||||
uint32_t dwordLength : 16,
|
||||
subOp : 7,
|
||||
opcode : 6,
|
||||
type : 3;
|
||||
};
|
||||
static_assert(4 == sizeof(AubCmdHdr), "Invalid size for AubCmdHdr");
|
||||
|
||||
struct AubCmdDumpBmpHd {
|
||||
AubCmdHdr Header;
|
||||
uint32_t Xmin;
|
||||
uint32_t Ymin;
|
||||
uint32_t BufferPitch;
|
||||
uint32_t BitsPerPixel : 8,
|
||||
Format : 8,
|
||||
Reserved_0 : 16;
|
||||
uint32_t Xsize;
|
||||
uint32_t Ysize;
|
||||
uint64_t BaseAddr;
|
||||
uint32_t Secure : 1,
|
||||
UseFence : 1,
|
||||
TileOn : 1,
|
||||
WalkY : 1,
|
||||
UsePPGTT : 1,
|
||||
Use32BitDump : 1,
|
||||
UseFullFormat : 1,
|
||||
Reserved_1 : 25;
|
||||
uint32_t DirectoryHandle;
|
||||
AubCmdHdr header;
|
||||
uint32_t xMin;
|
||||
uint32_t yMin;
|
||||
uint32_t bufferPitch;
|
||||
uint32_t bitsPerPixel : 8,
|
||||
format : 8,
|
||||
reserved0 : 16;
|
||||
uint32_t xSize;
|
||||
uint32_t ySize;
|
||||
uint64_t baseAddr;
|
||||
uint32_t secure : 1,
|
||||
useFence : 1,
|
||||
tileOn : 1,
|
||||
walkY : 1,
|
||||
usePPGTT : 1,
|
||||
use32BitDump : 1,
|
||||
useFullFormat : 1,
|
||||
reserved1 : 25;
|
||||
uint32_t directoryHandle;
|
||||
uint64_t getBaseAddr() const {
|
||||
return getMisalignedUint64(&this->BaseAddr);
|
||||
return getMisalignedUint64(&this->baseAddr);
|
||||
}
|
||||
void setBaseAddr(const uint64_t baseAddr) {
|
||||
setMisalignedUint64(&this->BaseAddr, baseAddr);
|
||||
setMisalignedUint64(&this->baseAddr, baseAddr);
|
||||
}
|
||||
};
|
||||
static_assert(44 == sizeof(AubCmdDumpBmpHd), "Invalid size for AubCmdDumpBmpHd");
|
||||
|
||||
struct AubPpgttContextCreate {
|
||||
AubCmdHdr Header;
|
||||
uint32_t Handle;
|
||||
uint32_t AdvancedContext : 1,
|
||||
SixtyFourBit : 1,
|
||||
Reserved_31_2 : 30;
|
||||
uint64_t PageDirPointer[4];
|
||||
AubCmdHdr header;
|
||||
uint32_t handle;
|
||||
uint32_t advancedContext : 1,
|
||||
sixtyFourBit : 1,
|
||||
reserved31To2 : 30;
|
||||
uint64_t pageDirPointer[4];
|
||||
};
|
||||
static_assert(44 == sizeof(AubPpgttContextCreate), "Invalid size for AubPpgttContextCreate");
|
||||
|
||||
struct AubCaptureBinaryDumpHD {
|
||||
AubCmdHdr Header;
|
||||
uint64_t BaseAddr;
|
||||
uint64_t Width;
|
||||
uint64_t Height;
|
||||
uint64_t Pitch;
|
||||
uint32_t SurfaceType : 4,
|
||||
GttType : 2,
|
||||
Reserved_31_6 : 26;
|
||||
uint32_t DirectoryHandle;
|
||||
uint32_t ReservedDW1;
|
||||
uint32_t ReservedDW2;
|
||||
char OutputFile[4];
|
||||
AubCmdHdr header;
|
||||
uint64_t baseAddr;
|
||||
uint64_t width;
|
||||
uint64_t height;
|
||||
uint64_t pitch;
|
||||
uint32_t surfaceType : 4,
|
||||
gttType : 2,
|
||||
reserved31To6 : 26;
|
||||
uint32_t directoryHandle;
|
||||
uint32_t reservedDW1;
|
||||
uint32_t reservedDW2;
|
||||
char outputFile[4];
|
||||
uint64_t getBaseAddr() const {
|
||||
return getMisalignedUint64(&this->BaseAddr);
|
||||
return getMisalignedUint64(&this->baseAddr);
|
||||
}
|
||||
void setBaseAddr(const uint64_t baseAddr) {
|
||||
setMisalignedUint64(&this->BaseAddr, baseAddr);
|
||||
setMisalignedUint64(&this->baseAddr, baseAddr);
|
||||
}
|
||||
uint64_t getWidth() const {
|
||||
return getMisalignedUint64(&this->Width);
|
||||
return getMisalignedUint64(&this->width);
|
||||
}
|
||||
void setWidth(const uint64_t width) {
|
||||
setMisalignedUint64(&this->Width, width);
|
||||
setMisalignedUint64(&this->width, width);
|
||||
}
|
||||
uint64_t getHeight() const {
|
||||
return getMisalignedUint64(&this->Height);
|
||||
return getMisalignedUint64(&this->height);
|
||||
}
|
||||
void setHeight(const uint64_t height) {
|
||||
setMisalignedUint64(&this->Height, height);
|
||||
setMisalignedUint64(&this->height, height);
|
||||
}
|
||||
uint64_t getPitch() const {
|
||||
return getMisalignedUint64(&this->Pitch);
|
||||
return getMisalignedUint64(&this->pitch);
|
||||
}
|
||||
void setPitch(const uint64_t pitch) {
|
||||
setMisalignedUint64(&this->Pitch, pitch);
|
||||
setMisalignedUint64(&this->pitch, pitch);
|
||||
}
|
||||
};
|
||||
static_assert(56 == sizeof(AubCaptureBinaryDumpHD), "Invalid size for AubCaptureBinaryDumpHD");
|
||||
|
||||
@@ -43,22 +43,22 @@ inline void setAddress(CmdServicesMemTraceMemoryCompare &cmd, uint64_t address)
|
||||
union IAPageTableEntry {
|
||||
struct
|
||||
{
|
||||
uint64_t Present : 1; //[0]
|
||||
uint64_t Writable : 1; //[1]
|
||||
uint64_t UserSupervisor : 1; //[2]
|
||||
uint64_t PWT : 1; //[3]
|
||||
uint64_t PCD : 1; //[4]
|
||||
uint64_t Accessed : 1; //[5]
|
||||
uint64_t Dirty : 1; //[6]
|
||||
uint64_t PAT : 1; //[7]
|
||||
uint64_t Global : 1; //[8]
|
||||
uint64_t Reserved_9 : 1; //[9]
|
||||
uint64_t Reserved_10 : 1; //[10]
|
||||
uint64_t Reserved_11 : 1; //[11]
|
||||
uint64_t PhysicalAddress : 27; //[38:12]
|
||||
uint64_t Reserved_51_39 : 13; //[51:39]
|
||||
uint64_t Ignored : 11; //[62:52]
|
||||
uint64_t ExecuteDisable : 1; //[63]
|
||||
uint64_t present : 1; //[0]
|
||||
uint64_t writable : 1; //[1]
|
||||
uint64_t userSupervisor : 1; //[2]
|
||||
uint64_t pwt : 1; //[3]
|
||||
uint64_t pcd : 1; //[4]
|
||||
uint64_t accessed : 1; //[5]
|
||||
uint64_t dirty : 1; //[6]
|
||||
uint64_t pat : 1; //[7]
|
||||
uint64_t global : 1; //[8]
|
||||
uint64_t reserved_9 : 1; //[9]
|
||||
uint64_t reserved_10 : 1; //[10]
|
||||
uint64_t reserved_11 : 1; //[11]
|
||||
uint64_t physicalAddress : 27; //[38:12]
|
||||
uint64_t reserved_51_39 : 13; //[51:39]
|
||||
uint64_t ignored : 11; //[62:52]
|
||||
uint64_t executeDisable : 1; //[63]
|
||||
} pageConfig;
|
||||
uint32_t dwordData[2];
|
||||
uint64_t uiData;
|
||||
@@ -67,11 +67,11 @@ union IAPageTableEntry {
|
||||
union MiGttEntry {
|
||||
struct
|
||||
{
|
||||
uint64_t Present : 1; //[0]
|
||||
uint64_t LocalMemory : 1; //[1]
|
||||
uint64_t FunctionNumber : 10; //[11:2]
|
||||
uint64_t PhysicalAddress : 35; //[46:12]
|
||||
uint64_t Ignored : 17; //[63:47]
|
||||
uint64_t present : 1; //[0]
|
||||
uint64_t localMemory : 1; //[1]
|
||||
uint64_t functionNumber : 10; //[11:2]
|
||||
uint64_t physicalAddress : 35; //[46:12]
|
||||
uint64_t ignored : 17; //[63:47]
|
||||
} pageConfig;
|
||||
uint32_t dwordData[2];
|
||||
uint64_t uiData;
|
||||
@@ -272,17 +272,17 @@ struct AubDump : public std::conditional<TraitsIn::addressingBits == 32, AubPage
|
||||
|
||||
typedef union _MiContextDescriptorReg_ {
|
||||
struct {
|
||||
uint64_t Valid : 1; //[0]
|
||||
uint64_t ForcePageDirRestore : 1; //[1]
|
||||
uint64_t ForceRestore : 1; //[2]
|
||||
uint64_t Legacy : 1; //[3]
|
||||
uint64_t ADor64bitSupport : 1; //[4] Selects 64-bit PPGTT in Legacy mode
|
||||
uint64_t LlcCoherencySupport : 1; //[5]
|
||||
uint64_t FaultSupport : 2; //[7:6]
|
||||
uint64_t PrivilegeAccessOrPPGTT : 1; //[8] Selects PPGTT in Legacy mode
|
||||
uint64_t FunctionType : 3; //[11:9]
|
||||
uint64_t LogicalRingCtxAddress : 20; //[31:12]
|
||||
uint64_t ContextID : 32; //[63:32]
|
||||
uint64_t valid : 1; //[0]
|
||||
uint64_t forcePageDirRestore : 1; //[1]
|
||||
uint64_t forceRestore : 1; //[2]
|
||||
uint64_t legacy : 1; //[3]
|
||||
uint64_t aDor64bitSupport : 1; //[4] Selects 64-bit PPGTT in Legacy mode
|
||||
uint64_t llcCoherencySupport : 1; //[5]
|
||||
uint64_t faultSupport : 2; //[7:6]
|
||||
uint64_t privilegeAccessOrPPGTT : 1; //[8] Selects PPGTT in Legacy mode
|
||||
uint64_t functionType : 3; //[11:9]
|
||||
uint64_t logicalRingCtxAddress : 20; //[31:12]
|
||||
uint64_t contextID : 32; //[63:32]
|
||||
} sData;
|
||||
uint32_t ulData[2];
|
||||
uint64_t qwordData[2 / 2];
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2022 Intel Corporation
|
||||
* Copyright (C) 2018-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -135,9 +135,9 @@ void AubDump<Traits>::reserveAddressGGTTAndWriteMmeory(typename Traits::Stream &
|
||||
template <typename Traits>
|
||||
void AubDump<Traits>::setGttEntry(MiGttEntry &entry, uint64_t address, AubGTTData data) {
|
||||
entry.uiData = 0;
|
||||
entry.pageConfig.PhysicalAddress = address / 4096;
|
||||
entry.pageConfig.Present = data.present;
|
||||
entry.pageConfig.LocalMemory = data.localMemory;
|
||||
entry.pageConfig.physicalAddress = address / 4096;
|
||||
entry.pageConfig.present = data.present;
|
||||
entry.pageConfig.localMemory = data.localMemory;
|
||||
}
|
||||
|
||||
template <typename Traits>
|
||||
@@ -326,18 +326,18 @@ template <typename Traits>
|
||||
void AubPageTableHelper32<Traits>::createContext(typename Traits::Stream &stream, uint32_t context) {
|
||||
AubPpgttContextCreate cmd;
|
||||
memset(&cmd, 0, sizeof(cmd));
|
||||
cmd.Header.Type = 0x7;
|
||||
cmd.Header.Opcode = 0x1;
|
||||
cmd.Header.SubOp = 0x14;
|
||||
cmd.Header.DwordLength = ((sizeof(cmd) - sizeof(cmd.Header)) / sizeof(uint32_t)) - 1;
|
||||
cmd.Handle = context;
|
||||
cmd.AdvancedContext = false;
|
||||
cmd.header.type = 0x7;
|
||||
cmd.header.opcode = 0x1;
|
||||
cmd.header.subOp = 0x14;
|
||||
cmd.header.dwordLength = ((sizeof(cmd) - sizeof(cmd.header)) / sizeof(uint32_t)) - 1;
|
||||
cmd.handle = context;
|
||||
cmd.advancedContext = false;
|
||||
|
||||
cmd.SixtyFourBit = 0;
|
||||
cmd.PageDirPointer[0] = BaseClass::getPDEAddress(0x000);
|
||||
cmd.PageDirPointer[1] = BaseClass::getPDEAddress(0x200);
|
||||
cmd.PageDirPointer[2] = BaseClass::getPDEAddress(0x400);
|
||||
cmd.PageDirPointer[3] = BaseClass::getPDEAddress(0x600);
|
||||
cmd.sixtyFourBit = 0;
|
||||
cmd.pageDirPointer[0] = BaseClass::getPDEAddress(0x000);
|
||||
cmd.pageDirPointer[1] = BaseClass::getPDEAddress(0x200);
|
||||
cmd.pageDirPointer[2] = BaseClass::getPDEAddress(0x400);
|
||||
cmd.pageDirPointer[3] = BaseClass::getPDEAddress(0x600);
|
||||
|
||||
stream.createContext(cmd);
|
||||
}
|
||||
@@ -346,15 +346,15 @@ template <typename Traits>
|
||||
void AubPageTableHelper64<Traits>::createContext(typename Traits::Stream &stream, uint32_t context) {
|
||||
AubPpgttContextCreate cmd;
|
||||
memset(&cmd, 0, sizeof(cmd));
|
||||
cmd.Header.Type = 0x7;
|
||||
cmd.Header.Opcode = 0x1;
|
||||
cmd.Header.SubOp = 0x14;
|
||||
cmd.Header.DwordLength = ((sizeof(cmd) - sizeof(cmd.Header)) / sizeof(uint32_t)) - 1;
|
||||
cmd.Handle = context;
|
||||
cmd.AdvancedContext = false;
|
||||
cmd.header.type = 0x7;
|
||||
cmd.header.opcode = 0x1;
|
||||
cmd.header.subOp = 0x14;
|
||||
cmd.header.dwordLength = ((sizeof(cmd) - sizeof(cmd.header)) / sizeof(uint32_t)) - 1;
|
||||
cmd.handle = context;
|
||||
cmd.advancedContext = false;
|
||||
|
||||
cmd.SixtyFourBit = 1;
|
||||
cmd.PageDirPointer[0] = getPML4Address(0);
|
||||
cmd.sixtyFourBit = 1;
|
||||
cmd.pageDirPointer[0] = getPML4Address(0);
|
||||
|
||||
stream.createContext(cmd);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2022 Intel Corporation
|
||||
* Copyright (C) 2018-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
struct CmdServicesMemTraceVersion {
|
||||
union {
|
||||
AubCmdHdr Header;
|
||||
AubCmdHdr header;
|
||||
struct {
|
||||
uint32_t dwordCount : 16;
|
||||
uint32_t instructionSubOpcode : 7;
|
||||
@@ -160,7 +160,7 @@ struct CmdServicesMemTraceVersion {
|
||||
|
||||
struct CmdServicesMemTraceRegisterCompare {
|
||||
union {
|
||||
AubCmdHdr Header;
|
||||
AubCmdHdr header;
|
||||
struct {
|
||||
uint32_t dwordCount : 16;
|
||||
uint32_t instructionSubOpcode : 7;
|
||||
@@ -230,7 +230,7 @@ struct CmdServicesMemTraceRegisterCompare {
|
||||
|
||||
struct CmdServicesMemTraceRegisterPoll {
|
||||
union {
|
||||
AubCmdHdr Header;
|
||||
AubCmdHdr header;
|
||||
struct {
|
||||
uint32_t dwordCount : 16;
|
||||
uint32_t instructionSubOpcode : 7;
|
||||
@@ -308,7 +308,7 @@ struct CmdServicesMemTraceRegisterPoll {
|
||||
|
||||
struct CmdServicesMemTraceRegisterWrite {
|
||||
union {
|
||||
AubCmdHdr Header;
|
||||
AubCmdHdr header;
|
||||
struct {
|
||||
uint32_t dwordCount : 16;
|
||||
uint32_t instructionSubOpcode : 7;
|
||||
@@ -382,7 +382,7 @@ struct CmdServicesMemTraceRegisterWrite {
|
||||
|
||||
struct CmdServicesMemTraceMemoryCompare {
|
||||
union {
|
||||
AubCmdHdr Header;
|
||||
AubCmdHdr header;
|
||||
struct {
|
||||
uint32_t dwordCount : 16;
|
||||
uint32_t instructionSubOpcode : 7;
|
||||
@@ -527,7 +527,7 @@ struct CmdServicesMemTraceMemoryCompare {
|
||||
|
||||
struct CmdServicesMemTraceMemoryPoll {
|
||||
union {
|
||||
AubCmdHdr Header;
|
||||
AubCmdHdr header;
|
||||
struct {
|
||||
uint32_t dwordCount : 16;
|
||||
uint32_t instructionSubOpcode : 7;
|
||||
@@ -665,7 +665,7 @@ struct CmdServicesMemTraceMemoryPoll {
|
||||
|
||||
struct CmdServicesMemTraceMemoryWrite {
|
||||
union {
|
||||
AubCmdHdr Header;
|
||||
AubCmdHdr header;
|
||||
struct {
|
||||
uint32_t dwordCount : 16;
|
||||
uint32_t instructionSubOpcode : 7;
|
||||
@@ -816,7 +816,7 @@ struct CmdServicesMemTraceMemoryWrite {
|
||||
|
||||
struct CmdServicesMemTraceMemoryWriteDiscontiguous {
|
||||
union {
|
||||
AubCmdHdr Header;
|
||||
AubCmdHdr header;
|
||||
struct {
|
||||
uint32_t dwordCount : 16;
|
||||
uint32_t instructionSubOpcode : 7;
|
||||
@@ -835,7 +835,7 @@ struct CmdServicesMemTraceMemoryWriteDiscontiguous {
|
||||
struct {
|
||||
uint64_t address;
|
||||
uint32_t dataSizeInBytes;
|
||||
} Dword_2_To_190[63];
|
||||
} dword2To190[63];
|
||||
int32_t getDword2To190Length() const {
|
||||
return 190 - (2) + 1;
|
||||
}
|
||||
@@ -960,7 +960,7 @@ struct CmdServicesMemTraceMemoryWriteDiscontiguous {
|
||||
|
||||
struct CmdServicesMemTraceFrameBegin {
|
||||
union {
|
||||
AubCmdHdr Header;
|
||||
AubCmdHdr header;
|
||||
struct {
|
||||
uint32_t dwordCount : 16;
|
||||
uint32_t instructionSubOpcode : 7;
|
||||
@@ -1002,7 +1002,7 @@ struct CmdServicesMemTraceFrameBegin {
|
||||
|
||||
struct CmdServicesMemTraceComment {
|
||||
union {
|
||||
AubCmdHdr Header;
|
||||
AubCmdHdr header;
|
||||
struct {
|
||||
uint32_t dwordCount : 16;
|
||||
uint32_t instructionSubOpcode : 7;
|
||||
@@ -1049,7 +1049,7 @@ struct CmdServicesMemTraceComment {
|
||||
|
||||
struct CmdServicesMemTraceDelay {
|
||||
union {
|
||||
AubCmdHdr Header;
|
||||
AubCmdHdr header;
|
||||
struct {
|
||||
uint32_t dwordCount : 16;
|
||||
uint32_t instructionSubOpcode : 7;
|
||||
@@ -1088,7 +1088,7 @@ struct CmdServicesMemTraceDelay {
|
||||
|
||||
struct CmdServicesMemTraceMemoryDump {
|
||||
union {
|
||||
AubCmdHdr Header;
|
||||
AubCmdHdr header;
|
||||
struct {
|
||||
uint32_t dwordCount : 16;
|
||||
uint32_t instructionSubOpcode : 7;
|
||||
@@ -1151,7 +1151,7 @@ struct CmdServicesMemTraceMemoryDump {
|
||||
|
||||
struct CmdServicesMemTraceTestPhaseMarker {
|
||||
union {
|
||||
AubCmdHdr Header;
|
||||
AubCmdHdr header;
|
||||
struct {
|
||||
uint32_t dwordCount : 16;
|
||||
uint32_t instructionSubOpcode : 7;
|
||||
@@ -1202,7 +1202,7 @@ struct CmdServicesMemTraceTestPhaseMarker {
|
||||
|
||||
struct CmdServicesMemTraceMemoryContinuousRegion {
|
||||
union {
|
||||
AubCmdHdr Header;
|
||||
AubCmdHdr header;
|
||||
struct {
|
||||
uint32_t dwordCount : 16;
|
||||
uint32_t instructionSubOpcode : 7;
|
||||
@@ -1248,7 +1248,7 @@ struct CmdServicesMemTraceMemoryContinuousRegion {
|
||||
|
||||
struct CmdServicesMemTracePredicate {
|
||||
union {
|
||||
AubCmdHdr Header;
|
||||
AubCmdHdr header;
|
||||
struct {
|
||||
uint32_t dwordCount : 16;
|
||||
uint32_t instructionSubOpcode : 7;
|
||||
@@ -1308,7 +1308,7 @@ struct CmdServicesMemTracePredicate {
|
||||
|
||||
struct CmdServicesMemTraceDumpCompress {
|
||||
union {
|
||||
AubCmdHdr Header;
|
||||
AubCmdHdr header;
|
||||
struct {
|
||||
uint32_t dwordCount : 16;
|
||||
uint32_t instructionSubOpcode : 7;
|
||||
|
||||
@@ -564,17 +564,17 @@ void AUBCommandStreamReceiverHw<GfxFamily>::submitBatchBufferAub(uint64_t batchB
|
||||
{
|
||||
typename AUB::MiContextDescriptorReg contextDescriptor = {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
|
||||
|
||||
contextDescriptor.sData.Valid = true;
|
||||
contextDescriptor.sData.ForcePageDirRestore = false;
|
||||
contextDescriptor.sData.ForceRestore = false;
|
||||
contextDescriptor.sData.Legacy = true;
|
||||
contextDescriptor.sData.FaultSupport = 0;
|
||||
contextDescriptor.sData.PrivilegeAccessOrPPGTT = true;
|
||||
contextDescriptor.sData.ADor64bitSupport = AUB::Traits::addressingBits > 32;
|
||||
contextDescriptor.sData.valid = true;
|
||||
contextDescriptor.sData.forcePageDirRestore = false;
|
||||
contextDescriptor.sData.forceRestore = false;
|
||||
contextDescriptor.sData.legacy = true;
|
||||
contextDescriptor.sData.faultSupport = 0;
|
||||
contextDescriptor.sData.privilegeAccessOrPPGTT = true;
|
||||
contextDescriptor.sData.aDor64bitSupport = AUB::Traits::addressingBits > 32;
|
||||
|
||||
auto ggttLRCA = engineInfo.ggttLRCA;
|
||||
contextDescriptor.sData.LogicalRingCtxAddress = ggttLRCA / 4096;
|
||||
contextDescriptor.sData.ContextID = 0;
|
||||
contextDescriptor.sData.logicalRingCtxAddress = ggttLRCA / 4096;
|
||||
contextDescriptor.sData.contextID = 0;
|
||||
|
||||
this->submitLRCA(contextDescriptor);
|
||||
}
|
||||
|
||||
@@ -375,17 +375,17 @@ void TbxCommandStreamReceiverHw<GfxFamily>::submitBatchBufferTbx(uint64_t batchB
|
||||
{
|
||||
typename AUB::MiContextDescriptorReg contextDescriptor = {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
|
||||
|
||||
contextDescriptor.sData.Valid = true;
|
||||
contextDescriptor.sData.ForcePageDirRestore = false;
|
||||
contextDescriptor.sData.ForceRestore = false;
|
||||
contextDescriptor.sData.Legacy = true;
|
||||
contextDescriptor.sData.FaultSupport = 0;
|
||||
contextDescriptor.sData.PrivilegeAccessOrPPGTT = true;
|
||||
contextDescriptor.sData.ADor64bitSupport = AUB::Traits::addressingBits > 32;
|
||||
contextDescriptor.sData.valid = true;
|
||||
contextDescriptor.sData.forcePageDirRestore = false;
|
||||
contextDescriptor.sData.forceRestore = false;
|
||||
contextDescriptor.sData.legacy = true;
|
||||
contextDescriptor.sData.faultSupport = 0;
|
||||
contextDescriptor.sData.privilegeAccessOrPPGTT = true;
|
||||
contextDescriptor.sData.aDor64bitSupport = AUB::Traits::addressingBits > 32;
|
||||
|
||||
auto ggttLRCA = engineInfo.ggttLRCA;
|
||||
contextDescriptor.sData.LogicalRingCtxAddress = ggttLRCA / 4096;
|
||||
contextDescriptor.sData.ContextID = 0;
|
||||
contextDescriptor.sData.logicalRingCtxAddress = ggttLRCA / 4096;
|
||||
contextDescriptor.sData.contextID = 0;
|
||||
|
||||
this->submitLRCA(contextDescriptor);
|
||||
}
|
||||
|
||||
@@ -121,8 +121,8 @@ void DebuggerL0::printTrackedAddresses(uint32_t contextId) {
|
||||
" ioba = %" SCNx64
|
||||
" iba = %" SCNx64
|
||||
" bsurfsba = %" SCNx64 "\n",
|
||||
sba->SurfaceStateBaseAddress, sba->GeneralStateBaseAddress, sba->DynamicStateBaseAddress,
|
||||
sba->IndirectObjectBaseAddress, sba->InstructionBaseAddress, sba->BindlessSurfaceStateBaseAddress);
|
||||
sba->surfaceStateBaseAddress, sba->generalStateBaseAddress, sba->dynamicStateBaseAddress,
|
||||
sba->indirectObjectBaseAddress, sba->instructionBaseAddress, sba->bindlessSurfaceStateBaseAddress);
|
||||
}
|
||||
|
||||
DebuggerL0 ::~DebuggerL0() {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2020-2022 Intel Corporation
|
||||
* Copyright (C) 2020-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -24,16 +24,16 @@ class OSInterface;
|
||||
#pragma pack(1)
|
||||
struct SbaTrackedAddresses {
|
||||
char magic[8] = "sbaarea";
|
||||
uint64_t Reserved1 = 0;
|
||||
uint8_t Version = 0;
|
||||
uint8_t Reserved2[7];
|
||||
uint64_t GeneralStateBaseAddress = 0;
|
||||
uint64_t SurfaceStateBaseAddress = 0;
|
||||
uint64_t DynamicStateBaseAddress = 0;
|
||||
uint64_t IndirectObjectBaseAddress = 0;
|
||||
uint64_t InstructionBaseAddress = 0;
|
||||
uint64_t BindlessSurfaceStateBaseAddress = 0;
|
||||
uint64_t BindlessSamplerStateBaseAddress = 0;
|
||||
uint64_t reserved1 = 0;
|
||||
uint8_t version = 0;
|
||||
uint8_t reserved2[7];
|
||||
uint64_t generalStateBaseAddress = 0;
|
||||
uint64_t surfaceStateBaseAddress = 0;
|
||||
uint64_t dynamicStateBaseAddress = 0;
|
||||
uint64_t indirectObjectBaseAddress = 0;
|
||||
uint64_t instructionBaseAddress = 0;
|
||||
uint64_t bindlessSurfaceStateBaseAddress = 0;
|
||||
uint64_t bindlessSamplerStateBaseAddress = 0;
|
||||
};
|
||||
|
||||
struct DebugAreaHeader {
|
||||
|
||||
@@ -47,7 +47,7 @@ void DebuggerL0Hw<GfxFamily>::captureStateBaseAddress(NEO::LinearStream &cmdStre
|
||||
if (sbaCanonized.GeneralStateBaseAddress) {
|
||||
auto generalStateBaseAddress = sbaCanonized.GeneralStateBaseAddress;
|
||||
NEO::EncodeStoreMemory<GfxFamily>::programStoreDataImm(cmdStream,
|
||||
gpuAddress + offsetof(SbaTrackedAddresses, GeneralStateBaseAddress),
|
||||
gpuAddress + offsetof(SbaTrackedAddresses, generalStateBaseAddress),
|
||||
static_cast<uint32_t>(generalStateBaseAddress & 0x0000FFFFFFFFULL),
|
||||
static_cast<uint32_t>(generalStateBaseAddress >> 32),
|
||||
true,
|
||||
@@ -56,7 +56,7 @@ void DebuggerL0Hw<GfxFamily>::captureStateBaseAddress(NEO::LinearStream &cmdStre
|
||||
if (sbaCanonized.SurfaceStateBaseAddress) {
|
||||
auto surfaceStateBaseAddress = sbaCanonized.SurfaceStateBaseAddress;
|
||||
NEO::EncodeStoreMemory<GfxFamily>::programStoreDataImm(cmdStream,
|
||||
gpuAddress + offsetof(SbaTrackedAddresses, SurfaceStateBaseAddress),
|
||||
gpuAddress + offsetof(SbaTrackedAddresses, surfaceStateBaseAddress),
|
||||
static_cast<uint32_t>(surfaceStateBaseAddress & 0x0000FFFFFFFFULL),
|
||||
static_cast<uint32_t>(surfaceStateBaseAddress >> 32),
|
||||
true,
|
||||
@@ -65,7 +65,7 @@ void DebuggerL0Hw<GfxFamily>::captureStateBaseAddress(NEO::LinearStream &cmdStre
|
||||
if (sbaCanonized.DynamicStateBaseAddress) {
|
||||
auto dynamicStateBaseAddress = sbaCanonized.DynamicStateBaseAddress;
|
||||
NEO::EncodeStoreMemory<GfxFamily>::programStoreDataImm(cmdStream,
|
||||
gpuAddress + offsetof(SbaTrackedAddresses, DynamicStateBaseAddress),
|
||||
gpuAddress + offsetof(SbaTrackedAddresses, dynamicStateBaseAddress),
|
||||
static_cast<uint32_t>(dynamicStateBaseAddress & 0x0000FFFFFFFFULL),
|
||||
static_cast<uint32_t>(dynamicStateBaseAddress >> 32),
|
||||
true,
|
||||
@@ -74,7 +74,7 @@ void DebuggerL0Hw<GfxFamily>::captureStateBaseAddress(NEO::LinearStream &cmdStre
|
||||
if (sbaCanonized.IndirectObjectBaseAddress) {
|
||||
auto indirectObjectBaseAddress = sbaCanonized.IndirectObjectBaseAddress;
|
||||
NEO::EncodeStoreMemory<GfxFamily>::programStoreDataImm(cmdStream,
|
||||
gpuAddress + offsetof(SbaTrackedAddresses, IndirectObjectBaseAddress),
|
||||
gpuAddress + offsetof(SbaTrackedAddresses, indirectObjectBaseAddress),
|
||||
static_cast<uint32_t>(indirectObjectBaseAddress & 0x0000FFFFFFFFULL),
|
||||
static_cast<uint32_t>(indirectObjectBaseAddress >> 32),
|
||||
true,
|
||||
@@ -83,7 +83,7 @@ void DebuggerL0Hw<GfxFamily>::captureStateBaseAddress(NEO::LinearStream &cmdStre
|
||||
if (sbaCanonized.InstructionBaseAddress) {
|
||||
auto instructionBaseAddress = sbaCanonized.InstructionBaseAddress;
|
||||
NEO::EncodeStoreMemory<GfxFamily>::programStoreDataImm(cmdStream,
|
||||
gpuAddress + offsetof(SbaTrackedAddresses, InstructionBaseAddress),
|
||||
gpuAddress + offsetof(SbaTrackedAddresses, instructionBaseAddress),
|
||||
static_cast<uint32_t>(instructionBaseAddress & 0x0000FFFFFFFFULL),
|
||||
static_cast<uint32_t>(instructionBaseAddress >> 32),
|
||||
true,
|
||||
@@ -92,7 +92,7 @@ void DebuggerL0Hw<GfxFamily>::captureStateBaseAddress(NEO::LinearStream &cmdStre
|
||||
if (sbaCanonized.BindlessSurfaceStateBaseAddress) {
|
||||
auto bindlessSurfaceStateBaseAddress = sbaCanonized.BindlessSurfaceStateBaseAddress;
|
||||
NEO::EncodeStoreMemory<GfxFamily>::programStoreDataImm(cmdStream,
|
||||
gpuAddress + offsetof(SbaTrackedAddresses, BindlessSurfaceStateBaseAddress),
|
||||
gpuAddress + offsetof(SbaTrackedAddresses, bindlessSurfaceStateBaseAddress),
|
||||
static_cast<uint32_t>(bindlessSurfaceStateBaseAddress & 0x0000FFFFFFFFULL),
|
||||
static_cast<uint32_t>(bindlessSurfaceStateBaseAddress >> 32),
|
||||
true,
|
||||
|
||||
@@ -38,22 +38,22 @@ void DebuggerL0Hw<GfxFamily>::programSbaTrackingCommandsSingleAddressSpace(NEO::
|
||||
std::vector<std::pair<size_t, uint64_t>> fieldOffsetAndValue;
|
||||
|
||||
if (sba.GeneralStateBaseAddress) {
|
||||
fieldOffsetAndValue.push_back({offsetof(SbaTrackedAddresses, GeneralStateBaseAddress), sba.GeneralStateBaseAddress});
|
||||
fieldOffsetAndValue.push_back({offsetof(SbaTrackedAddresses, generalStateBaseAddress), sba.GeneralStateBaseAddress});
|
||||
}
|
||||
if (sba.SurfaceStateBaseAddress) {
|
||||
fieldOffsetAndValue.push_back({offsetof(SbaTrackedAddresses, SurfaceStateBaseAddress), sba.SurfaceStateBaseAddress});
|
||||
fieldOffsetAndValue.push_back({offsetof(SbaTrackedAddresses, surfaceStateBaseAddress), sba.SurfaceStateBaseAddress});
|
||||
}
|
||||
if (sba.DynamicStateBaseAddress) {
|
||||
fieldOffsetAndValue.push_back({offsetof(SbaTrackedAddresses, DynamicStateBaseAddress), sba.DynamicStateBaseAddress});
|
||||
fieldOffsetAndValue.push_back({offsetof(SbaTrackedAddresses, dynamicStateBaseAddress), sba.DynamicStateBaseAddress});
|
||||
}
|
||||
if (sba.IndirectObjectBaseAddress) {
|
||||
fieldOffsetAndValue.push_back({offsetof(SbaTrackedAddresses, IndirectObjectBaseAddress), sba.IndirectObjectBaseAddress});
|
||||
fieldOffsetAndValue.push_back({offsetof(SbaTrackedAddresses, indirectObjectBaseAddress), sba.IndirectObjectBaseAddress});
|
||||
}
|
||||
if (sba.InstructionBaseAddress) {
|
||||
fieldOffsetAndValue.push_back({offsetof(SbaTrackedAddresses, InstructionBaseAddress), sba.InstructionBaseAddress});
|
||||
fieldOffsetAndValue.push_back({offsetof(SbaTrackedAddresses, instructionBaseAddress), sba.InstructionBaseAddress});
|
||||
}
|
||||
if (sba.BindlessSurfaceStateBaseAddress) {
|
||||
fieldOffsetAndValue.push_back({offsetof(SbaTrackedAddresses, BindlessSurfaceStateBaseAddress), sba.BindlessSurfaceStateBaseAddress});
|
||||
fieldOffsetAndValue.push_back({offsetof(SbaTrackedAddresses, bindlessSurfaceStateBaseAddress), sba.BindlessSurfaceStateBaseAddress});
|
||||
}
|
||||
const auto cmdStreamGpuBase = cmdStream.getGpuBase();
|
||||
const auto cmdStreamCpuBase = reinterpret_cast<uint64_t>(cmdStream.getCpuBase());
|
||||
|
||||
@@ -521,10 +521,10 @@ bool Device::getDeviceAndHostTimer(uint64_t *deviceTimestamp, uint64_t *hostTime
|
||||
TimeStampData timeStamp;
|
||||
auto retVal = getOSTime()->getCpuGpuTime(&timeStamp);
|
||||
if (retVal) {
|
||||
*hostTimestamp = timeStamp.CPUTimeinNS;
|
||||
*hostTimestamp = timeStamp.cpuTimeinNS;
|
||||
if (DebugManager.flags.EnableDeviceBasedTimestamps.get()) {
|
||||
auto resolution = getOSTime()->getDynamicDeviceTimerResolution(getHardwareInfo());
|
||||
*deviceTimestamp = static_cast<uint64_t>(timeStamp.GPUTimeStamp * resolution);
|
||||
*deviceTimestamp = static_cast<uint64_t>(timeStamp.gpuTimeStamp * resolution);
|
||||
} else
|
||||
*deviceTimestamp = *hostTimestamp;
|
||||
}
|
||||
|
||||
@@ -123,7 +123,7 @@ void Gmm::setupImageResourceParams(ImageInfo &imgInfo, bool preferCompressed) {
|
||||
|
||||
resourceParams.Usage = CacheSettingsHelper::getGmmUsageType(AllocationType::IMAGE, false, productHelper);
|
||||
|
||||
resourceParams.Format = imgInfo.surfaceFormat->GMMSurfaceFormat;
|
||||
resourceParams.Format = imgInfo.surfaceFormat->gmmSurfaceFormat;
|
||||
resourceParams.Flags.Gpu.Texture = 1;
|
||||
resourceParams.BaseWidth64 = imageWidth;
|
||||
resourceParams.BaseHeight = imageHeight;
|
||||
@@ -157,9 +157,9 @@ void Gmm::applyAuxFlagsForImage(ImageInfo &imgInfo, bool preferCompressed) {
|
||||
auto &gfxCoreHelper = rootDeviceEnvironment.getHelper<GfxCoreHelper>();
|
||||
auto hardwareInfo = rootDeviceEnvironment.getHardwareInfo();
|
||||
if (this->resourceParams.Flags.Info.MediaCompressed) {
|
||||
compressionFormat = gmmHelper->getClientContext()->getMediaSurfaceStateCompressionFormat(imgInfo.surfaceFormat->GMMSurfaceFormat);
|
||||
compressionFormat = gmmHelper->getClientContext()->getMediaSurfaceStateCompressionFormat(imgInfo.surfaceFormat->gmmSurfaceFormat);
|
||||
} else {
|
||||
compressionFormat = gmmHelper->getClientContext()->getSurfaceStateCompressionFormat(imgInfo.surfaceFormat->GMMSurfaceFormat);
|
||||
compressionFormat = gmmHelper->getClientContext()->getSurfaceStateCompressionFormat(imgInfo.surfaceFormat->gmmSurfaceFormat);
|
||||
}
|
||||
|
||||
bool compressionFormatSupported = false;
|
||||
@@ -169,15 +169,15 @@ void Gmm::applyAuxFlagsForImage(ImageInfo &imgInfo, bool preferCompressed) {
|
||||
compressionFormatSupported = compressionFormat != GMM_E2ECOMP_FORMAT::GMM_E2ECOMP_FORMAT_INVALID;
|
||||
}
|
||||
|
||||
const bool isPackedYuv = imgInfo.surfaceFormat->GMMSurfaceFormat == GMM_FORMAT_YUY2 ||
|
||||
imgInfo.surfaceFormat->GMMSurfaceFormat == GMM_FORMAT_UYVY ||
|
||||
imgInfo.surfaceFormat->GMMSurfaceFormat == GMM_FORMAT_YVYU ||
|
||||
imgInfo.surfaceFormat->GMMSurfaceFormat == GMM_FORMAT_VYUY;
|
||||
const bool isPackedYuv = imgInfo.surfaceFormat->gmmSurfaceFormat == GMM_FORMAT_YUY2 ||
|
||||
imgInfo.surfaceFormat->gmmSurfaceFormat == GMM_FORMAT_UYVY ||
|
||||
imgInfo.surfaceFormat->gmmSurfaceFormat == GMM_FORMAT_YVYU ||
|
||||
imgInfo.surfaceFormat->gmmSurfaceFormat == GMM_FORMAT_VYUY;
|
||||
|
||||
bool allowCompression = GfxCoreHelper::compressedImagesSupported(*hardwareInfo) &&
|
||||
preferCompressed &&
|
||||
compressionFormatSupported &&
|
||||
imgInfo.surfaceFormat->GMMSurfaceFormat != GMM_RESOURCE_FORMAT::GMM_FORMAT_NV12 &&
|
||||
imgInfo.surfaceFormat->gmmSurfaceFormat != GMM_RESOURCE_FORMAT::GMM_FORMAT_NV12 &&
|
||||
imgInfo.plane == GMM_YUV_PLANE_ENUM::GMM_NO_PLANE &&
|
||||
!isPackedYuv;
|
||||
|
||||
@@ -234,7 +234,7 @@ void Gmm::queryImageParams(ImageInfo &imgInfo) {
|
||||
imgInfo.offset = reqOffsetInfo.Render.Offset;
|
||||
}
|
||||
|
||||
if (imgInfo.surfaceFormat->GMMSurfaceFormat == GMM_RESOURCE_FORMAT::GMM_FORMAT_NV12 || imgInfo.surfaceFormat->GMMSurfaceFormat == GMM_RESOURCE_FORMAT::GMM_FORMAT_P010) {
|
||||
if (imgInfo.surfaceFormat->gmmSurfaceFormat == GMM_RESOURCE_FORMAT::GMM_FORMAT_NV12 || imgInfo.surfaceFormat->gmmSurfaceFormat == GMM_RESOURCE_FORMAT::GMM_FORMAT_P010) {
|
||||
GMM_REQ_OFFSET_INFO reqOffsetInfo = {};
|
||||
reqOffsetInfo.ReqLock = 1;
|
||||
reqOffsetInfo.Slice = 1;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2020-2021 Intel Corporation
|
||||
* Copyright (C) 2020-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -193,12 +193,12 @@ enum class ImagePlane {
|
||||
};
|
||||
|
||||
struct SurfaceFormatInfo {
|
||||
GMM_RESOURCE_FORMAT GMMSurfaceFormat;
|
||||
GFX3DSTATE_SURFACEFORMAT GenxSurfaceFormat;
|
||||
uint32_t GMMTileWalk;
|
||||
uint32_t NumChannels;
|
||||
uint32_t PerChannelSizeInBytes;
|
||||
size_t ImageElementSizeInBytes;
|
||||
GMM_RESOURCE_FORMAT gmmSurfaceFormat;
|
||||
GFX3DSTATE_SURFACEFORMAT genxSurfaceFormat;
|
||||
uint32_t gmmTileWalk;
|
||||
uint32_t numChannels;
|
||||
uint32_t perChannelSizeInBytes;
|
||||
size_t imageElementSizeInBytes;
|
||||
};
|
||||
|
||||
enum class ImageType {
|
||||
|
||||
@@ -91,7 +91,7 @@ inline void setImageSurfaceState(typename GfxFamily::RENDER_SURFACE_STATE *surfa
|
||||
surfaceState->setXOffsetForUOrUvPlane(0);
|
||||
}
|
||||
|
||||
surfaceState->setSurfaceFormat(static_cast<SURFACE_FORMAT>(imageInfo.surfaceFormat->GenxSurfaceFormat));
|
||||
surfaceState->setSurfaceFormat(static_cast<SURFACE_FORMAT>(imageInfo.surfaceFormat->genxSurfaceFormat));
|
||||
setFilterMode<GfxFamily>(surfaceState, gmmHelper.getHardwareInfo());
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ inline void setImageSurfaceStateDimensions(typename GfxFamily::RENDER_SURFACE_ST
|
||||
|
||||
template <typename GfxFamily>
|
||||
inline void setWidthForMediaBlockSurfaceState(typename GfxFamily::RENDER_SURFACE_STATE *surfaceState, const ImageInfo &imageInfo) {
|
||||
auto elSize = imageInfo.surfaceFormat->ImageElementSizeInBytes;
|
||||
auto elSize = imageInfo.surfaceFormat->imageElementSizeInBytes;
|
||||
auto numDwords = static_cast<uint32_t>(Math::divideAndRoundUp(imageInfo.imgDesc.imageWidth * elSize, sizeof(uint32_t)));
|
||||
surfaceState->setWidth(numDwords);
|
||||
}
|
||||
|
||||
@@ -887,7 +887,7 @@ bool MemoryManager::isCopyRequired(ImageInfo &imgInfo, const void *hostPtr) {
|
||||
break;
|
||||
}
|
||||
|
||||
auto hostPtrRowPitch = imgInfo.imgDesc.imageRowPitch ? imgInfo.imgDesc.imageRowPitch : imageWidth * imgInfo.surfaceFormat->ImageElementSizeInBytes;
|
||||
auto hostPtrRowPitch = imgInfo.imgDesc.imageRowPitch ? imgInfo.imgDesc.imageRowPitch : imageWidth * imgInfo.surfaceFormat->imageElementSizeInBytes;
|
||||
auto hostPtrSlicePitch = imgInfo.imgDesc.imageSlicePitch ? imgInfo.imgDesc.imageSlicePitch : hostPtrRowPitch * imgInfo.imgDesc.imageHeight;
|
||||
|
||||
size_t pointerPassedSize = hostPtrRowPitch * imageHeight * imageDepth * imageCount;
|
||||
|
||||
@@ -102,10 +102,10 @@ bool DeviceTimeDrm::getCpuGpuTime(TimeStampData *pGpuCpuTime, OSTime *osTime) {
|
||||
if (nullptr == this->getGpuTime) {
|
||||
return false;
|
||||
}
|
||||
if (!(this->*getGpuTime)(&pGpuCpuTime->GPUTimeStamp)) {
|
||||
if (!(this->*getGpuTime)(&pGpuCpuTime->gpuTimeStamp)) {
|
||||
return false;
|
||||
}
|
||||
if (!osTime->getCpuTime(&pGpuCpuTime->CPUTimeinNS)) {
|
||||
if (!osTime->getCpuTime(&pGpuCpuTime->cpuTimeinNS)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,8 +16,8 @@ double OSTime::getDeviceTimerResolution(HardwareInfo const &hwInfo) {
|
||||
};
|
||||
|
||||
bool DeviceTime::getCpuGpuTime(TimeStampData *pGpuCpuTime, OSTime *osTime) {
|
||||
pGpuCpuTime->CPUTimeinNS = 0;
|
||||
pGpuCpuTime->GPUTimeStamp = 0;
|
||||
pGpuCpuTime->cpuTimeinNS = 0;
|
||||
pGpuCpuTime->gpuTimeStamp = 0;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -16,8 +16,8 @@ class OSInterface;
|
||||
struct HardwareInfo;
|
||||
|
||||
struct TimeStampData {
|
||||
uint64_t GPUTimeStamp; // GPU time in counter ticks
|
||||
uint64_t CPUTimeinNS; // CPU time in ns
|
||||
uint64_t gpuTimeStamp; // GPU time in counter ticks
|
||||
uint64_t cpuTimeinNS; // CPU time in ns
|
||||
};
|
||||
|
||||
class OSTime;
|
||||
|
||||
@@ -15,17 +15,17 @@ namespace NEO {
|
||||
bool DeviceTimeWddm::getCpuGpuTime(TimeStampData *pGpuCpuTime, OSTime *osTime) {
|
||||
bool retVal = false;
|
||||
|
||||
pGpuCpuTime->CPUTimeinNS = 0;
|
||||
pGpuCpuTime->GPUTimeStamp = 0;
|
||||
pGpuCpuTime->cpuTimeinNS = 0;
|
||||
pGpuCpuTime->gpuTimeStamp = 0;
|
||||
|
||||
TimeStampDataHeader escapeInfo = {};
|
||||
|
||||
if (runEscape(wddm, escapeInfo)) {
|
||||
auto &gfxCoreHelper = wddm->getRootDeviceEnvironment().getHelper<GfxCoreHelper>();
|
||||
convertTimestampsFromOaToCsDomain(gfxCoreHelper, escapeInfo.m_Data.m_Out.gpuPerfTicks, escapeInfo.m_Data.m_Out.gpuPerfFreq, static_cast<uint64_t>(wddm->getTimestampFrequency()));
|
||||
convertTimestampsFromOaToCsDomain(gfxCoreHelper, escapeInfo.data.out.gpuPerfTicks, escapeInfo.data.out.gpuPerfFreq, static_cast<uint64_t>(wddm->getTimestampFrequency()));
|
||||
|
||||
osTime->getCpuTime(&pGpuCpuTime->CPUTimeinNS);
|
||||
pGpuCpuTime->GPUTimeStamp = (unsigned long long)escapeInfo.m_Data.m_Out.gpuPerfTicks;
|
||||
osTime->getCpuTime(&pGpuCpuTime->cpuTimeinNS);
|
||||
pGpuCpuTime->gpuTimeStamp = (unsigned long long)escapeInfo.data.out.gpuPerfTicks;
|
||||
retVal = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -15,19 +15,19 @@ namespace NEO {
|
||||
bool DeviceTimeWddm::getCpuGpuTime(TimeStampData *pGpuCpuTime, OSTime *osTime) {
|
||||
bool retVal = false;
|
||||
|
||||
pGpuCpuTime->CPUTimeinNS = 0;
|
||||
pGpuCpuTime->GPUTimeStamp = 0;
|
||||
pGpuCpuTime->cpuTimeinNS = 0;
|
||||
pGpuCpuTime->gpuTimeStamp = 0;
|
||||
|
||||
TimeStampDataHeader escapeInfo = {};
|
||||
|
||||
if (runEscape(wddm, escapeInfo)) {
|
||||
auto &gfxCoreHelper = wddm->getRootDeviceEnvironment().getHelper<GfxCoreHelper>();
|
||||
convertTimestampsFromOaToCsDomain(gfxCoreHelper, escapeInfo.m_Data.m_Out.gpuPerfTicks, escapeInfo.m_Data.m_Out.gpuPerfFreq, static_cast<uint64_t>(wddm->getTimestampFrequency()));
|
||||
double cpuNanoseconds = escapeInfo.m_Data.m_Out.cpuPerfTicks *
|
||||
(1000000000.0 / escapeInfo.m_Data.m_Out.cpuPerfFreq);
|
||||
convertTimestampsFromOaToCsDomain(gfxCoreHelper, escapeInfo.data.out.gpuPerfTicks, escapeInfo.data.out.gpuPerfFreq, static_cast<uint64_t>(wddm->getTimestampFrequency()));
|
||||
double cpuNanoseconds = escapeInfo.data.out.cpuPerfTicks *
|
||||
(1000000000.0 / escapeInfo.data.out.cpuPerfFreq);
|
||||
|
||||
pGpuCpuTime->CPUTimeinNS = (unsigned long long)cpuNanoseconds;
|
||||
pGpuCpuTime->GPUTimeStamp = (unsigned long long)escapeInfo.m_Data.m_Out.gpuPerfTicks;
|
||||
pGpuCpuTime->cpuTimeinNS = (unsigned long long)cpuNanoseconds;
|
||||
pGpuCpuTime->gpuTimeStamp = (unsigned long long)escapeInfo.data.out.gpuPerfTicks;
|
||||
retVal = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -27,9 +27,9 @@ bool DeviceTimeWddm::runEscape(Wddm *wddm, TimeStampDataHeader &escapeInfo) {
|
||||
GTDIGetGpuCpuTimestampsIn in = {GTDI_FNC_GET_GPU_CPU_TIMESTAMPS};
|
||||
uint32_t outSize = sizeof(GTDIGetGpuCpuTimestampsOut);
|
||||
|
||||
escapeInfo.m_Header.EscapeCode = static_cast<decltype(escapeInfo.m_Header.EscapeCode)>(GFX_ESCAPE_IGPA_INSTRUMENTATION_CONTROL);
|
||||
escapeInfo.m_Header.Size = outSize;
|
||||
escapeInfo.m_Data.m_In = in;
|
||||
escapeInfo.header.EscapeCode = static_cast<decltype(escapeInfo.header.EscapeCode)>(GFX_ESCAPE_IGPA_INSTRUMENTATION_CONTROL);
|
||||
escapeInfo.header.Size = outSize;
|
||||
escapeInfo.data.in = in;
|
||||
|
||||
escapeCommand.Flags.Value = 0;
|
||||
escapeCommand.hAdapter = (D3DKMT_HANDLE)0;
|
||||
|
||||
@@ -34,7 +34,7 @@ typedef enum GTDI_ESCAPE_FUNCTION_ENUM {
|
||||
} GTDI_ESCAPE_FUNCTION;
|
||||
|
||||
typedef struct GTDIBaseInStruct {
|
||||
GTDI_ESCAPE_FUNCTION Function;
|
||||
GTDI_ESCAPE_FUNCTION function;
|
||||
} GTDIHeaderIn;
|
||||
|
||||
typedef GTDIHeaderIn GTDIGetGpuCpuTimestampsIn;
|
||||
@@ -55,7 +55,7 @@ typedef enum GTDI_RETURN_CODE_ENUM {
|
||||
} GTDI_RETURN_CODE;
|
||||
|
||||
typedef struct GTDIGetGpuCpuTimestampsOutStruct {
|
||||
GTDI_RETURN_CODE RetCode; // Result of the call
|
||||
GTDI_RETURN_CODE retCode; // Result of the call
|
||||
uint64_t gpuPerfTicks; // in GPU_timestamp_ticks
|
||||
uint64_t cpuPerfTicks; // in CPU_timestamp_ticks
|
||||
uint64_t gpuPerfFreq; // in GPU_timestamp_ticks/s
|
||||
@@ -63,11 +63,11 @@ typedef struct GTDIGetGpuCpuTimestampsOutStruct {
|
||||
} GTDIGetGpuCpuTimestampsOut;
|
||||
|
||||
struct TimeStampDataHeader {
|
||||
GFX_ESCAPE_HEADER_T m_Header;
|
||||
GFX_ESCAPE_HEADER_T header;
|
||||
union {
|
||||
GTDIGetGpuCpuTimestampsIn m_In;
|
||||
GTDIGetGpuCpuTimestampsOut m_Out;
|
||||
} m_Data;
|
||||
GTDIGetGpuCpuTimestampsIn in;
|
||||
GTDIGetGpuCpuTimestampsOut out;
|
||||
} data;
|
||||
};
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2022 Intel Corporation
|
||||
* Copyright (C) 2018-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -40,7 +40,7 @@ bool Gdi::setupHwQueueProcAddresses() {
|
||||
|
||||
bool Gdi::getAllProcAddresses() {
|
||||
openAdapterFromLuid = gdiDll->getProcAddress("D3DKMTOpenAdapterFromLuid");
|
||||
createAllocation_ = gdiDll->getProcAddress("D3DKMTCreateAllocation");
|
||||
createAllocation = gdiDll->getProcAddress("D3DKMTCreateAllocation");
|
||||
shareObjects = reinterpret_cast<decltype(shareObjects)>(gdiDll->getProcAddress("D3DKMTShareObjects"));
|
||||
createAllocation2 = gdiDll->getProcAddress("D3DKMTCreateAllocation2");
|
||||
destroyAllocation2 = gdiDll->getProcAddress("D3DKMTDestroyAllocation2");
|
||||
|
||||
@@ -20,7 +20,7 @@ class Gdi {
|
||||
MOCKABLE_VIRTUAL ~Gdi();
|
||||
|
||||
ThkWrapper<IN OUT CONST D3DKMT_OPENADAPTERFROMLUID *> openAdapterFromLuid{};
|
||||
ThkWrapper<IN OUT D3DKMT_CREATEALLOCATION *> createAllocation_{};
|
||||
ThkWrapper<IN OUT D3DKMT_CREATEALLOCATION *> createAllocation{};
|
||||
ThkWrapper<IN OUT D3DKMT_CREATEALLOCATION *> createAllocation2{};
|
||||
NTSTATUS(APIENTRY *shareObjects)
|
||||
(UINT cObjects, const D3DKMT_HANDLE *hObjects, POBJECT_ATTRIBUTES pObjectAttributes, DWORD dwDesiredAccess, HANDLE *phSharedNtHandle) = {};
|
||||
|
||||
@@ -16,9 +16,9 @@ typedef struct GFX_ESCAPE_HEADER { // NOLINT(readability-identifier-naming)
|
||||
union {
|
||||
struct
|
||||
{
|
||||
unsigned int Size;
|
||||
unsigned int CheckSum;
|
||||
unsigned int EscapeCode;
|
||||
unsigned int Size; // NOLINT(readability-identifier-naming)
|
||||
unsigned int CheckSum; // NOLINT(readability-identifier-naming)
|
||||
unsigned int EscapeCode; // NOLINT(readability-identifier-naming)
|
||||
|
||||
unsigned int ulReserved;
|
||||
};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2021-2022 Intel Corporation
|
||||
* Copyright (C) 2021-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -28,7 +28,7 @@ bool Wddm::configureDeviceAddressSpace() {
|
||||
deviceCallbacks.PagingQueue = pagingQueue;
|
||||
deviceCallbacks.PagingFence = pagingQueueSyncObject;
|
||||
|
||||
deviceCallbacks.DevCbPtrs.KmtCbPtrs.pfnAllocate = getGdi()->createAllocation_;
|
||||
deviceCallbacks.DevCbPtrs.KmtCbPtrs.pfnAllocate = getGdi()->createAllocation;
|
||||
deviceCallbacks.DevCbPtrs.KmtCbPtrs.pfnDeallocate = getGdi()->destroyAllocation;
|
||||
deviceCallbacks.DevCbPtrs.KmtCbPtrs.pfnMapGPUVA = getGdi()->mapGpuVirtualAddress;
|
||||
deviceCallbacks.DevCbPtrs.KmtCbPtrs.pfnMakeResident = getGdi()->makeResident;
|
||||
|
||||
@@ -53,7 +53,7 @@ void PerfProfiler::destroyAll() {
|
||||
}
|
||||
|
||||
PerfProfiler::PerfProfiler(int id, std::unique_ptr<std::ostream> &&logOut, std::unique_ptr<std::ostream> &&sysLogOut) {
|
||||
ApiTimer.setFreq();
|
||||
apiTimer.setFreq();
|
||||
|
||||
systemLogs.reserve(20);
|
||||
|
||||
|
||||
@@ -43,25 +43,25 @@ class PerfProfiler {
|
||||
totalSystemTime = 0;
|
||||
systemLogs.clear();
|
||||
systemLogs.reserve(20);
|
||||
ApiTimer.start();
|
||||
apiTimer.start();
|
||||
}
|
||||
|
||||
void apiLeave(const char *func) {
|
||||
ApiTimer.end();
|
||||
logTimes(ApiTimer.getStart(), ApiTimer.getEnd(), ApiTimer.get(), totalSystemTime, func);
|
||||
apiTimer.end();
|
||||
logTimes(apiTimer.getStart(), apiTimer.getEnd(), apiTimer.get(), totalSystemTime, func);
|
||||
}
|
||||
|
||||
void logTimes(long long start, long long end, long long span, unsigned long long totalSystem, const char *function);
|
||||
void logSysTimes(long long start, unsigned long long time, unsigned int id);
|
||||
|
||||
void systemEnter() {
|
||||
SystemTimer.start();
|
||||
systemTimer.start();
|
||||
}
|
||||
|
||||
void systemLeave(unsigned int id) {
|
||||
SystemTimer.end();
|
||||
logSysTimes(SystemTimer.getStart(), SystemTimer.get(), id);
|
||||
totalSystemTime += SystemTimer.get();
|
||||
systemTimer.end();
|
||||
logSysTimes(systemTimer.getStart(), systemTimer.get(), id);
|
||||
totalSystemTime += systemTimer.get();
|
||||
}
|
||||
|
||||
std::ostream *getLogStream() {
|
||||
@@ -88,8 +88,8 @@ class PerfProfiler {
|
||||
protected:
|
||||
static std::atomic<int> counter;
|
||||
static PerfProfiler *objects[PerfProfiler::objectsNumber];
|
||||
Timer ApiTimer;
|
||||
Timer SystemTimer;
|
||||
Timer apiTimer;
|
||||
Timer systemTimer;
|
||||
unsigned long long totalSystemTime = 0;
|
||||
std::unique_ptr<std::ostream> logFile;
|
||||
std::unique_ptr<std::ostream> sysLogFile;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2021-2022 Intel Corporation
|
||||
* Copyright (C) 2021-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -61,17 +61,17 @@ void SWTagHeapInfo::bxml(std::ostream &os) {
|
||||
|
||||
uint32_t BaseTag::getMarkerNoopID(OpCode opcode) {
|
||||
MarkerNoopID id;
|
||||
id.OpCode = static_cast<uint32_t>(opcode);
|
||||
id.Reserved = 0;
|
||||
id.opCode = static_cast<uint32_t>(opcode);
|
||||
id.reserved = 0;
|
||||
return id.value;
|
||||
}
|
||||
|
||||
uint32_t BaseTag::getOffsetNoopID(uint32_t offset) {
|
||||
OffsetNoopID id;
|
||||
id.Offset = offset / sizeof(uint32_t);
|
||||
id.SubTag = 0;
|
||||
id.MagicBit = 1;
|
||||
id.Reserved = 0;
|
||||
id.offset = offset / sizeof(uint32_t);
|
||||
id.subTag = 0;
|
||||
id.magicBit = 1;
|
||||
id.reserved = 0;
|
||||
return id.value;
|
||||
}
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ struct BaseTag {
|
||||
reserved(0),
|
||||
component(static_cast<uint32_t>(Component::COMMON)),
|
||||
driverDebug(1),
|
||||
DWORDCount(static_cast<uint32_t>(size / sizeof(uint32_t) - 2)) {}
|
||||
dwordCount(static_cast<uint32_t>(size / sizeof(uint32_t) - 2)) {}
|
||||
|
||||
OpCode getOpCode() const { return static_cast<OpCode>(opcode); }
|
||||
static uint32_t getMarkerNoopID(OpCode opcode);
|
||||
@@ -61,17 +61,17 @@ struct BaseTag {
|
||||
protected:
|
||||
union MarkerNoopID {
|
||||
struct {
|
||||
uint32_t OpCode : 20;
|
||||
uint32_t Reserved : 12;
|
||||
uint32_t opCode : 20;
|
||||
uint32_t reserved : 12;
|
||||
};
|
||||
uint32_t value;
|
||||
};
|
||||
union OffsetNoopID {
|
||||
struct {
|
||||
uint32_t Offset : 20;
|
||||
uint32_t SubTag : 1;
|
||||
uint32_t MagicBit : 1;
|
||||
uint32_t Reserved : 10;
|
||||
uint32_t offset : 20;
|
||||
uint32_t subTag : 1;
|
||||
uint32_t magicBit : 1;
|
||||
uint32_t reserved : 10;
|
||||
};
|
||||
uint32_t value;
|
||||
};
|
||||
@@ -80,7 +80,7 @@ struct BaseTag {
|
||||
const uint32_t reserved : 4;
|
||||
const uint32_t component : 7;
|
||||
const uint32_t driverDebug : 1; // always 0x1
|
||||
const uint32_t DWORDCount;
|
||||
const uint32_t dwordCount;
|
||||
};
|
||||
|
||||
struct KernelNameTag : public BaseTag {
|
||||
|
||||
Reference in New Issue
Block a user