Skip to content

Commit 2eba5b3

Browse files
refactor: correct naming of DrmParam enum values
Signed-off-by: Mateusz Jablonski <[email protected]>
1 parent 9024e4a commit 2eba5b3

31 files changed

+524
-524
lines changed

level_zero/sysman/test/unit_tests/sources/scheduler/linux/mock_sysfs_scheduler_prelim.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ struct MockSchedulerNeoDrm : public Drm {
4040

4141
bool sysmanQueryEngineInfo() override {
4242

43-
uint16_t engineClassCopy = ioctlHelper->getDrmParamValue(DrmParam::EngineClassCopy);
44-
uint16_t engineClassCompute = ioctlHelper->getDrmParamValue(DrmParam::EngineClassCompute);
45-
uint16_t engineClassVideo = ioctlHelper->getDrmParamValue(DrmParam::EngineClassVideo);
46-
uint16_t engineClassVideoEnhance = ioctlHelper->getDrmParamValue(DrmParam::EngineClassVideoEnhance);
47-
uint16_t engineClassInvalid = ioctlHelper->getDrmParamValue(DrmParam::EngineClassInvalid);
43+
uint16_t engineClassCopy = ioctlHelper->getDrmParamValue(DrmParam::engineClassCopy);
44+
uint16_t engineClassCompute = ioctlHelper->getDrmParamValue(DrmParam::engineClassCompute);
45+
uint16_t engineClassVideo = ioctlHelper->getDrmParamValue(DrmParam::engineClassVideo);
46+
uint16_t engineClassVideoEnhance = ioctlHelper->getDrmParamValue(DrmParam::engineClassVideoEnhance);
47+
uint16_t engineClassInvalid = ioctlHelper->getDrmParamValue(DrmParam::engineClassInvalid);
4848

4949
// Fill distanceInfos vector with dummy values
5050
std::vector<NEO::DistanceInfo> distanceInfos = {

level_zero/tools/test/unit_tests/sources/metrics/linux/test_metric_ip_sampling_linux_pvc_prelim.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class DrmPrelimMock : public DrmMock {
5555
}
5656

5757
bool queryEngineInfo() override {
58-
uint16_t computeEngineClass = getIoctlHelper()->getDrmParamValue(DrmParam::EngineClassCompute);
58+
uint16_t computeEngineClass = getIoctlHelper()->getDrmParamValue(DrmParam::engineClassCompute);
5959
std::vector<EngineCapabilities> engines(4);
6060
engines[0].engine = {computeEngineClass, 0};
6161
engines[0].capabilities = 0;
@@ -86,7 +86,7 @@ class DrmPrelimMock : public DrmMock {
8686
}
8787

8888
bool queryEngineInfo1SubDevice() {
89-
uint16_t computeEngineClass = getIoctlHelper()->getDrmParamValue(DrmParam::EngineClassCompute);
89+
uint16_t computeEngineClass = getIoctlHelper()->getDrmParamValue(DrmParam::engineClassCompute);
9090
std::vector<EngineCapabilities> engines(1);
9191
engines[0].engine = {computeEngineClass, 0};
9292
engines[0].capabilities = 0;

level_zero/tools/test/unit_tests/sources/sysman/scheduler/linux/mock_sysfs_scheduler_prelim.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ struct MockSchedulerNeoDrm : public Drm {
3838

3939
bool sysmanQueryEngineInfo() override {
4040

41-
uint16_t engineClassCopy = ioctlHelper->getDrmParamValue(DrmParam::EngineClassCopy);
42-
uint16_t engineClassCompute = ioctlHelper->getDrmParamValue(DrmParam::EngineClassCompute);
43-
uint16_t engineClassVideo = ioctlHelper->getDrmParamValue(DrmParam::EngineClassVideo);
44-
uint16_t engineClassVideoEnhance = ioctlHelper->getDrmParamValue(DrmParam::EngineClassVideoEnhance);
45-
uint16_t engineClassInvalid = ioctlHelper->getDrmParamValue(DrmParam::EngineClassInvalid);
41+
uint16_t engineClassCopy = ioctlHelper->getDrmParamValue(DrmParam::engineClassCopy);
42+
uint16_t engineClassCompute = ioctlHelper->getDrmParamValue(DrmParam::engineClassCompute);
43+
uint16_t engineClassVideo = ioctlHelper->getDrmParamValue(DrmParam::engineClassVideo);
44+
uint16_t engineClassVideoEnhance = ioctlHelper->getDrmParamValue(DrmParam::engineClassVideoEnhance);
45+
uint16_t engineClassInvalid = ioctlHelper->getDrmParamValue(DrmParam::engineClassInvalid);
4646

4747
// Fill distanceInfos vector with dummy values
4848
std::vector<NEO::DistanceInfo> distanceInfos = {

opencl/test/unit_test/os_interface/linux/cl_drm_memory_manager_tests.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ HWTEST_F(ClDrmMemoryManagerTest, givenDrmMemoryManagerWhenTiledImageWithMipCount
352352
EXPECT_EQ(1u, this->mock->createParamsHandle);
353353
EXPECT_EQ(imageSize, this->mock->createParamsSize);
354354
auto ioctlHelper = this->mock->getIoctlHelper();
355-
uint32_t tilingMode = ioctlHelper->getDrmParamValue(DrmParam::TilingY);
355+
uint32_t tilingMode = ioctlHelper->getDrmParamValue(DrmParam::tilingY);
356356
EXPECT_EQ(tilingMode, this->mock->setTilingMode);
357357
EXPECT_EQ(rowPitch, this->mock->setTilingStride);
358358
EXPECT_EQ(1u, this->mock->setTilingHandle);
@@ -402,7 +402,7 @@ HWTEST_F(ClDrmMemoryManagerTest, givenDrmMemoryManagerWhenTiledImageWithMipCount
402402
EXPECT_EQ(1u, this->mock->createParamsHandle);
403403
EXPECT_EQ(imageSize, this->mock->createParamsSize);
404404
auto ioctlHelper = this->mock->getIoctlHelper();
405-
uint32_t tilingMode = ioctlHelper->getDrmParamValue(DrmParam::TilingY);
405+
uint32_t tilingMode = ioctlHelper->getDrmParamValue(DrmParam::tilingY);
406406
EXPECT_EQ(tilingMode, this->mock->setTilingMode);
407407
EXPECT_EQ(rowPitch, this->mock->setTilingStride);
408408
EXPECT_EQ(1u, this->mock->setTilingHandle);
@@ -517,7 +517,7 @@ HWTEST_F(ClDrmMemoryManagerTest, givenDrmMemoryManagerWhenTiledImageIsBeingCreat
517517
EXPECT_EQ(1u, this->mock->createParamsHandle);
518518
EXPECT_EQ(imageSize, this->mock->createParamsSize);
519519
auto ioctlHelper = this->mock->getIoctlHelper();
520-
uint32_t tilingMode = ioctlHelper->getDrmParamValue(DrmParam::TilingY);
520+
uint32_t tilingMode = ioctlHelper->getDrmParamValue(DrmParam::tilingY);
521521
EXPECT_EQ(tilingMode, this->mock->setTilingMode);
522522
EXPECT_EQ(rowPitch, this->mock->setTilingStride);
523523
EXPECT_EQ(1u, this->mock->setTilingHandle);
@@ -595,7 +595,7 @@ TEST_F(ClDrmMemoryManagerTest, givenDrmMemoryManagerWhenNonTiledImgWithMipCountZ
595595
EXPECT_EQ(0u, this->mock->createParamsHandle);
596596
EXPECT_EQ(0u, this->mock->createParamsSize);
597597
auto ioctlHelper = this->mock->getIoctlHelper();
598-
uint32_t tilingMode = ioctlHelper->getDrmParamValue(DrmParam::TilingNone);
598+
uint32_t tilingMode = ioctlHelper->getDrmParamValue(DrmParam::tilingNone);
599599
EXPECT_EQ(tilingMode, this->mock->setTilingMode);
600600
EXPECT_EQ(0u, this->mock->setTilingStride);
601601
EXPECT_EQ(0u, this->mock->setTilingHandle);
@@ -645,7 +645,7 @@ TEST_F(ClDrmMemoryManagerTest, givenDrmMemoryManagerWhenNonTiledImgWithMipCountN
645645
EXPECT_EQ(0u, this->mock->createParamsHandle);
646646
EXPECT_EQ(0u, this->mock->createParamsSize);
647647
auto ioctlHelper = this->mock->getIoctlHelper();
648-
uint32_t tilingMode = ioctlHelper->getDrmParamValue(DrmParam::TilingNone);
648+
uint32_t tilingMode = ioctlHelper->getDrmParamValue(DrmParam::tilingNone);
649649
EXPECT_EQ(tilingMode, this->mock->setTilingMode);
650650
EXPECT_EQ(0u, this->mock->setTilingStride);
651651
EXPECT_EQ(0u, this->mock->setTilingHandle);
@@ -688,7 +688,7 @@ TEST_F(ClDrmMemoryManagerTest, givenDrmMemoryManagerWhen1DarrayImageIsBeingCreat
688688
EXPECT_EQ(0u, this->mock->createParamsHandle);
689689
EXPECT_EQ(0u, this->mock->createParamsSize);
690690
auto ioctlHelper = this->mock->getIoctlHelper();
691-
uint32_t tilingMode = ioctlHelper->getDrmParamValue(DrmParam::TilingNone);
691+
uint32_t tilingMode = ioctlHelper->getDrmParamValue(DrmParam::tilingNone);
692692
EXPECT_EQ(tilingMode, this->mock->setTilingMode);
693693
EXPECT_EQ(0u, this->mock->setTilingStride);
694694
EXPECT_EQ(0u, this->mock->setTilingHandle);
@@ -745,7 +745,7 @@ TEST_F(ClDrmMemoryManagerTest, givenOsHandleWithNonTiledObjectWhenCreateFromShar
745745
mock->ioctlExpected.gemClose = 1;
746746
mock->ioctlExpected.gemGetTiling = 1;
747747
auto ioctlHelper = this->mock->getIoctlHelper();
748-
mock->getTilingModeOut = ioctlHelper->getDrmParamValue(DrmParam::TilingNone);
748+
mock->getTilingModeOut = ioctlHelper->getDrmParamValue(DrmParam::tilingNone);
749749

750750
osHandle handle = 1u;
751751
uint32_t boHandle = 2u;
@@ -788,7 +788,7 @@ TEST_F(ClDrmMemoryManagerTest, givenOsHandleWithTileYObjectWhenCreateFromSharedH
788788
mock->ioctlExpected.gemClose = 1;
789789
mock->ioctlExpected.gemGetTiling = 1;
790790
auto ioctlHelper = this->mock->getIoctlHelper();
791-
mock->getTilingModeOut = ioctlHelper->getDrmParamValue(DrmParam::TilingY);
791+
mock->getTilingModeOut = ioctlHelper->getDrmParamValue(DrmParam::tilingY);
792792

793793
osHandle handle = 1u;
794794
uint32_t boHandle = 2u;

shared/source/direct_submission/linux/drm_direct_submission.inl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ bool DrmDirectSubmission<GfxFamily, Dispatcher>::submit(uint64_t gpuAddress, siz
128128

129129
auto osContextLinux = static_cast<OsContextLinux *>(&this->osContext);
130130
auto &drm = osContextLinux->getDrm();
131-
auto execFlags = osContextLinux->getEngineFlag() | drm.getIoctlHelper()->getDrmParamValue(DrmParam::ExecNoReloc);
131+
auto execFlags = osContextLinux->getEngineFlag() | drm.getIoctlHelper()->getDrmParamValue(DrmParam::execNoReloc);
132132
auto &drmContextIds = osContextLinux->getDrmContextIds();
133133

134134
ExecObject execObject{};

shared/source/os_interface/linux/drm_allocation.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ bool DrmAllocation::prefetchBOWithChunking(Drm *drm) {
196196
auto bo = this->getBO();
197197

198198
auto ioctlHelper = drm->getIoctlHelper();
199-
auto memoryClassDevice = ioctlHelper->getDrmParamValue(DrmParam::MemoryClassDevice);
199+
auto memoryClassDevice = ioctlHelper->getDrmParamValue(DrmParam::memoryClassDevice);
200200
auto subDeviceIds = getSubDeviceIds(storageInfo.subDeviceBitfield);
201201

202202
uint32_t chunksPerSubDevice = this->storageInfo.numOfChunks / subDeviceIds.size();
@@ -302,7 +302,7 @@ int DrmAllocation::bindBOs(OsContext *osContext, uint32_t vmHandleId, std::vecto
302302
bool DrmAllocation::prefetchBO(BufferObject *bo, uint32_t vmHandleId, uint32_t subDeviceId) {
303303
auto drm = bo->peekDrm();
304304
auto ioctlHelper = drm->getIoctlHelper();
305-
auto memoryClassDevice = ioctlHelper->getDrmParamValue(DrmParam::MemoryClassDevice);
305+
auto memoryClassDevice = ioctlHelper->getDrmParamValue(DrmParam::memoryClassDevice);
306306
auto region = static_cast<uint32_t>((memoryClassDevice << 16u) | subDeviceId);
307307
auto vmId = drm->getVirtualMemoryAddressSpace(vmHandleId);
308308

shared/source/os_interface/linux/drm_buffer_object.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ BufferObject::BufferObject(uint32_t rootDeviceIndex, Drm *drm, uint64_t patIndex
8484
: drm(drm), refCount(1), rootDeviceIndex(rootDeviceIndex), handle(std::move(handle)), size(size) {
8585

8686
auto ioctlHelper = drm->getIoctlHelper();
87-
this->tilingMode = ioctlHelper->getDrmParamValue(DrmParam::TilingNone);
87+
this->tilingMode = ioctlHelper->getDrmParamValue(DrmParam::tilingNone);
8888
this->lockedAddress = nullptr;
8989
this->patIndex = patIndex;
9090

shared/source/os_interface/linux/drm_command_stream.inl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ int DrmCommandStreamReceiver<GfxFamily>::exec(const BatchBuffer &batchBuffer, ui
225225
DEBUG_BREAK_IF(!bb);
226226

227227
auto osContextLinux = static_cast<OsContextLinux *>(this->osContext);
228-
auto execFlags = osContextLinux->getEngineFlag() | drm->getIoctlHelper()->getDrmParamValue(DrmParam::ExecNoReloc);
228+
auto execFlags = osContextLinux->getEngineFlag() | drm->getIoctlHelper()->getDrmParamValue(DrmParam::execNoReloc);
229229

230230
// requiredSize determinant:
231231
// * vmBind UNAVAILABLE => residency holds all allocations except for the command buffer

shared/source/os_interface/linux/drm_engine_mapper.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2020-2022 Intel Corporation
2+
* Copyright (C) 2020-2023 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -15,11 +15,11 @@ namespace NEO {
1515

1616
DrmParam DrmEngineMapper::engineNodeMap(aub_stream::EngineType engineType) {
1717
if (EngineHelpers::isCcs(engineType)) {
18-
return DrmParam::ExecDefault;
18+
return DrmParam::execDefault;
1919
} else if (aub_stream::ENGINE_BCS == engineType || EngineHelpers::isLinkBcs(engineType)) {
20-
return DrmParam::ExecBlt;
20+
return DrmParam::execBlt;
2121
}
2222
UNRECOVERABLE_IF(engineType != aub_stream::ENGINE_RCS && engineType != aub_stream::ENGINE_CCCS);
23-
return DrmParam::ExecRender;
23+
return DrmParam::execRender;
2424
}
2525
} // namespace NEO

shared/source/os_interface/linux/drm_memory_manager.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,7 @@ GraphicsAllocation *DrmMemoryManager::allocateGraphicsMemoryForImageImpl(const A
679679
}
680680
bo->setAddress(gpuRange);
681681

682-
[[maybe_unused]] auto ret2 = bo->setTiling(ioctlHelper->getDrmParamValue(DrmParam::TilingY), static_cast<uint32_t>(allocationData.imgInfo->rowPitch));
682+
[[maybe_unused]] auto ret2 = bo->setTiling(ioctlHelper->getDrmParamValue(DrmParam::tilingY), static_cast<uint32_t>(allocationData.imgInfo->rowPitch));
683683
DEBUG_BREAK_IF(ret2 != true);
684684

685685
auto allocation = new DrmAllocation(allocationData.rootDeviceIndex, allocationData.type, bo.get(), nullptr, gpuRange, allocationData.imgInfo->size, memoryPool);
@@ -1055,7 +1055,7 @@ GraphicsAllocation *DrmMemoryManager::createGraphicsAllocationFromSharedHandle(o
10551055
ret = ioctlHelper->getGemTiling(&getTiling);
10561056

10571057
if (ret) {
1058-
if (getTiling.tilingMode == static_cast<uint32_t>(ioctlHelper->getDrmParamValue(DrmParam::TilingNone))) {
1058+
if (getTiling.tilingMode == static_cast<uint32_t>(ioctlHelper->getDrmParamValue(DrmParam::tilingNone))) {
10591059
properties.imgInfo->linearStorage = true;
10601060
}
10611061
}
@@ -2166,7 +2166,7 @@ DrmAllocation *DrmMemoryManager::createAllocWithAlignment(const AllocationData &
21662166

21672167
uint64_t offset = 0;
21682168
auto ioctlHelper = drm.getIoctlHelper();
2169-
uint64_t mmapOffsetWb = ioctlHelper->getDrmParamValue(DrmParam::MmapOffsetWb);
2169+
uint64_t mmapOffsetWb = ioctlHelper->getDrmParamValue(DrmParam::mmapOffsetWb);
21702170
if (!retrieveMmapOffsetForBufferObject(allocationData.rootDeviceIndex, *bo, mmapOffsetWb, offset)) {
21712171
releaseGpuRange(reinterpret_cast<void *>(preferredAddress), totalSizeToAlloc, allocationData.rootDeviceIndex);
21722172
this->munmapFunction(cpuPointer, size);
@@ -2219,7 +2219,7 @@ void *DrmMemoryManager::lockBufferObject(BufferObject *bo) {
22192219
auto rootDeviceIndex = this->getRootDeviceIndex(drm);
22202220

22212221
auto ioctlHelper = drm->getIoctlHelper();
2222-
uint64_t mmapOffsetWc = ioctlHelper->getDrmParamValue(DrmParam::MmapOffsetWc);
2222+
uint64_t mmapOffsetWc = ioctlHelper->getDrmParamValue(DrmParam::mmapOffsetWc);
22232223
uint64_t offset = 0;
22242224
if (!retrieveMmapOffsetForBufferObject(rootDeviceIndex, *bo, mmapOffsetWc, offset)) {
22252225
return nullptr;
@@ -2362,7 +2362,7 @@ GraphicsAllocation *DrmMemoryManager::createSharedUnifiedMemoryAllocation(const
23622362
return nullptr;
23632363
}
23642364

2365-
uint64_t mmapOffsetWb = ioctlHelper->getDrmParamValue(DrmParam::MmapOffsetWb);
2365+
uint64_t mmapOffsetWb = ioctlHelper->getDrmParamValue(DrmParam::mmapOffsetWb);
23662366
uint64_t offset = 0;
23672367
if (!retrieveMmapOffsetForBufferObject(allocationData.rootDeviceIndex, *bo, mmapOffsetWb, offset)) {
23682368
this->munmapFunction(cpuBasePointer, totalSizeToAlloc);
@@ -2503,7 +2503,7 @@ DrmAllocation *DrmMemoryManager::createUSMHostAllocationFromSharedHandle(osHandl
25032503

25042504
bo->setAddress(reinterpret_cast<uintptr_t>(cpuPointer));
25052505

2506-
uint64_t mmapOffsetWb = ioctlHelper->getDrmParamValue(DrmParam::MmapOffsetWb);
2506+
uint64_t mmapOffsetWb = ioctlHelper->getDrmParamValue(DrmParam::mmapOffsetWb);
25072507
uint64_t offset = 0;
25082508
if (!retrieveMmapOffsetForBufferObject(properties.rootDeviceIndex, *bo, mmapOffsetWb, offset)) {
25092509
this->munmapFunction(cpuPointer, size);

0 commit comments

Comments
 (0)