mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-05 09:09:04 +08:00
Multiple engine support for Sysman Engine API
- multiple engines support for Sysman Engine API - added engineQuery support - opencl ULTs to validate engineQuery - Sysman ULTs to validate engine APIs Change-Id: I3b4d3a96a4cdca7dd9957f6a57f7b1bf900582d3 Signed-off-by: Jitendra Sharma <jitendra.sharma@intel.com> Signed-off-by: SaiKishore Konda <saikishore.konda@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
cf8f0c6437
commit
8f52561307
@@ -35,6 +35,7 @@ set(NEO_CORE_OS_INTERFACE_LINUX
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hw_device_id_linux.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/linux_inc.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/engine_info.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}/engine_info_impl.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/memory_info.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/os_context_linux.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/os_context_linux.h
|
||||
|
||||
@@ -83,7 +83,7 @@ class Drm {
|
||||
bool setQueueSliceCount(uint64_t sliceCount);
|
||||
void checkQueueSliceSupport();
|
||||
uint64_t getSliceMask(uint64_t sliceCount);
|
||||
bool queryEngineInfo();
|
||||
MOCKABLE_VIRTUAL bool queryEngineInfo();
|
||||
MOCKABLE_VIRTUAL bool queryMemoryInfo();
|
||||
bool queryTopology(int &sliceCount, int &subSliceCount, int &euCount);
|
||||
bool createVirtualMemoryAddressSpace(uint32_t vmCount);
|
||||
@@ -104,6 +104,9 @@ class Drm {
|
||||
return memoryInfo.get();
|
||||
}
|
||||
|
||||
EngineInfo *getEngineInfo() const {
|
||||
return engineInfo.get();
|
||||
}
|
||||
RootDeviceEnvironment &getRootDeviceEnvironment() {
|
||||
return rootDeviceEnvironment;
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
*/
|
||||
|
||||
#include "shared/source/os_interface/linux/drm_engine_mapper.h"
|
||||
#include "shared/source/os_interface/linux/engine_info_impl.h"
|
||||
|
||||
#include "drm_neo.h"
|
||||
|
||||
@@ -30,7 +31,14 @@ int Drm::getMaxGpuFrequency(HardwareInfo &hwInfo, int &maxGpuFrequency) {
|
||||
}
|
||||
|
||||
bool Drm::queryEngineInfo() {
|
||||
return true;
|
||||
auto length = 0;
|
||||
auto dataQuery = this->query(DRM_I915_QUERY_ENGINE_INFO, length);
|
||||
auto data = reinterpret_cast<drm_i915_query_engine_info *>(dataQuery.get());
|
||||
if (data) {
|
||||
this->engineInfo.reset(new EngineInfoImpl(data->engines, data->num_engines));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Drm::queryMemoryInfo() {
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
*/
|
||||
|
||||
#include "shared/source/os_interface/linux/drm_engine_mapper.h"
|
||||
#include "shared/source/os_interface/linux/engine_info_impl.h"
|
||||
#include "shared/source/os_interface/linux/memory_info_impl.h"
|
||||
|
||||
#include "drm_neo.h"
|
||||
@@ -32,7 +33,14 @@ int Drm::getMaxGpuFrequency(HardwareInfo &hwInfo, int &maxGpuFrequency) {
|
||||
}
|
||||
|
||||
bool Drm::queryEngineInfo() {
|
||||
return true;
|
||||
auto length = 0;
|
||||
auto dataQuery = this->query(DRM_I915_QUERY_ENGINE_INFO, length);
|
||||
auto data = reinterpret_cast<drm_i915_query_engine_info *>(dataQuery.get());
|
||||
if (data) {
|
||||
this->engineInfo.reset(new EngineInfoImpl(data->engines, data->num_engines));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Drm::queryMemoryInfo() {
|
||||
|
||||
31
shared/source/os_interface/linux/engine_info_impl.h
Normal file
31
shared/source/os_interface/linux/engine_info_impl.h
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright (C) 2020 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "shared/source/helpers/basic_math.h"
|
||||
#include "shared/source/helpers/debug_helpers.h"
|
||||
#include "shared/source/os_interface/linux/drm_neo.h"
|
||||
#include "shared/source/os_interface/linux/engine_info.h"
|
||||
|
||||
#include "drm/i915_drm.h"
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <vector>
|
||||
|
||||
namespace NEO {
|
||||
|
||||
struct EngineInfoImpl : public EngineInfo {
|
||||
~EngineInfoImpl() override = default;
|
||||
|
||||
EngineInfoImpl(const drm_i915_engine_info *engineInfo, size_t count) : engines(engineInfo, engineInfo + count) {
|
||||
}
|
||||
|
||||
std::vector<drm_i915_engine_info> engines;
|
||||
};
|
||||
|
||||
} // namespace NEO
|
||||
Reference in New Issue
Block a user