feature: Add pat index programming to gem create ext call

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>
This commit is contained in:
Filip Hazubski
2023-07-30 12:23:34 +02:00
committed by Compute-Runtime-Automation
parent 3e811fc9d4
commit 7ea22d0369
19 changed files with 284 additions and 70 deletions

View File

@@ -69,14 +69,14 @@ struct MockedMemoryInfo : public NEO::MemoryInfo {
size_t getMemoryRegionSize(uint32_t memoryBank) override {
return 1024u;
}
int createGemExt(const MemRegionsVec &memClassInstances, size_t allocSize, uint32_t &handle, std::optional<uint32_t> vmId, int32_t pairHandle, bool isChunked, uint32_t numOfChunks) override {
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) override {
if (allocSize == 0) {
return EINVAL;
}
handle = 1u;
return 0;
}
int createGemExtWithSingleRegion(uint32_t memoryBanks, size_t allocSize, uint32_t &handle, int32_t pairHandle) override {
int createGemExtWithSingleRegion(uint32_t memoryBanks, size_t allocSize, uint32_t &handle, uint64_t patIndex, int32_t pairHandle) override {
if (allocSize == 0) {
return EINVAL;
}
@@ -84,7 +84,7 @@ struct MockedMemoryInfo : public NEO::MemoryInfo {
pairHandlePassed = pairHandle;
return 0;
}
int createGemExtWithMultipleRegions(uint32_t memoryBanks, size_t allocSize, uint32_t &handle) override {
int createGemExtWithMultipleRegions(uint32_t memoryBanks, size_t allocSize, uint32_t &handle, uint64_t patIndex) override {
if (allocSize == 0) {
return EINVAL;
}
@@ -92,7 +92,7 @@ struct MockedMemoryInfo : public NEO::MemoryInfo {
banks = memoryBanks;
return 0;
}
int createGemExtWithMultipleRegions(uint32_t memoryBanks, size_t allocSize, uint32_t &handle, int32_t pairHandle, bool isChunked, uint32_t numOfChunks) override {
int createGemExtWithMultipleRegions(uint32_t memoryBanks, size_t allocSize, uint32_t &handle, uint64_t patIndex, int32_t pairHandle, bool isChunked, uint32_t numOfChunks) override {
if (allocSize == 0) {
return EINVAL;
}