2018-07-25 00:36:26 +08:00
|
|
|
/*
|
2024-03-05 11:39:51 +08:00
|
|
|
* Copyright (C) 2018-2024 Intel Corporation
|
2018-07-25 00:36:26 +08:00
|
|
|
*
|
2018-09-19 04:37:39 +08:00
|
|
|
* SPDX-License-Identifier: MIT
|
2018-07-25 00:36:26 +08:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2018-09-26 03:44:36 +08:00
|
|
|
#pragma once
|
2020-10-16 18:10:52 +08:00
|
|
|
#include "shared/source/aub/aub_mapper_base.h"
|
2020-02-24 05:44:01 +08:00
|
|
|
#include "shared/source/helpers/non_copyable_or_moveable.h"
|
|
|
|
#include "shared/source/memory_manager/graphics_allocation.h"
|
2020-02-24 17:22:30 +08:00
|
|
|
|
2024-03-05 11:39:51 +08:00
|
|
|
#include <string>
|
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
namespace NEO {
|
2018-07-25 00:36:26 +08:00
|
|
|
|
2024-03-05 11:39:51 +08:00
|
|
|
class ReleaseHelper;
|
2022-11-10 17:37:42 +08:00
|
|
|
struct HardwareInfo;
|
|
|
|
|
2018-09-19 04:37:39 +08:00
|
|
|
class AubHelper : public NonCopyableOrMovableClass {
|
2018-07-25 00:36:26 +08:00
|
|
|
public:
|
2024-04-25 16:12:46 +08:00
|
|
|
static bool isOneTimeAubWritableAllocationType(const AllocationType &type);
|
2024-03-05 23:43:36 +08:00
|
|
|
static uint64_t getTotalMemBankSize(const ReleaseHelper *releaseHelper);
|
2018-08-20 21:54:20 +08:00
|
|
|
static int getMemTrace(uint64_t pdEntryBits);
|
2018-09-11 16:26:39 +08:00
|
|
|
static uint64_t getPTEntryBits(uint64_t pdEntryBits);
|
2018-11-10 15:00:58 +08:00
|
|
|
static uint32_t getMemType(uint32_t addressSpace);
|
2024-03-05 23:43:36 +08:00
|
|
|
static uint64_t getPerTileLocalMemorySize(const HardwareInfo *pHwInfo, const ReleaseHelper *releaseHelper);
|
2024-03-05 11:39:51 +08:00
|
|
|
static const std::string getDeviceConfigString(const ReleaseHelper *releaseHelper, uint32_t tileCount, uint32_t sliceCount, uint32_t subSliceCount, uint32_t euPerSubSliceCount);
|
2019-01-14 17:31:06 +08:00
|
|
|
static MMIOList getAdditionalMmioList();
|
2020-08-22 20:12:46 +08:00
|
|
|
static void setTbxConfiguration();
|
2018-09-14 20:31:37 +08:00
|
|
|
|
|
|
|
virtual int getDataHintForPml4Entry() const = 0;
|
|
|
|
virtual int getDataHintForPdpEntry() const = 0;
|
|
|
|
virtual int getDataHintForPdEntry() const = 0;
|
|
|
|
virtual int getDataHintForPtEntry() const = 0;
|
|
|
|
|
|
|
|
virtual int getMemTraceForPml4Entry() const = 0;
|
|
|
|
virtual int getMemTraceForPdpEntry() const = 0;
|
|
|
|
virtual int getMemTraceForPdEntry() const = 0;
|
|
|
|
virtual int getMemTraceForPtEntry() const = 0;
|
2019-01-14 17:31:06 +08:00
|
|
|
|
|
|
|
static MMIOList splitMMIORegisters(const std::string ®isters, char delimiter);
|
2018-07-25 00:36:26 +08:00
|
|
|
};
|
2018-09-14 20:31:37 +08:00
|
|
|
|
|
|
|
template <typename GfxFamily>
|
|
|
|
class AubHelperHw : public AubHelper {
|
|
|
|
public:
|
|
|
|
AubHelperHw(bool localMemoryEnabled) : localMemoryEnabled(localMemoryEnabled){};
|
|
|
|
|
|
|
|
int getDataHintForPml4Entry() const override;
|
|
|
|
int getDataHintForPdpEntry() const override;
|
|
|
|
int getDataHintForPdEntry() const override;
|
|
|
|
int getDataHintForPtEntry() const override;
|
|
|
|
|
|
|
|
int getMemTraceForPml4Entry() const override;
|
|
|
|
int getMemTraceForPdpEntry() const override;
|
|
|
|
int getMemTraceForPdEntry() const override;
|
|
|
|
int getMemTraceForPtEntry() const override;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
bool localMemoryEnabled;
|
|
|
|
};
|
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
} // namespace NEO
|