mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-04 15:53:45 +08:00
Revert "refactor: Gate shared system mem caps with KMD cap"
This reverts commit f38fae3b18.
Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
74ab930de0
commit
d477935ab9
@@ -727,8 +727,8 @@ bool Device::areSharedSystemAllocationsAllowed() const {
|
||||
if ((debugManager.flags.EnableRecoverablePageFaults.get() == 0) || (debugManager.flags.EnableSharedSystemUsmSupport.get() == 0)) {
|
||||
return false;
|
||||
}
|
||||
uint64_t mask = (UnifiedSharedMemoryFlags::access | UnifiedSharedMemoryFlags::atomicAccess | UnifiedSharedMemoryFlags::concurrentAccess | UnifiedSharedMemoryFlags::concurrentAtomicAccess);
|
||||
if (getHardwareInfo().capabilityTable.sharedSystemMemCapabilities & mask) {
|
||||
uint64_t mask = UnifiedSharedMemoryFlags::access | UnifiedSharedMemoryFlags::sharedSystemPageFaultEnabled;
|
||||
if (((getHardwareInfo().capabilityTable.sharedSystemMemCapabilities) & mask) == mask) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -63,6 +63,11 @@ Drm *Drm::create(std::unique_ptr<HwDeviceIdDrm> &&hwDeviceId, RootDeviceEnvironm
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (drm->isSharedSystemAllocEnabled()) {
|
||||
auto hwInfo = drm->getRootDeviceEnvironment().getMutableHardwareInfo();
|
||||
hwInfo->capabilityTable.sharedSystemMemCapabilities |= UnifiedSharedMemoryFlags::sharedSystemPageFaultEnabled;
|
||||
}
|
||||
|
||||
if (drm->enableTurboBoost()) {
|
||||
printDebugString(debugManager.flags.PrintDebugMessages.get(), stderr, "%s", "WARNING: Failed to request OCL Turbo Boost\n");
|
||||
}
|
||||
|
||||
@@ -45,7 +45,6 @@
|
||||
#include "shared/source/os_interface/os_interface.h"
|
||||
#include "shared/source/os_interface/product_helper.h"
|
||||
#include "shared/source/release_helper/release_helper.h"
|
||||
#include "shared/source/unified_memory/usm_memory_support.h"
|
||||
#include "shared/source/utilities/api_intercept.h"
|
||||
#include "shared/source/utilities/cpu_info.h"
|
||||
#include "shared/source/utilities/directory.h"
|
||||
@@ -497,7 +496,6 @@ int Drm::setupHardwareInfo(const DeviceDescriptor *device, bool setupFeatureTabl
|
||||
|
||||
auto releaseHelper = rootDeviceEnvironment.getReleaseHelper();
|
||||
device->setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable, releaseHelper);
|
||||
this->adjustSharedSystemMemCapabilities();
|
||||
|
||||
querySystemInfo();
|
||||
|
||||
@@ -1863,12 +1861,6 @@ bool Drm::queryDeviceIdAndRevision() {
|
||||
return IoctlHelperI915::queryDeviceIdAndRevision(*this);
|
||||
}
|
||||
|
||||
void Drm::adjustSharedSystemMemCapabilities() {
|
||||
if (!this->isSharedSystemAllocEnabled()) {
|
||||
this->getRootDeviceEnvironment().getMutableHardwareInfo()->capabilityTable.sharedSystemMemCapabilities = 0;
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t Drm::getAggregatedProcessCount() const {
|
||||
return ioctlHelper->getNumProcesses();
|
||||
}
|
||||
|
||||
@@ -153,7 +153,6 @@ class Drm : public DriverModel {
|
||||
bool isDirectSubmissionActive() const { return this->directSubmissionActive; }
|
||||
MOCKABLE_VIRTUAL void setSharedSystemAllocEnable(bool value) { this->sharedSystemAllocEnable = value; }
|
||||
MOCKABLE_VIRTUAL bool isSharedSystemAllocEnabled() const { return this->sharedSystemAllocEnable; }
|
||||
void adjustSharedSystemMemCapabilities();
|
||||
|
||||
MOCKABLE_VIRTUAL bool isSetPairAvailable();
|
||||
MOCKABLE_VIRTUAL bool getSetPairAvailable() { return setPairAvailable; }
|
||||
|
||||
@@ -180,12 +180,13 @@ uint64_t ProductHelperHw<gfxProduct>::getHostMemCapabilities(const HardwareInfo
|
||||
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
uint64_t ProductHelperHw<gfxProduct>::getSharedSystemMemCapabilities(const HardwareInfo *hwInfo) const {
|
||||
bool supported = false;
|
||||
|
||||
if ((debugManager.flags.EnableRecoverablePageFaults.get() == 0) || (debugManager.flags.EnableSharedSystemUsmSupport.get() == 0)) {
|
||||
return 0;
|
||||
if (debugManager.flags.EnableSharedSystemUsmSupport.get() != -1) {
|
||||
supported = !!debugManager.flags.EnableSharedSystemUsmSupport.get();
|
||||
}
|
||||
|
||||
return (hwInfo->capabilityTable.sharedSystemMemCapabilities);
|
||||
return (supported ? (UnifiedSharedMemoryFlags::access | UnifiedSharedMemoryFlags::atomicAccess | UnifiedSharedMemoryFlags::concurrentAccess | UnifiedSharedMemoryFlags::concurrentAtomicAccess) : 0);
|
||||
}
|
||||
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
|
||||
@@ -15,4 +15,5 @@ inline constexpr uint64_t access = 1 << 0;
|
||||
inline constexpr uint64_t atomicAccess = 1 << 1;
|
||||
inline constexpr uint64_t concurrentAccess = 1 << 2;
|
||||
inline constexpr uint64_t concurrentAtomicAccess = 1 << 3;
|
||||
inline constexpr uint64_t sharedSystemPageFaultEnabled = 1 << 4;
|
||||
} // namespace UnifiedSharedMemoryFlags
|
||||
|
||||
@@ -37,7 +37,7 @@ TEST(PrefetchManagerTests, givenPrefetchManagerWhenCallingInterfaceFunctionsThen
|
||||
auto &hwInfo = *device->getRootDeviceEnvironment().getMutableHardwareInfo();
|
||||
|
||||
VariableBackup<uint64_t> sharedSystemMemCapabilities{&hwInfo.capabilityTable.sharedSystemMemCapabilities};
|
||||
sharedSystemMemCapabilities = (UnifiedSharedMemoryFlags::access | UnifiedSharedMemoryFlags::atomicAccess | UnifiedSharedMemoryFlags::concurrentAccess | UnifiedSharedMemoryFlags::concurrentAtomicAccess);
|
||||
sharedSystemMemCapabilities = UnifiedSharedMemoryFlags::access | UnifiedSharedMemoryFlags::sharedSystemPageFaultEnabled;
|
||||
|
||||
auto svmData = svmManager->getSVMAlloc(ptr);
|
||||
ASSERT_NE(nullptr, svmData);
|
||||
|
||||
@@ -336,7 +336,7 @@ TEST_F(SVMLocalMemoryAllocatorTest, givenSharedSystemAllocationWhenPrefetchMemor
|
||||
auto &hwInfo = *device->getRootDeviceEnvironment().getMutableHardwareInfo();
|
||||
|
||||
VariableBackup<uint64_t> sharedSystemMemCapabilities{&hwInfo.capabilityTable.sharedSystemMemCapabilities};
|
||||
sharedSystemMemCapabilities = (UnifiedSharedMemoryFlags::access | UnifiedSharedMemoryFlags::atomicAccess | UnifiedSharedMemoryFlags::concurrentAccess | UnifiedSharedMemoryFlags::concurrentAtomicAccess);
|
||||
sharedSystemMemCapabilities = UnifiedSharedMemoryFlags::access | UnifiedSharedMemoryFlags::sharedSystemPageFaultEnabled;
|
||||
|
||||
csr->setupContext(*device->getDefaultEngine().osContext);
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
#include "shared/source/os_interface/linux/memory_info.h"
|
||||
#include "shared/source/os_interface/linux/os_context_linux.h"
|
||||
#include "shared/source/os_interface/product_helper.h"
|
||||
#include "shared/source/unified_memory/usm_memory_support.h"
|
||||
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
||||
#include "shared/test/common/helpers/engine_descriptor_helper.h"
|
||||
#include "shared/test/common/mocks/linux/mock_drm_memory_manager.h"
|
||||
@@ -2803,10 +2802,6 @@ TEST_F(IoctlHelperXeTest, whenQueryDeviceIdAndRevisionConfigFlagHasGpuAddrMirror
|
||||
|
||||
EXPECT_TRUE(IoctlHelperXe::queryDeviceIdAndRevision(*drm));
|
||||
EXPECT_TRUE(drm->isSharedSystemAllocEnabled());
|
||||
uint64_t caps = (UnifiedSharedMemoryFlags::access | UnifiedSharedMemoryFlags::atomicAccess | UnifiedSharedMemoryFlags::concurrentAccess | UnifiedSharedMemoryFlags::concurrentAtomicAccess);
|
||||
drm->getRootDeviceEnvironment().getMutableHardwareInfo()->capabilityTable.sharedSystemMemCapabilities = caps;
|
||||
drm->adjustSharedSystemMemCapabilities();
|
||||
EXPECT_EQ(caps, drm->getRootDeviceEnvironment().getMutableHardwareInfo()->capabilityTable.sharedSystemMemCapabilities);
|
||||
EXPECT_TRUE(drm->hasPageFaultSupport());
|
||||
}
|
||||
|
||||
@@ -2833,10 +2828,6 @@ TEST_F(IoctlHelperXeTest, whenQueryDeviceIdAndRevisionAndConfigFlagHasGpuAddrMir
|
||||
|
||||
EXPECT_TRUE(IoctlHelperXe::queryDeviceIdAndRevision(*drm));
|
||||
EXPECT_FALSE(drm->isSharedSystemAllocEnabled());
|
||||
uint64_t caps = (UnifiedSharedMemoryFlags::access | UnifiedSharedMemoryFlags::atomicAccess | UnifiedSharedMemoryFlags::concurrentAccess | UnifiedSharedMemoryFlags::concurrentAtomicAccess);
|
||||
drm->getRootDeviceEnvironment().getMutableHardwareInfo()->capabilityTable.sharedSystemMemCapabilities = caps;
|
||||
drm->adjustSharedSystemMemCapabilities();
|
||||
EXPECT_EQ(0lu, drm->getRootDeviceEnvironment().getMutableHardwareInfo()->capabilityTable.sharedSystemMemCapabilities);
|
||||
}
|
||||
|
||||
TEST_F(IoctlHelperXeTest, whenQueryDeviceIdAndRevisionAndSharedSystemUsmSupportDebugFlagClearThenSharedSystemAllocEnableFalse) {
|
||||
@@ -2863,10 +2854,6 @@ TEST_F(IoctlHelperXeTest, whenQueryDeviceIdAndRevisionAndSharedSystemUsmSupportD
|
||||
|
||||
EXPECT_TRUE(IoctlHelperXe::queryDeviceIdAndRevision(*drm));
|
||||
EXPECT_FALSE(drm->isSharedSystemAllocEnabled());
|
||||
uint64_t caps = (UnifiedSharedMemoryFlags::access | UnifiedSharedMemoryFlags::atomicAccess | UnifiedSharedMemoryFlags::concurrentAccess | UnifiedSharedMemoryFlags::concurrentAtomicAccess);
|
||||
drm->getRootDeviceEnvironment().getMutableHardwareInfo()->capabilityTable.sharedSystemMemCapabilities = caps;
|
||||
drm->adjustSharedSystemMemCapabilities();
|
||||
EXPECT_EQ(0lu, drm->getRootDeviceEnvironment().getMutableHardwareInfo()->capabilityTable.sharedSystemMemCapabilities);
|
||||
EXPECT_FALSE(drm->hasPageFaultSupport());
|
||||
}
|
||||
|
||||
|
||||
@@ -71,27 +71,18 @@ HWTEST_F(ProductHelperTest, givenDebugFlagSetWhenAskingForHostMemCapabilitesThen
|
||||
HWTEST_F(ProductHelperTest, givenProductHelperWhenGettingSharedSystemMemCapabilitiesThenCorrectValueIsReturned) {
|
||||
DebugManagerStateRestore restore;
|
||||
|
||||
uint64_t caps = (UnifiedSharedMemoryFlags::access | UnifiedSharedMemoryFlags::atomicAccess | UnifiedSharedMemoryFlags::concurrentAccess | UnifiedSharedMemoryFlags::concurrentAtomicAccess);
|
||||
pInHwInfo.capabilityTable.sharedSystemMemCapabilities = caps;
|
||||
EXPECT_EQ(caps, productHelper->getSharedSystemMemCapabilities(&pInHwInfo));
|
||||
EXPECT_EQ(0u, productHelper->getSharedSystemMemCapabilities(&pInHwInfo));
|
||||
|
||||
for (auto enable : {-1, 0, 1}) {
|
||||
debugManager.flags.EnableSharedSystemUsmSupport.set(enable);
|
||||
if (enable != 0) {
|
||||
|
||||
if (enable > 0) {
|
||||
auto caps = UnifiedSharedMemoryFlags::access | UnifiedSharedMemoryFlags::atomicAccess | UnifiedSharedMemoryFlags::concurrentAccess | UnifiedSharedMemoryFlags::concurrentAtomicAccess;
|
||||
EXPECT_EQ(caps, productHelper->getSharedSystemMemCapabilities(&pInHwInfo));
|
||||
} else {
|
||||
EXPECT_EQ(0u, productHelper->getSharedSystemMemCapabilities(&pInHwInfo));
|
||||
}
|
||||
}
|
||||
for (auto enable : {-1, 0, 1}) {
|
||||
debugManager.flags.EnableRecoverablePageFaults.set(enable);
|
||||
if (enable != 0) {
|
||||
EXPECT_EQ(caps, productHelper->getSharedSystemMemCapabilities(&pInHwInfo));
|
||||
} else {
|
||||
EXPECT_EQ(0u, productHelper->getSharedSystemMemCapabilities(&pInHwInfo));
|
||||
}
|
||||
}
|
||||
pInHwInfo.capabilityTable.sharedSystemMemCapabilities = caps;
|
||||
}
|
||||
|
||||
HWTEST_F(ProductHelperTest, givenProductHelperWhenAskedIfIsBlitSplitEnqueueWARequiredThenReturnFalse) {
|
||||
@@ -104,7 +95,7 @@ HWTEST_F(ProductHelperTest, givenProductHelperWhenGettingMemoryCapabilitiesThenC
|
||||
|
||||
for (auto capabilityBitmask : {0, 0b0001, 0b0010, 0b0100, 0b1000, 0b1111}) {
|
||||
debugManager.flags.EnableUsmConcurrentAccessSupport.set(capabilityBitmask);
|
||||
std::bitset<5> capabilityBitset(capabilityBitmask);
|
||||
std::bitset<4> capabilityBitset(capabilityBitmask);
|
||||
|
||||
auto hostMemCapabilities = productHelper->getHostMemCapabilities(&pInHwInfo);
|
||||
if (hostMemCapabilities > 0) {
|
||||
|
||||
Reference in New Issue
Block a user