Update aubstream

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
Mateusz Hoppe 2022-09-16 14:29:51 +00:00 committed by Compute-Runtime-Automation
parent 45c8124d8f
commit 137790def2
10 changed files with 121 additions and 23 deletions

View File

@ -3,7 +3,7 @@ components:
branch: master
dest_dir: aub_stream
repository: https://github.com/intel/aubstream
revision: 11f846a14596f2ac5152055052d52baaa3721320
revision: 8b27837933ee24a307ca90243f99699f592e2753
type: git
gmmlib:
dest_dir: gmmlib

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2021 Intel Corporation
* Copyright (C) 2018-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -42,6 +42,7 @@ struct MockHardwareContext : public aub_stream::HardwareContext {
void readMemory(uint64_t gfxAddress, void *memory, size_t size, uint32_t memoryBank, size_t pageSize) override { readMemoryCalled = true; }
void dumpBufferBIN(uint64_t gfxAddress, size_t size) override { dumpBufferBINCalled = true; }
void dumpSurface(const SurfaceInfo &surfaceInfo) override { dumpSurfaceCalled = true; }
void pollForFenceCompletion() override {}
std::vector<aub_stream::AllocationParams> storedAllocationParams;
bool storeAllocationParams = false;
@ -138,6 +139,9 @@ class MockAubManager : public aub_stream::AubManager {
freeMemoryCalled = true;
}
bool reservePhysicalMemory(aub_stream::AllocationParams allocationParams, aub_stream::PhysicalAllocationInfo &physicalAllocInfo) override { return false; };
bool mapGpuVa(uint64_t gfxAddress, size_t size, aub_stream::PhysicalAllocationInfo physicalAllocInfo) override { return false; };
std::vector<aub_stream::AllocationParams> storedAllocationParams;
uint32_t openCalledCnt = 0;
std::string fileName = "";

View File

@ -1,34 +1,40 @@
/*
* Copyright (C) 2021 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
* Copyright (C) 2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#pragma once
#include <cstddef>
#include <cstdint>
#include <type_traits>
namespace aub_stream {
struct AllocationParams {
AllocationParams() = delete;
AllocationParams(uint64_t gfxAddress, const void *memory, size_t size, uint32_t memoryBanks, int hint, size_t pageSize)
: gfxAddress(gfxAddress), size(size), pageSize(pageSize), memoryBanks(memoryBanks), hint(hint), memory(memory) {
: gfxAddress(gfxAddress), memory(memory), size(size), memoryBanks(memoryBanks), hint(hint), pageSize(pageSize) {
additionalParams = {};
}
uint64_t gfxAddress = 0;
size_t size = 0;
size_t pageSize;
uint32_t memoryBanks;
int hint = 0;
const void *memory = nullptr;
size_t size = 0;
uint32_t memoryBanks = 0;
int hint = 0;
size_t pageSize = 0;
struct AdditionalParams {
bool compressionEnabled :1;
bool compressionEnabled : 1;
bool uncached : 1;
bool padding : 6;
} additionalParams;
};
AdditionalParams additionalParams;
};
static_assert(std::is_standard_layout<AllocationParams>::value, "AllocationParams is not standard layout type");
} // namespace aub_stream

View File

@ -1,22 +1,35 @@
/*
* Copyright (C) 2018-2021 Intel Corporation
* Copyright (C) 2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#pragma once
#include "page_info.h"
#include <cstdint>
#include <string>
#include <vector>
#include "page_info.h"
#include "shared_mem_info.h"
#include "physical_allocation_info.h"
namespace aub_stream {
struct AllocationParams;
struct HardwareContext;
struct AubManagerOptions {
uint32_t productFamily{};
uint32_t devicesCount{};
uint64_t memoryBankSize{};
uint32_t stepping{};
bool localMemorySupported{};
uint32_t mode{};
uint64_t gpuAddressSpace{};
SharedMemoryInfo sharedMemoryInfo{};
bool throwOnError{};
};
class AubManager {
public:
virtual ~AubManager() = default;
@ -41,6 +54,13 @@ class AubManager {
bool localMemorySupported, uint32_t streamMode, uint64_t gpuAddressSpace);
virtual void writeMemory2(AllocationParams allocationParams) = 0;
static AubManager *create(uint32_t productFamily, uint32_t devicesCount, uint64_t memoryBankSize, uint32_t stepping,
bool localMemorySupported, uint32_t streamMode, uint64_t gpuAddressSpace, SharedMemoryInfo sharedMemoryInfo);
static AubManager *create(const struct AubManagerOptions &options);
virtual bool reservePhysicalMemory(AllocationParams allocationParams, PhysicalAllocationInfo &physicalAllocInfo) = 0;
virtual bool mapGpuVa(uint64_t gfxAddress, size_t size, PhysicalAllocationInfo physicalAllocInfo) = 0;
};
} // namespace aub_stream

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2019-2021 Intel Corporation
* Copyright (C) 2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -10,6 +10,7 @@
#include <cstdint>
#include <ostream>
#include <vector>
#include <type_traits>
namespace aub_stream {
@ -23,6 +24,16 @@ struct SurfaceInfo {
uint32_t tilingType;
bool compressed;
uint32_t dumpType;
bool useClearValue;
uint32_t clearColorType;
uint32_t auxEncodingFormat;
uint32_t auxSurfaceWidth;
uint32_t auxSurfaceHeight;
uint32_t auxSurfacePitch;
uint32_t auxSurfaceQPitch;
uint32_t auxSurfaceTilingType;
uint64_t clearColorAddress;
uint64_t auxSurfaceAddress;
};
namespace surftype {
@ -48,8 +59,14 @@ namespace mode {
constexpr uint32_t aubFile = 0;
constexpr uint32_t tbx = 1;
constexpr uint32_t aubFileAndTbx = 2;
constexpr uint32_t tbxShm = 3;
} // namespace mode
namespace clearColorType {
constexpr uint32_t immediate = 0;
constexpr uint32_t address = 1;
} // namespace clearColorType
using MMIOPair = std::pair<uint32_t, uint32_t>;
using MMIOList = std::vector<MMIOPair>;
@ -58,4 +75,6 @@ extern "C" void setTbxServerPort(uint16_t port);
extern "C" void setTbxServerIp(std::string server);
extern "C" void setTbxFrontdoorMode(bool frontdoor);
static_assert(std::is_pod<SurfaceInfo>::value, "SurfaceInfo is not POD type");
} // namespace aub_stream

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2019-2021 Intel Corporation
* Copyright (C) 2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2021 Intel Corporation
* Copyright (C) 2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -28,6 +28,7 @@ struct HardwareContext {
virtual ~HardwareContext() = default;
virtual void writeMemory2(AllocationParams allocationParams) = 0;
virtual void writeMMIO(uint32_t offset, uint32_t value) = 0;
virtual void pollForFenceCompletion() = 0;
};
} // namespace aub_stream

View File

@ -1,12 +1,13 @@
/*
* Copyright (C) 2019-2021 Intel Corporation
* Copyright (C) 2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#pragma once
#include <cstddef>
#include <cstdint>
#include <type_traits>
namespace aub_stream {
@ -16,4 +17,7 @@ struct PageInfo {
bool isLocalMemory;
uint32_t memoryBank;
};
} // namespace aub_stream
static_assert(std::is_pod<PageInfo>::value, "PageInfo is not POD type");
} // namespace aub_stream

View File

@ -0,0 +1,23 @@
/*
* Copyright (C) 2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#pragma once
#include <cstdint>
#include <type_traits>
namespace aub_stream {
struct PhysicalAllocationInfo {
uint64_t physicalAddress;
size_t size;
uint32_t memoryBank;
size_t pageSize;
};
static_assert(std::is_pod<PhysicalAllocationInfo>::value, "PhysicalAllocationInfo is not POD type");
} // namespace aub_stream

View File

@ -0,0 +1,21 @@
/*
* Copyright (C) 2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#pragma once
#include <cstdint>
namespace aub_stream {
struct SharedMemoryInfo {
uint8_t *sysMemBase{};
uint64_t sysMemSize{};
uint8_t *localMemBase{};
uint64_t localMemSize{};
};
} // namespace aub_stream