Remove i915 structs from MemoryInfo

Use structs defined in ioctl_helper.h instead of
i915 dependent ones to avoid conflicts between
different kernels

Related-To: NEO-6149

Signed-off-by: Szymon Morek <szymon.morek@intel.com>
This commit is contained in:
Szymon Morek
2021-12-17 13:26:04 +00:00
committed by Compute-Runtime-Automation
parent dfe2be6e1a
commit 2647d563c7
17 changed files with 173 additions and 114 deletions

View File

@@ -6,7 +6,7 @@
*/
#pragma once
#include "drm/i915_drm.h"
#include "shared/source/os_interface/linux/ioctl_helper.h"
#include <cstddef>
#include <cstdint>
@@ -18,17 +18,17 @@ struct HardwareInfo;
class MemoryInfo {
public:
using RegionContainer = std::vector<drm_i915_memory_region_info>;
using RegionContainer = std::vector<MemoryRegion>;
virtual ~MemoryInfo(){};
MemoryInfo(const drm_i915_memory_region_info *regionInfo, size_t count);
MemoryInfo(const MemoryRegion *regionInfo, size_t count);
void assignRegionsFromDistances(const void *distanceInfosPtr, size_t size);
MOCKABLE_VIRTUAL uint32_t createGemExt(Drm *drm, void *data, uint32_t dataSize, size_t allocSize, uint32_t &handle);
drm_i915_gem_memory_class_instance getMemoryRegionClassAndInstance(uint32_t memoryBank, const HardwareInfo &hwInfo);
MemoryClassInstance getMemoryRegionClassAndInstance(uint32_t memoryBank, const HardwareInfo &hwInfo);
MOCKABLE_VIRTUAL size_t getMemoryRegionSize(uint32_t memoryBank);
@@ -41,7 +41,7 @@ class MemoryInfo {
protected:
const RegionContainer drmQueryRegions;
const drm_i915_memory_region_info &systemMemoryRegion;
const MemoryRegion &systemMemoryRegion;
RegionContainer localMemoryRegions;
};