mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-22 01:48:50 +08:00
When upstream ioctl helper is created it will try to create small allocation, adding I915_GEM_CREATE_EXT_SET_PAT extension. If it succeeds, for all resources with valid pat index value it will then explicitly program pat index value with gem create ext call. PrintBOCreateDestroyResult value can be used to: - print whether the set pat extension is supported by the kernel, when ioctl helper is created - print whether set pat extension was added for a given gem create ext call and what pat index value was programmed Note: introduced changes are disabled by defualt. Toggle DisableGemCreateExtSetPat can be used to enable new functionality. Related-To: NEO-7896 Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
57 lines
1.8 KiB
C++
57 lines
1.8 KiB
C++
/*
|
|
* Copyright (C) 2019-2023 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
*/
|
|
|
|
#pragma once
|
|
#include "shared/source/os_interface/linux/ioctl_helper.h"
|
|
|
|
#include <cstddef>
|
|
#include <cstdint>
|
|
#include <vector>
|
|
|
|
namespace NEO {
|
|
class Drm;
|
|
struct HardwareInfo;
|
|
|
|
class MemoryInfo {
|
|
public:
|
|
using RegionContainer = std::vector<MemoryRegion>;
|
|
|
|
virtual ~MemoryInfo(){};
|
|
|
|
MemoryInfo(const RegionContainer ®ionInfo, const Drm &drm);
|
|
|
|
void assignRegionsFromDistances(const std::vector<DistanceInfo> &distances);
|
|
|
|
MOCKABLE_VIRTUAL int createGemExt(const MemRegionsVec &memClassInstances, size_t allocSize, uint32_t &handle, uint64_t patIndex, std::optional<uint32_t> vmId, int32_t pairHandle, bool isChunked, uint32_t numOfChunks);
|
|
|
|
MemoryClassInstance getMemoryRegionClassAndInstance(uint32_t memoryBank, const HardwareInfo &hwInfo);
|
|
|
|
MOCKABLE_VIRTUAL size_t getMemoryRegionSize(uint32_t memoryBank);
|
|
|
|
const MemoryRegion &getMemoryRegion(uint32_t memoryBank);
|
|
|
|
void printRegionSizes();
|
|
|
|
uint32_t getTileIndex(uint32_t memoryBank);
|
|
|
|
MOCKABLE_VIRTUAL int createGemExtWithSingleRegion(uint32_t memoryBanks, size_t allocSize, uint32_t &handle, uint64_t patIndex, int32_t pairHandle);
|
|
MOCKABLE_VIRTUAL int createGemExtWithMultipleRegions(uint32_t memoryBanks, size_t allocSize, uint32_t &handle, uint64_t patIndex);
|
|
MOCKABLE_VIRTUAL int createGemExtWithMultipleRegions(uint32_t memoryBanks, size_t allocSize, uint32_t &handle, uint64_t patIndex, int32_t pairHandle, bool isChunked, uint32_t numOfChunks);
|
|
|
|
const RegionContainer &getDrmRegionInfos() const { return drmQueryRegions; }
|
|
|
|
protected:
|
|
const Drm &drm;
|
|
const RegionContainer drmQueryRegions;
|
|
|
|
const MemoryRegion &systemMemoryRegion;
|
|
|
|
RegionContainer localMemoryRegions;
|
|
};
|
|
|
|
} // namespace NEO
|