Skip to content

Commit a52f526

Browse files
refactor: cleanup includes
Signed-off-by: Jaroslaw Warchulski <[email protected]>
1 parent 087cc67 commit a52f526

File tree

15 files changed

+91
-36
lines changed

15 files changed

+91
-36
lines changed

level_zero/sysman/test/unit_tests/sources/events/linux/mock_events.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
#include "level_zero/sysman/source/shared/linux/zes_os_sysman_driver_imp.h"
2323
#include "level_zero/sysman/test/unit_tests/sources/linux/mock_sysman_hw_device_id.h"
2424

25+
#include <cstring>
26+
2527
using namespace NEO;
2628

2729
namespace L0 {

level_zero/tools/test/unit_tests/sources/sysman/events/linux/mock_events.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
#include "level_zero/tools/source/sysman/linux/os_sysman_imp.h"
2121
#include "level_zero/tools/source/sysman/linux/pmu/pmu_imp.h"
2222

23+
#include <cstring>
24+
2325
using namespace NEO;
2426
namespace L0 {
2527
namespace ult {

level_zero/tools/test/unit_tests/sources/sysman/ras/linux/mock_sysman_ras.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
#include "level_zero/tools/source/sysman/ras/ras.h"
2020
#include "level_zero/tools/source/sysman/ras/ras_imp.h"
2121

22+
#include <cstring>
23+
2224
using namespace NEO;
2325
namespace L0 {
2426
namespace ult {

shared/source/gmm_helper/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
set(NEO_CORE_GMM_HELPER
88
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
9+
${CMAKE_CURRENT_SOURCE_DIR}/adapter_bdf.h
910
${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}resource_info_${DRIVER_MODEL}.cpp
1011
${CMAKE_CURRENT_SOURCE_DIR}/cache_settings_helper.cpp
1112
${CMAKE_CURRENT_SOURCE_DIR}/cache_settings_helper.h
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* Copyright (C) 2025 Intel Corporation
3+
*
4+
* SPDX-License-Identifier: MIT
5+
*
6+
*/
7+
8+
#pragma once
9+
#include <cstdint>
10+
11+
namespace NEO {
12+
13+
struct AdapterBdf {
14+
union {
15+
struct {
16+
uint32_t bus : 8;
17+
uint32_t device : 8;
18+
uint32_t function : 8;
19+
uint32_t reserved : 8;
20+
};
21+
uint32_t data;
22+
};
23+
};
24+
25+
} // namespace NEO

shared/source/gmm_helper/gmm_wrappers.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@
55
*
66
*/
77

8+
#include "shared/source/gmm_helper/adapter_bdf.h"
89
#include "shared/source/gmm_helper/gmm_lib.h"
910
#include "shared/source/helpers/surface_format_info.h"
1011

12+
#include <type_traits>
13+
1114
namespace NEO {
1215
static_assert(static_cast<GMM_YUV_PLANE>(ImagePlane::noPlane) == GMM_NO_PLANE);
1316
static_assert(static_cast<GMM_YUV_PLANE>(ImagePlane::planeY) == GMM_PLANE_Y);
@@ -22,4 +25,9 @@ static_assert(static_cast<GMM_TILE_TYPE>(ImageTilingMode::tiledW) == GMM_TILED_W
2225
static_assert(static_cast<GMM_TILE_TYPE>(ImageTilingMode::notTiled) == GMM_NOT_TILED);
2326
static_assert(static_cast<GMM_TILE_TYPE>(ImageTilingMode::tiled4) == GMM_TILED_4);
2427
static_assert(static_cast<GMM_TILE_TYPE>(ImageTilingMode::tiled64) == GMM_TILED_64);
28+
29+
static_assert(sizeof(AdapterBdf) == sizeof(ADAPTER_BDF));
30+
static_assert(offsetof(AdapterBdf, data) == offsetof(ADAPTER_BDF, Data));
31+
static_assert(std::is_same_v<decltype(AdapterBdf::data), decltype(ADAPTER_BDF::Data)>);
32+
2533
} // namespace NEO

shared/source/os_interface/linux/drm_neo.cpp

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
#include "shared/source/os_interface/linux/cache_info.h"
2929
#include "shared/source/os_interface/linux/drm_buffer_object.h"
3030
#include "shared/source/os_interface/linux/drm_engine_mapper.h"
31-
#include "shared/source/os_interface/linux/drm_gem_close_worker.h"
3231
#include "shared/source/os_interface/linux/drm_memory_manager.h"
3332
#include "shared/source/os_interface/linux/drm_memory_operations_handler_bind.h"
3433
#include "shared/source/os_interface/linux/drm_wrappers.h"
@@ -46,7 +45,6 @@
4645
#include "shared/source/os_interface/os_environment.h"
4746
#include "shared/source/os_interface/os_interface.h"
4847
#include "shared/source/os_interface/product_helper.h"
49-
#include "shared/source/release_helper/release_helper.h"
5048
#include "shared/source/utilities/api_intercept.h"
5149
#include "shared/source/utilities/cpu_info.h"
5250
#include "shared/source/utilities/directory.h"
@@ -888,11 +886,11 @@ void Drm::setNewResourceBoundToVM(BufferObject *bo, uint32_t vmHandleId) {
888886
PhysicalDevicePciBusInfo Drm::getPciBusInfo() const {
889887
PhysicalDevicePciBusInfo pciBusInfo(PhysicalDevicePciBusInfo::invalidValue, PhysicalDevicePciBusInfo::invalidValue, PhysicalDevicePciBusInfo::invalidValue, PhysicalDevicePciBusInfo::invalidValue);
890888

891-
if (adapterBDF.Data != std::numeric_limits<uint32_t>::max()) {
889+
if (adapterBDF.data != std::numeric_limits<uint32_t>::max()) {
892890
pciBusInfo.pciDomain = this->pciDomain;
893-
pciBusInfo.pciBus = adapterBDF.Bus;
894-
pciBusInfo.pciDevice = adapterBDF.Device;
895-
pciBusInfo.pciFunction = adapterBDF.Function;
891+
pciBusInfo.pciBus = adapterBDF.bus;
892+
pciBusInfo.pciDevice = adapterBDF.device;
893+
pciBusInfo.pciFunction = adapterBDF.function;
896894
}
897895
return pciBusInfo;
898896
}
@@ -911,22 +909,22 @@ int Drm::queryAdapterBDF() {
911909
uint8_t bus = -1, device = -1, function = -1;
912910

913911
if (NEO::parseBdfString(hwDeviceId->getPciPath(), domain, bus, device, function) != pciBusInfoTokensNum) {
914-
adapterBDF.Data = std::numeric_limits<uint32_t>::max();
912+
adapterBDF.data = std::numeric_limits<uint32_t>::max();
915913
return 1;
916914
}
917915
setPciDomain(domain);
918-
adapterBDF.Bus = bus;
919-
adapterBDF.Function = function;
920-
adapterBDF.Device = device;
916+
adapterBDF.bus = bus;
917+
adapterBDF.function = function;
918+
adapterBDF.device = device;
921919
return 0;
922920
}
923921

924922
void Drm::setGmmInputArgs(void *args) {
925923
auto gmmInArgs = reinterpret_cast<GMM_INIT_IN_ARGS *>(args);
926924
#if defined(__linux__)
927-
gmmInArgs->FileDescriptor = adapterBDF.Data;
925+
gmmInArgs->FileDescriptor = adapterBDF.data;
928926
#else
929-
gmmInArgs->stAdapterBDF = adapterBDF;
927+
gmmInArgs->stAdapterBDF.Data = adapterBDF.data;
930928
#endif
931929
gmmInArgs->ClientType = GMM_CLIENT::GMM_OCL_VISTA;
932930
}

shared/source/os_interface/linux/drm_neo.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,16 @@
66
*/
77

88
#pragma once
9-
#include "shared/source/gmm_helper/gmm_lib.h"
9+
#include "shared/source/gmm_helper/adapter_bdf.h"
1010
#include "shared/source/helpers/driver_model_type.h"
1111
#include "shared/source/memory_manager/definitions/engine_limits.h"
1212
#include "shared/source/os_interface/linux/drm_debug.h"
1313
#include "shared/source/os_interface/linux/drm_wrappers.h"
1414
#include "shared/source/os_interface/linux/hw_device_id.h"
1515
#include "shared/source/os_interface/os_interface.h"
1616

17+
#include "neo_igfxfmid.h"
18+
1719
#include <array>
1820
#include <atomic>
1921
#include <cstdint>
@@ -22,10 +24,9 @@
2224
#include <mutex>
2325
#include <string>
2426
#include <unordered_map>
27+
#include <utility>
2528
#include <vector>
2629

27-
struct GT_SYSTEM_INFO;
28-
2930
namespace aub_stream {
3031
enum EngineType : uint32_t;
3132
}
@@ -318,7 +319,7 @@ class Drm : public DriverModel {
318319
#pragma pack()
319320

320321
GemContextParamSseu sseu{};
321-
ADAPTER_BDF adapterBDF{};
322+
AdapterBdf adapterBDF{};
322323
uint32_t pciDomain = 0;
323324

324325
struct IoctlStatisticsEntry {

shared/source/os_interface/windows/hw_device_id.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2020-2023 Intel Corporation
2+
* Copyright (C) 2020-2025 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -8,10 +8,9 @@
88
#pragma once
99
#include "shared/source/helpers/driver_model_type.h"
1010
#include "shared/source/os_interface/os_interface.h"
11+
#include "shared/source/os_interface/windows/d3dkmthk_wrapper.h"
1112
#include "shared/source/os_interface/windows/windows_wrapper.h"
1213

13-
#include <d3dkmthk.h>
14-
1514
#include <memory>
1615

1716
namespace NEO {

shared/source/os_interface/windows/wddm/set_gmm_input_args_wddm.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/*
2-
* Copyright (C) 2021-2024 Intel Corporation
2+
* Copyright (C) 2021-2025 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
66
*/
77

8-
#include "shared/source/gmm_helper/client_context/gmm_client_context.h"
8+
#include "shared/source/gmm_helper/gmm_lib.h"
99
#include "shared/source/os_interface/windows/wddm/wddm.h"
1010

1111
namespace NEO {
@@ -18,7 +18,7 @@ void Wddm::setGmmInputArgs(void *args) {
1818
gmmInArgs->pSkuTable = gfxFeatureTable.get();
1919
gmmInArgs->pWaTable = gfxWorkaroundTable.get();
2020

21-
gmmInArgs->stAdapterBDF = this->adapterBDF;
21+
gmmInArgs->stAdapterBDF.Data = this->adapterBDF.data;
2222
gmmInArgs->ClientType = GMM_CLIENT::GMM_OCL_VISTA;
2323
gmmInArgs->DeviceRegistryPath = deviceRegistryPath.c_str();
2424
}

0 commit comments

Comments
 (0)