Add aub_stream headers

Change-Id: I4d9420210e2a06d8a36abc0cf272901514ff3547
This commit is contained in:
Hoppe, Mateusz
2018-10-30 18:29:32 +01:00
committed by sys_ocldev
parent 8504b37a08
commit e6b93941ee
11 changed files with 213 additions and 1 deletions

View File

@@ -0,0 +1,62 @@
/*
* Copyright (C) 2018 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#pragma once
#include <memory>
#include <string>
#include <vector>
namespace AubDump {
class AubStreamer;
struct AubFileStream;
struct PhysicalAddressAllocator;
struct GGTT;
struct PML4;
struct PDP4;
using PPGTT = typename std::conditional<sizeof(void *) == 8, PML4, PDP4>::type;
class AubManager {
public:
AubManager(uint32_t devicesCount, bool localMemorySupported, std::string &aubFileName);
virtual ~AubManager();
AubManager &operator=(const AubManager &) = delete;
AubManager(const AubManager &) = delete;
GGTT *getGGTT(uint32_t index) {
return ggtts.at(index).get();
}
PPGTT *getPPGTT(uint32_t index) {
return ppgtts.at(index).get();
}
PhysicalAddressAllocator *getPysicalAddressAllocator() {
return physicalAddressAllocator.get();
}
AubFileStream *getAubFileStream() {
return aubFileStream.get();
}
AubStreamer *createAubStreamer(uint32_t gfxFamily, uint32_t device, uint32_t engine);
protected:
void initialize(uint32_t devicesCount, bool localMemorySupported);
uint32_t devicesCount = 0;
std::unique_ptr<AubFileStream> aubFileStream;
std::unique_ptr<PhysicalAddressAllocator> physicalAddressAllocator;
std::vector<std::unique_ptr<PPGTT>> ppgtts;
std::vector<std::unique_ptr<GGTT>> ggtts;
};
} // namespace AubDump

View File

@@ -0,0 +1,29 @@
/*
* Copyright (C) 2018 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#pragma once
#include <cstdint>
namespace AubDump {
class AubStreamer {
public:
void writeMemory(uint64_t gfxAddress, const void *memory, size_t size, uint32_t memoryBanks, size_t pageSize);
void expectMemory(uint64_t gfxAddress, const void *memory, size_t size);
void dumpBuffer(uint64_t gfxAddress, size_t size);
void dumpImage(uint64_t gfxAddress, size_t size);
void submit(uint64_t batchBufferGfxAddress, const void *batchBuffer, size_t size, uint32_t memoryBank);
void pollForCompletion();
class AubStreamerImpl;
AubStreamerImpl *aubStreamerImpl;
~AubStreamer();
};
} // namespace AubDump