Skip to content

Commit 152ee4a

Browse files
Sysman Fix Multithread Access for zesMemoryGetState
Signed-off-by: Joshua Santosh Ranjan <[email protected]> Related-To: LOCI-2727
1 parent 0e75f43 commit 152ee4a

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

shared/source/os_interface/linux/drm_neo.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ class Drm : public DriverModel {
248248
uint32_t getPciDomain() {
249249
return pciDomain;
250250
}
251+
MOCKABLE_VIRTUAL std::unique_ptr<uint8_t[]> getMemoryRegions();
251252

252253
protected:
253254
Drm(std::unique_ptr<HwDeviceIdDrm> &&hwDeviceIdIn, RootDeviceEnvironment &rootDeviceEnvironment);

shared/source/os_interface/linux/drm_query.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ bool Drm::queryEngineInfo(bool isSysmanEnabled) {
4343
return false;
4444
}
4545

46+
std::unique_ptr<uint8_t[]> Drm::getMemoryRegions() {
47+
return nullptr;
48+
}
49+
4650
bool Drm::queryMemoryInfo() {
4751
auto pHwInfo = getRootDeviceEnvironment().getHardwareInfo();
4852
auto isLocalMemSupported = HwHelper::get(pHwInfo->platform.eRenderCoreFamily).getEnableLocalMemory(*pHwInfo);

shared/test/unit_test/os_interface/linux/drm_query_tests.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,3 +135,11 @@ TEST(DrmQueryTest, givenDrmAllocationWhenShouldAllocationFaultIsCalledThenReturn
135135
MockDrmAllocation allocation(GraphicsAllocation::AllocationType::BUFFER, MemoryPool::MemoryNull);
136136
EXPECT_FALSE(allocation.shouldAllocationPageFault(&drm));
137137
}
138+
139+
TEST(DrmQueryTest, givenDrmWhenGettingMemoryRegionsThenReturnNull) {
140+
auto executionEnvironment = std::make_unique<ExecutionEnvironment>();
141+
executionEnvironment->prepareRootDeviceEnvironments(1);
142+
DrmMock drm{*executionEnvironment->rootDeviceEnvironments[0]};
143+
144+
EXPECT_EQ(drm.getMemoryRegions(), nullptr);
145+
}

0 commit comments

Comments
 (0)