2018-07-24 18:36:26 +02:00
|
|
|
/*
|
2022-02-04 13:59:01 +00:00
|
|
|
* Copyright (C) 2018-2022 Intel Corporation
|
2018-07-24 18:36:26 +02:00
|
|
|
*
|
2018-09-18 13:37:39 -07:00
|
|
|
* SPDX-License-Identifier: MIT
|
2018-07-24 18:36:26 +02:00
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
2018-09-25 12:44:36 -07:00
|
|
|
#pragma once
|
2020-10-16 12:10:52 +02:00
|
|
|
#include "shared/source/aub/aub_mapper_base.h"
|
2020-02-23 22:44:01 +01:00
|
|
|
#include "shared/source/helpers/hw_info.h"
|
|
|
|
|
#include "shared/source/helpers/non_copyable_or_moveable.h"
|
|
|
|
|
#include "shared/source/memory_manager/graphics_allocation.h"
|
2020-02-24 10:22:30 +01:00
|
|
|
|
2019-03-26 11:59:46 +01:00
|
|
|
namespace NEO {
|
2018-07-24 18:36:26 +02:00
|
|
|
|
2018-09-18 13:37:39 -07:00
|
|
|
class AubHelper : public NonCopyableOrMovableClass {
|
2018-07-24 18:36:26 +02:00
|
|
|
public:
|
2022-02-04 13:59:01 +00:00
|
|
|
static bool isOneTimeAubWritableAllocationType(const AllocationType &type) {
|
2018-07-24 18:36:26 +02:00
|
|
|
switch (type) {
|
2022-02-04 13:59:01 +00:00
|
|
|
case AllocationType::PIPE:
|
|
|
|
|
case AllocationType::CONSTANT_SURFACE:
|
|
|
|
|
case AllocationType::GLOBAL_SURFACE:
|
|
|
|
|
case AllocationType::KERNEL_ISA:
|
|
|
|
|
case AllocationType::KERNEL_ISA_INTERNAL:
|
|
|
|
|
case AllocationType::PRIVATE_SURFACE:
|
|
|
|
|
case AllocationType::SCRATCH_SURFACE:
|
|
|
|
|
case AllocationType::WORK_PARTITION_SURFACE:
|
|
|
|
|
case AllocationType::BUFFER:
|
|
|
|
|
case AllocationType::BUFFER_HOST_MEMORY:
|
|
|
|
|
case AllocationType::IMAGE:
|
|
|
|
|
case AllocationType::TIMESTAMP_PACKET_TAG_BUFFER:
|
|
|
|
|
case AllocationType::EXTERNAL_HOST_PTR:
|
|
|
|
|
case AllocationType::MAP_ALLOCATION:
|
|
|
|
|
case AllocationType::SVM_GPU:
|
2018-07-24 18:36:26 +02:00
|
|
|
return true;
|
|
|
|
|
default:
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
2019-02-12 13:37:39 +01:00
|
|
|
|
|
|
|
|
static uint64_t getTotalMemBankSize();
|
2018-08-20 15:54:20 +02:00
|
|
|
static int getMemTrace(uint64_t pdEntryBits);
|
2018-09-11 10:26:39 +02:00
|
|
|
static uint64_t getPTEntryBits(uint64_t pdEntryBits);
|
2018-11-09 23:00:58 -08:00
|
|
|
static uint32_t getMemType(uint32_t addressSpace);
|
2021-12-06 11:38:24 +00:00
|
|
|
static uint64_t getPerTileLocalMemorySize(const HardwareInfo *pHwInfo);
|
2019-01-14 10:31:06 +01:00
|
|
|
static MMIOList getAdditionalMmioList();
|
2020-08-22 14:12:46 +02:00
|
|
|
static void setTbxConfiguration();
|
2018-09-14 05:31:37 -07: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 10:31:06 +01:00
|
|
|
|
|
|
|
|
static MMIOList splitMMIORegisters(const std::string ®isters, char delimiter);
|
2018-07-24 18:36:26 +02:00
|
|
|
};
|
2018-09-14 05:31:37 -07: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 11:59:46 +01:00
|
|
|
} // namespace NEO
|