kfdtest: Add PM4 NOP packet payload capability
Useful for allocating space for write-back data in a queue or IB. Change-Id: I47bd2dcb8537a91410e9a91413979a8a2c1c5f21 Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
This commit is contained in:
@@ -358,10 +358,7 @@ unsigned int PM4PartialFlushPacket::SizeInBytes() const {
|
||||
return sizeof(PM4EVENT_WRITE) - sizeof(uint32_t)*2;
|
||||
}
|
||||
|
||||
PM4NopPacket::PM4NopPacket(void) {
|
||||
InitPM4Header(m_packetData, IT_NOP);
|
||||
}
|
||||
|
||||
unsigned int PM4NopPacket::SizeInBytes() const {
|
||||
return sizeof(m_packetData);
|
||||
PM4NopPacket::PM4NopPacket(unsigned int count): m_packetSize(count * 4) {
|
||||
m_packetData = reinterpret_cast<PM4_TYPE_3_HEADER *>(AllocPacket());
|
||||
InitPM4Header(*m_packetData, IT_NOP);
|
||||
}
|
||||
|
||||
@@ -211,16 +211,17 @@ class PM4PartialFlushPacket : public PM4Packet {
|
||||
// @class PM4NopPacket
|
||||
class PM4NopPacket : public PM4Packet {
|
||||
public:
|
||||
PM4NopPacket(void);
|
||||
PM4NopPacket(unsigned int count = 1);
|
||||
virtual ~PM4NopPacket(void) {}
|
||||
|
||||
// @returns Packet size in bytes
|
||||
virtual unsigned int SizeInBytes() const;
|
||||
virtual unsigned int SizeInBytes() const { return m_packetSize; }
|
||||
// @returns Pointer to the packet
|
||||
virtual const void *GetPacket() const { return &m_packetData; }
|
||||
virtual const void *GetPacket() const { return m_packetData; }
|
||||
|
||||
private:
|
||||
PM4_TYPE_3_HEADER m_packetData;
|
||||
unsigned int m_packetSize;
|
||||
PM4_TYPE_3_HEADER *m_packetData;
|
||||
};
|
||||
|
||||
#endif // __KFD_PM4_PACKET__H__
|
||||
|
||||
Verwijs in nieuw issue
Block a user