Files
compute-runtime/shared/source/os_interface/linux/memory_info.h
Jaime Arteaga a3b3f3e86e Add support for PRELIM_I915_PARAM_SET_PAIR
This extension allows pairing two buffer objects so they can be
exported using a single dma-buf handle. When imported, a single
buffer object is created with a total size of the two buffer
objects.

Related-To: LOCI-3355

Sync to
https://github.com/intel-gpu/drm-uapi-helper/releases/tag/v2.0-rc15

Signed-off-by: Jaime Arteaga <jaime.a.arteaga.molina@intel.com>
2022-09-29 23:41:39 +02:00

54 lines
1.5 KiB
C++

/*
* Copyright (C) 2019-2022 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 &regionInfo, const Drm &drm);
void assignRegionsFromDistances(const std::vector<DistanceInfo> &distances);
MOCKABLE_VIRTUAL uint32_t createGemExt(const MemRegionsVec &memClassInstances, size_t allocSize, uint32_t &handle, std::optional<uint32_t> vmId, int32_t pairHandle);
MemoryClassInstance getMemoryRegionClassAndInstance(uint32_t memoryBank, const HardwareInfo &hwInfo);
MOCKABLE_VIRTUAL size_t getMemoryRegionSize(uint32_t memoryBank);
void printRegionSizes();
uint32_t getTileIndex(uint32_t memoryBank, const HardwareInfo &hwInfo);
MOCKABLE_VIRTUAL uint32_t createGemExtWithSingleRegion(uint32_t memoryBanks, size_t allocSize, uint32_t &handle, int32_t pairHandle);
MOCKABLE_VIRTUAL uint32_t createGemExtWithMultipleRegions(uint32_t memoryBanks, size_t allocSize, uint32_t &handle);
const RegionContainer &getDrmRegionInfos() const { return drmQueryRegions; }
protected:
const Drm &drm;
const RegionContainer drmQueryRegions;
const MemoryRegion &systemMemoryRegion;
RegionContainer localMemoryRegions;
};
} // namespace NEO