Update header with structures for AUB services.

This commit updates the structures and adds getters/setters to AUB services.

Change-Id: I14ce251b68f233428458958565c2d52551661747
This commit is contained in:
Milczarek, Slawomir
2018-05-08 11:28:32 +02:00
committed by sys_ocldev
parent b59a5f1910
commit cf5b5aecec
7 changed files with 140 additions and 53 deletions

View File

@@ -30,6 +30,17 @@
#pragma pack(push, 4)
#endif
inline void setMisalignedUint64(uint64_t *address, const uint64_t value) {
uint32_t *addressBits = reinterpret_cast<uint32_t *>(address);
addressBits[0] = static_cast<uint32_t>(value);
addressBits[1] = static_cast<uint32_t>(value >> 32);
}
inline uint64_t getMisalignedUint64(const uint64_t *address) {
const uint32_t *addressBits = reinterpret_cast<const uint32_t *>(address);
return static_cast<uint64_t>(static_cast<uint64_t>(addressBits[1]) << 32) | addressBits[0];
}
struct AubCmdHdr {
uint32_t DwordLength : 16,
SubOp : 7,
@@ -58,6 +69,12 @@ struct AubCmdDumpBmpHd {
UseFullFormat : 1,
Reserved_1 : 25;
uint32_t DirectoryHandle;
uint64_t getBaseAddr() const {
return getMisalignedUint64(&this->BaseAddr);
}
void setBaseAddr(const uint64_t baseAddr) {
setMisalignedUint64(&this->BaseAddr, baseAddr);
}
};
static_assert(44 == sizeof(AubCmdDumpBmpHd), "Invalid size for AubCmdDumpBmpHd");
@@ -84,6 +101,30 @@ struct AubCaptureBinaryDumpHD {
uint32_t ReservedDW1;
uint32_t ReservedDW2;
char OutputFile[4];
uint64_t getBaseAddr() const {
return getMisalignedUint64(&this->BaseAddr);
}
void setBaseAddr(const uint64_t baseAddr) {
setMisalignedUint64(&this->BaseAddr, baseAddr);
}
uint64_t getWidth() const {
return getMisalignedUint64(&this->Width);
}
void setWidth(const uint64_t width) {
setMisalignedUint64(&this->Width, width);
}
uint64_t getHeight() const {
return getMisalignedUint64(&this->Height);
}
void setHeight(const uint64_t height) {
setMisalignedUint64(&this->Height, height);
}
uint64_t getPitch() const {
return getMisalignedUint64(&this->Pitch);
}
void setPitch(const uint64_t pitch) {
setMisalignedUint64(&this->Pitch, pitch);
}
};
static_assert(56 == sizeof(AubCaptureBinaryDumpHD), "Invalid size for AubCaptureBinaryDumpHD");

View File

@@ -131,6 +131,7 @@ struct AubFileStream : public AubStream {
void writeGTT(uint32_t offset, uint64_t entry) override;
void writeMMIO(uint32_t offset, uint32_t value) override;
void registerPoll(uint32_t registerOffset, uint32_t mask, uint32_t value, bool pollNotEqual, uint32_t timeoutAction) override;
MOCKABLE_VIRTUAL void write(const char *data, size_t size);
MOCKABLE_VIRTUAL void expectMemory(uint64_t physAddress, const void *memory, size_t size);
MOCKABLE_VIRTUAL bool addComment(const char *message);

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, Intel Corporation
* Copyright (c) 2017 - 2018, Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -1303,6 +1303,12 @@ struct CmdServicesMemTraceDumpCompress {
};
};
uint64_t surfaceAddress;
uint64_t getSurfaceAddress() const {
return getMisalignedUint64(&this->surfaceAddress);
}
void setSurfaceAddress(const uint64_t surfaceAddress) {
setMisalignedUint64(&this->surfaceAddress, surfaceAddress);
}
int getSurfaceAddressLength() const {
return 2 - (1) + 1;
}
@@ -1339,8 +1345,8 @@ struct CmdServicesMemTraceDumpCompress {
uint32_t blockHeight : 8;
uint32_t blockDepth : 8;
uint32_t mode : 1;
uint32_t algorithm : 2;
uint32_t : 5;
uint32_t algorithm : 3;
uint32_t : 4;
};
uint32_t tileWidth;
uint32_t tileHeight;
@@ -1349,6 +1355,16 @@ struct CmdServicesMemTraceDumpCompress {
uint32_t clearColorGreen;
uint32_t clearColorBlue;
uint32_t clearColorAlpha;
struct {
uint32_t gttType : 2;
uint32_t clearColorType : 1;
uint32_t : 29;
};
uint32_t directoryHandle;
uint64_t clearColorAddress;
int getClearColorAddressLength() const {
return 24 - (23) + 1;
}
int32_t getPacketSize() const {
return dwordCount + 1;
}
@@ -1375,57 +1391,65 @@ struct CmdServicesMemTraceDumpCompress {
static uint32_t type() { return 0x7; }
static uint32_t opcode() { return 0x2e; }
static uint32_t subOpcode() { return 0x10; }
struct DumpTypeValues {
enum { Bmp32 = 2,
Tre = 3,
Bmp = 0,
Bin = 1,
Png = 4 };
};
struct AlgorithmValues {
enum { Lossless = 2,
Msaa = 3,
Astc = 1,
Media = 0 };
};
struct TiledResourceModeValues {
enum { TrmodeYs = 2,
TrmodeYf = 1,
TrmodeNone = 0 };
struct GttTypeValues {
enum { Ppgtt = 1,
Ggtt = 0 };
};
struct SurfaceTilingTypeValues {
enum { YmajorS = 4,
Ymajor = 3,
Xmajor = 2,
YmajorF = 5,
Linear = 0,
Xmajor = 2,
Wmajor = 1 };
Wmajor = 1,
Ymajor = 3 };
};
struct ModeValues {
enum { Horizontal = 1,
Vertical = 0 };
};
struct ClearColorTypeValues {
enum { Immediate = 0,
Address = 1 };
};
struct SurfaceTypeValues {
enum {
SurftypeBuffer = 4,
SurftypeStrbuf = 5,
SurftypeNull = 6,
SurftypeCube = 3,
SurftypeStrbuf = 5,
SurftypeBuffer = 4,
Surftype3D = 2,
Surftype2D = 1,
Surftype1D = 0
Surftype1D = 0,
SurftypeNull = 6
};
};
struct ModeValues {
enum { Vertical = 0,
Horizontal = 1 };
struct AlgorithmValues {
enum { Uncompressed = 4,
Astc = 1,
Lossless = 2,
Media = 0,
Msaa = 3 };
};
struct AuxSurfaceTilingTypeValues {
enum { YmajorS = 4,
Ymajor = 3,
Xmajor = 2,
YmajorF = 5,
Linear = 0,
Xmajor = 2,
Wmajor = 1 };
Wmajor = 1,
Ymajor = 3 };
};
struct DumpTypeValues {
enum { Bin = 1,
Png = 4,
Bmp = 0,
Bmp32 = 2,
Tre = 3 };
};
struct TiledResourceModeValues {
enum { TrmodeNone = 0,
TrmodeYf = 1,
TrmodeYs = 2 };
};
};
#ifndef WIN32
#pragma pack()
#else