mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-08 22:12:59 +08:00
Refactor: don't use global ProductHelper getter in shared files 3/n
Related-To: NEO-6853 Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
6d2c6df994
commit
2eaae763bc
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2021-2022 Intel Corporation
|
||||
* Copyright (C) 2021-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -25,8 +25,8 @@ template <>
|
||||
int ProductHelperHw<gfxProduct>::configureHardwareCustom(HardwareInfo *hwInfo, OSInterface *osIface) const {
|
||||
GT_SYSTEM_INFO *gtSystemInfo = &hwInfo->gtSystemInfo;
|
||||
gtSystemInfo->SliceCount = 1;
|
||||
const auto &productHelper = *ProductHelper::get(hwInfo->platform.eProductFamily);
|
||||
hwInfo->featureTable.flags.ftrGpGpuMidThreadLevelPreempt = (hwInfo->platform.usRevId >= productHelper.getHwRevIdFromStepping(REVISION_B, *hwInfo));
|
||||
|
||||
hwInfo->featureTable.flags.ftrGpGpuMidThreadLevelPreempt = (hwInfo->platform.usRevId >= this->getHwRevIdFromStepping(REVISION_B, *hwInfo));
|
||||
|
||||
enableBlitterOperationsSupport(hwInfo);
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2022 Intel Corporation
|
||||
* Copyright (C) 2018-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -73,9 +73,9 @@ SubmissionStatus Drm::getSubmissionStatusFromReturnCode(int32_t retCode) {
|
||||
}
|
||||
|
||||
void Drm::queryAndSetVmBindPatIndexProgrammingSupport() {
|
||||
auto hwInfo = rootDeviceEnvironment.getHardwareInfo();
|
||||
|
||||
this->vmBindPatIndexProgrammingSupported = ProductHelper::get(hwInfo->platform.eProductFamily)->isVmBindPatIndexProgrammingSupported();
|
||||
auto &productHelper = rootDeviceEnvironment.getHelper<ProductHelper>();
|
||||
this->vmBindPatIndexProgrammingSupported = productHelper.isVmBindPatIndexProgrammingSupported();
|
||||
}
|
||||
|
||||
int Drm::ioctl(DrmIoctl request, void *arg) {
|
||||
@@ -657,7 +657,7 @@ uint32_t Drm::getVirtualMemoryAddressSpace(uint32_t vmId) const {
|
||||
}
|
||||
|
||||
void Drm::setNewResourceBoundToVM(uint32_t vmHandleId) {
|
||||
const auto &productHelper = *ProductHelper::get(this->getRootDeviceEnvironment().getHardwareInfo()->platform.eProductFamily);
|
||||
const auto &productHelper = this->getRootDeviceEnvironment().getHelper<ProductHelper>();
|
||||
const auto &engines = this->rootDeviceEnvironment.executionEnvironment.memoryManager->getRegisteredEngines();
|
||||
for (const auto &engine : engines) {
|
||||
if (engine.osContext->getDeviceBitfield().test(vmHandleId) && productHelper.isTlbFlushRequired(engine.osContext->getEngineType())) {
|
||||
@@ -1312,9 +1312,9 @@ bool Drm::isVmBindAvailable() {
|
||||
std::call_once(checkBindOnce, [this]() {
|
||||
int ret = ioctlHelper->isVmBindAvailable();
|
||||
|
||||
auto hwInfo = this->getRootDeviceEnvironment().getHardwareInfo();
|
||||
auto productHelper = ProductHelper::get(hwInfo->platform.eProductFamily);
|
||||
ret &= static_cast<int>(productHelper->isNewResidencyModelSupported());
|
||||
const auto &productHelper = this->getRootDeviceEnvironment().getHelper<ProductHelper>();
|
||||
|
||||
ret &= static_cast<int>(productHelper.isNewResidencyModelSupported());
|
||||
|
||||
bindAvailable = ret;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2021-2022 Intel Corporation
|
||||
* Copyright (C) 2021-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -31,8 +31,8 @@
|
||||
namespace NEO {
|
||||
|
||||
IoctlHelperPrelim20::IoctlHelperPrelim20(Drm &drmArg) : IoctlHelper(drmArg) {
|
||||
auto gfxCoreHelper = ProductHelper::get(this->drm.getRootDeviceEnvironment().getHardwareInfo()->platform.eProductFamily);
|
||||
handleExecBufferInNonBlockMode = gfxCoreHelper && gfxCoreHelper->isNonBlockingGpuSubmissionSupported();
|
||||
const auto &productHelper = this->drm.getRootDeviceEnvironment().getHelper<ProductHelper>();
|
||||
handleExecBufferInNonBlockMode = productHelper.isNonBlockingGpuSubmissionSupported();
|
||||
if (DebugManager.flags.ForceNonblockingExecbufferCalls.get() != -1) {
|
||||
handleExecBufferInNonBlockMode = DebugManager.flags.ForceNonblockingExecbufferCalls.get();
|
||||
}
|
||||
@@ -748,9 +748,9 @@ bool IoctlHelperPrelim20::initialize() {
|
||||
EngineClassInstance engineInfo = {static_cast<uint16_t>(getDrmParamValue(DrmParam::EngineClassRender)), 0};
|
||||
int ret = 0;
|
||||
bool result = queryHwIpVersion(engineInfo, hwInfo->ipVersion, ret);
|
||||
if (result == false &&
|
||||
ret != 0 &&
|
||||
ProductHelper::get(hwInfo->platform.eProductFamily)->isPlatformQuerySupported()) {
|
||||
auto &productHelper = drm.getRootDeviceEnvironment().getHelper<ProductHelper>();
|
||||
|
||||
if (result == false && ret != 0 && productHelper.isPlatformQuerySupported()) {
|
||||
int err = drm.getErrno();
|
||||
PRINT_DEBUG_STRING(DebugManager.flags.PrintDebugMessages.get(), stderr,
|
||||
"ioctl(PRELIM_DRM_I915_QUERY_HW_IP_VERSION) failed with %d. errno=%d(%s)\n", ret, err, strerror(err));
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2022 Intel Corporation
|
||||
* Copyright (C) 2018-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -65,8 +65,9 @@ void OsContextLinux::initializeContext() {
|
||||
}
|
||||
|
||||
bool OsContextLinux::isDirectSubmissionSupported(const HardwareInfo &hwInfo) const {
|
||||
auto productHelper = ProductHelper::get(hwInfo.platform.eProductFamily);
|
||||
return this->getDrm().isVmBindAvailable() && productHelper->isDirectSubmissionSupported(hwInfo);
|
||||
auto &productHelper = this->getDrm().getRootDeviceEnvironment().getHelper<ProductHelper>();
|
||||
|
||||
return this->getDrm().isVmBindAvailable() && productHelper.isDirectSubmissionSupported(hwInfo);
|
||||
}
|
||||
|
||||
Drm &OsContextLinux::getDrm() const {
|
||||
|
||||
Reference in New Issue
Block a user