fix: query drm info to 8 byte aligned storage

Related-To: NEO-9038
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2023-10-02 14:26:33 +00:00
committed by Compute-Runtime-Automation
parent 8a01619310
commit 9b344280d6
20 changed files with 63 additions and 62 deletions

View File

@@ -6,6 +6,7 @@
*/
#pragma once
#include "shared/source/helpers/ptr_math.h"
#include "shared/source/os_interface/linux/drm_neo.h"
#include "shared/source/os_interface/linux/ioctl_helper.h"
#include "shared/source/os_interface/linux/system_info.h"
@@ -265,7 +266,7 @@ struct MockEventNeoDrm : public Drm {
mockMemoryType = memory;
}
std::vector<uint8_t> getMemoryRegionsReturnsEmpty() {
std::vector<uint64_t> getMemoryRegionsReturnsEmpty() {
return {};
}
@@ -279,8 +280,8 @@ struct MockEventNeoDrm : public Drm {
return returnValue;
}
uint32_t hwBlob[] = {INTEL_HWCONFIG_MAX_MEMORY_CHANNELS, 1, 8, INTEL_HWCONFIG_MEMORY_TYPE, 0, mockMemoryType};
std::vector<uint8_t> inputBlobData(reinterpret_cast<uint8_t *>(hwBlob), reinterpret_cast<uint8_t *>(hwBlob) + sizeof(hwBlob));
alignas(64) uint32_t hwBlob[] = {INTEL_HWCONFIG_MAX_MEMORY_CHANNELS, 1, 8, INTEL_HWCONFIG_MEMORY_TYPE, 0, mockMemoryType};
std::vector<uint64_t> inputBlobData(reinterpret_cast<uint64_t *>(hwBlob), reinterpret_cast<uint64_t *>(ptrOffset(hwBlob, sizeof(hwBlob))));
this->systemInfo.reset(new SystemInfo(inputBlobData));
return returnValue;
}

View File

@@ -220,7 +220,7 @@ struct MockMemoryNeoDrm : public Drm {
mockMemoryType = memory;
}
std::vector<uint8_t> getMemoryRegionsReturnsEmpty() {
std::vector<uint64_t> getMemoryRegionsReturnsEmpty() {
return {};
}
@@ -234,8 +234,8 @@ struct MockMemoryNeoDrm : public Drm {
return returnValue;
}
uint32_t hwBlob[] = {INTEL_HWCONFIG_MAX_MEMORY_CHANNELS, 1, 8, INTEL_HWCONFIG_MEMORY_TYPE, 0, mockMemoryType};
std::vector<uint8_t> inputBlobData(reinterpret_cast<uint8_t *>(hwBlob), reinterpret_cast<uint8_t *>(hwBlob) + sizeof(hwBlob));
alignas(64) uint32_t hwBlob[] = {INTEL_HWCONFIG_MAX_MEMORY_CHANNELS, 1, 8, INTEL_HWCONFIG_MEMORY_TYPE, 0, mockMemoryType};
std::vector<uint64_t> inputBlobData(reinterpret_cast<uint64_t *>(hwBlob), reinterpret_cast<uint64_t *>(ptrOffset(hwBlob, sizeof(hwBlob))));
this->systemInfo.reset(new SystemInfo(inputBlobData));
return returnValue;
}

View File

@@ -669,7 +669,7 @@ struct MockRasNeoDrm : public Drm {
mockMemoryType = memory;
}
std::vector<uint8_t> getMemoryRegionsReturnsEmpty() {
std::vector<uint64_t> getMemoryRegionsReturnsEmpty() {
return {};
}
@@ -683,8 +683,8 @@ struct MockRasNeoDrm : public Drm {
return returnValue;
}
uint32_t hwBlob[] = {INTEL_HWCONFIG_MAX_MEMORY_CHANNELS, 1, 8, INTEL_HWCONFIG_MEMORY_TYPE, 0, mockMemoryType};
std::vector<uint8_t> inputBlobData(reinterpret_cast<uint8_t *>(hwBlob), reinterpret_cast<uint8_t *>(hwBlob) + sizeof(hwBlob));
alignas(64) uint32_t hwBlob[] = {INTEL_HWCONFIG_MAX_MEMORY_CHANNELS, 1, 8, INTEL_HWCONFIG_MEMORY_TYPE, 0, mockMemoryType};
std::vector<uint64_t> inputBlobData(reinterpret_cast<uint64_t *>(hwBlob), reinterpret_cast<uint64_t *>(ptrOffset(hwBlob, sizeof(hwBlob))));
this->systemInfo.reset(new SystemInfo(inputBlobData));
return returnValue;
}