mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-09 14:33:04 +08:00
fix: query drm info to aligned storages
xe topology info to byte aligned storage xe engine info to 2 byte aligned storage system info to 4 byte aligned storage all other info to 8 byte aligned storage Related-To: NEO-9038 Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
fd7c750cf7
commit
85eafc9e61
@@ -12,10 +12,10 @@
|
||||
|
||||
namespace NEO {
|
||||
|
||||
bool isQueryDrmTip(const std::vector<uint8_t> &queryInfo) {
|
||||
bool isQueryDrmTip(const std::vector<uint64_t> &queryInfo) {
|
||||
auto dataOnDrmTip = reinterpret_cast<const drm_i915_query_memory_regions *>(queryInfo.data());
|
||||
auto lengthOnDrmTip = static_cast<uint32_t>(sizeof(drm_i915_query_memory_regions) + dataOnDrmTip->num_regions * sizeof(drm_i915_memory_region_info));
|
||||
return static_cast<uint32_t>(queryInfo.size()) == lengthOnDrmTip;
|
||||
return static_cast<uint32_t>(queryInfo.size() * sizeof(uint64_t)) == lengthOnDrmTip;
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
@@ -18,7 +18,7 @@ using namespace Dg1I915;
|
||||
|
||||
constexpr static auto gfxProduct = IGFX_DG1;
|
||||
|
||||
extern bool isQueryDrmTip(const std::vector<uint8_t> &queryInfo);
|
||||
extern bool isQueryDrmTip(const std::vector<uint64_t> &queryInfo);
|
||||
|
||||
template <>
|
||||
int IoctlHelperImpl<gfxProduct>::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) {
|
||||
@@ -55,7 +55,7 @@ int IoctlHelperImpl<gfxProduct>::createGemExt(const MemRegionsVec &memClassInsta
|
||||
return ret;
|
||||
}
|
||||
|
||||
std::vector<MemoryRegion> translateDg1RegionInfoToMemoryRegions(const std::vector<uint8_t> ®ionInfo) {
|
||||
std::vector<MemoryRegion> translateDg1RegionInfoToMemoryRegions(const std::vector<uint64_t> ®ionInfo) {
|
||||
auto *data = reinterpret_cast<const drm_i915_query_memory_regions *>(regionInfo.data());
|
||||
auto memRegions = std::vector<MemoryRegion>(data->num_regions);
|
||||
for (uint32_t i = 0; i < data->num_regions; i++) {
|
||||
@@ -68,7 +68,7 @@ std::vector<MemoryRegion> translateDg1RegionInfoToMemoryRegions(const std::vecto
|
||||
}
|
||||
|
||||
template <>
|
||||
std::vector<MemoryRegion> IoctlHelperImpl<gfxProduct>::translateToMemoryRegions(const std::vector<uint8_t> ®ionInfo) {
|
||||
std::vector<MemoryRegion> IoctlHelperImpl<gfxProduct>::translateToMemoryRegions(const std::vector<uint64_t> ®ionInfo) {
|
||||
if (!isQueryDrmTip(regionInfo)) {
|
||||
return translateDg1RegionInfoToMemoryRegions(regionInfo);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user