clang-tidy configuration cleanup

Define single .clang-tidy configuration with all used checks and use
NOLINT to selectively silence tool. That way cleanup should be easier.
third_part/ has its own configuration that disables clang-tidy for this
folder.

Signed-off-by: Artur Harasimiuk <artur.harasimiuk@intel.com>
This commit is contained in:
Artur Harasimiuk
2022-05-09 17:40:30 +00:00
committed by Compute-Runtime-Automation
parent 910871a706
commit e9be9b64c6
235 changed files with 920 additions and 1169 deletions

View File

@@ -22,26 +22,26 @@ struct PhysicalDevicePciBusInfo {
PhysicalDevicePciBusInfo(uint32_t domain, uint32_t bus, uint32_t device, uint32_t function)
: pciDomain(domain), pciBus(bus), pciDevice(device), pciFunction(function) {}
static constexpr uint32_t InvalidValue = std::numeric_limits<uint32_t>::max();
static constexpr uint32_t invalidValue = std::numeric_limits<uint32_t>::max();
static constexpr PhysicalDevicePciBusInfo invalid() { return {}; }
uint32_t pciDomain = InvalidValue;
uint32_t pciBus = InvalidValue;
uint32_t pciDevice = InvalidValue;
uint32_t pciFunction = InvalidValue;
uint32_t pciDomain = invalidValue;
uint32_t pciBus = invalidValue;
uint32_t pciDevice = invalidValue;
uint32_t pciFunction = invalidValue;
};
struct PhyicalDevicePciSpeedInfo {
static constexpr int32_t Unknown = -1;
int32_t genVersion = Unknown;
int32_t width = Unknown;
int64_t maxBandwidth = Unknown;
static constexpr int32_t unknown = -1;
int32_t genVersion = unknown;
int32_t width = unknown;
int64_t maxBandwidth = unknown;
};
class DriverInfo {
public:
DriverInfo()
: pciBusInfo(PhysicalDevicePciBusInfo::InvalidValue, PhysicalDevicePciBusInfo::InvalidValue, PhysicalDevicePciBusInfo::InvalidValue, PhysicalDevicePciBusInfo::InvalidValue) {}
: pciBusInfo(PhysicalDevicePciBusInfo::invalidValue, PhysicalDevicePciBusInfo::invalidValue, PhysicalDevicePciBusInfo::invalidValue, PhysicalDevicePciBusInfo::invalidValue) {}
static DriverInfo *create(const HardwareInfo *hwInfo, const OSInterface *osInterface);

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020-2021 Intel Corporation
* Copyright (C) 2020-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -15,7 +15,7 @@
namespace NEO {
DriverInfo *DriverInfo::create(const HardwareInfo *hwInfo, const OSInterface *osInterface) {
PhysicalDevicePciBusInfo pciBusInfo(PhysicalDevicePciBusInfo::InvalidValue, PhysicalDevicePciBusInfo::InvalidValue, PhysicalDevicePciBusInfo::InvalidValue, PhysicalDevicePciBusInfo::InvalidValue);
PhysicalDevicePciBusInfo pciBusInfo(PhysicalDevicePciBusInfo::invalidValue, PhysicalDevicePciBusInfo::invalidValue, PhysicalDevicePciBusInfo::invalidValue, PhysicalDevicePciBusInfo::invalidValue);
if (osInterface) {
pciBusInfo = osInterface->getDriverModel()->getPciBusInfo();
}

View File

@@ -33,7 +33,7 @@
namespace NEO {
BufferObject::BufferObject(Drm *drm, uint64_t patIndex, int handle, size_t size, size_t maxOsContextCount) : drm(drm), refCount(1), handle(handle), size(size), isReused(false) {
BufferObject::BufferObject(Drm *drm, uint64_t patIndex, int handle, size_t size, size_t maxOsContextCount) : drm(drm), refCount(1), handle(handle), size(size) {
this->tilingMode = I915_TILING_NONE;
this->lockedAddress = nullptr;
this->patIndex = patIndex;
@@ -172,8 +172,8 @@ int BufferObject::exec(uint32_t used, size_t startOffset, unsigned int flags, bo
if (ret != 0) {
const auto status = evictUnusedAllocations(true, true);
if (status == MemoryOperationsStatus::GPU_HANG_DETECTED_DURING_OPERATION) {
PRINT_DEBUG_STRING(DebugManager.flags.PrintDebugMessages.get(), stderr, "Error! GPU hang detected in BufferObject::exec(). Returning %d\n", GPU_HANG_DETECTED);
return GPU_HANG_DETECTED;
PRINT_DEBUG_STRING(DebugManager.flags.PrintDebugMessages.get(), stderr, "Error! GPU hang detected in BufferObject::exec(). Returning %d\n", gpuHangDetected);
return gpuHangDetected;
}
ret = ioctlHelper->execBuffer(drm, &execbuf, completionGpuAddress, completionValue);

View File

@@ -139,7 +139,7 @@ class BufferObject {
uint64_t peekPatIndex() const { return patIndex; }
void setPatIndex(uint64_t newPatIndex) { this->patIndex = newPatIndex; }
static constexpr int GPU_HANG_DETECTED{-7171};
static constexpr int gpuHangDetected{-7171};
protected:
MOCKABLE_VIRTUAL MemoryOperationsStatus evictUnusedAllocations(bool waitForCompletion, bool isLockNeeded);
@@ -151,7 +151,7 @@ class BufferObject {
uint32_t rootDeviceIndex = std::numeric_limits<uint32_t>::max();
int handle; // i915 gem object handle
uint64_t size;
bool isReused;
bool isReused = false;
uint32_t tilingMode;
bool allowCapture = false;

View File

@@ -43,10 +43,10 @@ class DrmCommandStreamReceiver : public DeviceCommandStreamReceiver<GfxFamily> {
uint32_t rootDeviceIndex,
const DeviceBitfield deviceBitfield,
gemCloseWorkerMode mode = gemCloseWorkerMode::gemCloseWorkerActive);
~DrmCommandStreamReceiver();
~DrmCommandStreamReceiver() override;
SubmissionStatus flush(BatchBuffer &batchBuffer, ResidencyContainer &allocationsForResidency) override;
MOCKABLE_VIRTUAL void processResidency(const ResidencyContainer &allocationsForResidency, uint32_t handleId) override;
void processResidency(const ResidencyContainer &allocationsForResidency, uint32_t handleId) override;
void makeNonResident(GraphicsAllocation &gfxAllocation) override;
bool waitForFlushStamp(FlushStamp &flushStampToWait) override;
bool isKmdWaitModeActive() override;

View File

@@ -821,7 +821,7 @@ bool Drm::translateTopologyInfo(const drm_i915_query_topology_info *queryTopolog
}
PhysicalDevicePciBusInfo Drm::getPciBusInfo() const {
PhysicalDevicePciBusInfo pciBusInfo(PhysicalDevicePciBusInfo::InvalidValue, PhysicalDevicePciBusInfo::InvalidValue, PhysicalDevicePciBusInfo::InvalidValue, PhysicalDevicePciBusInfo::InvalidValue);
PhysicalDevicePciBusInfo pciBusInfo(PhysicalDevicePciBusInfo::invalidValue, PhysicalDevicePciBusInfo::invalidValue, PhysicalDevicePciBusInfo::invalidValue, PhysicalDevicePciBusInfo::invalidValue);
if (adapterBDF.Data != std::numeric_limits<uint32_t>::max()) {
pciBusInfo.pciDomain = this->pciDomain;

View File

@@ -50,7 +50,7 @@ struct HardwareInfo;
struct RootDeviceEnvironment;
struct SystemInfo;
struct DeviceDescriptor { // NOLINT(clang-analyzer-optin.performance.Padding)
struct DeviceDescriptor {
unsigned short deviceId;
const HardwareInfo *pHwInfo;
void (*setupHardwareInfo)(HardwareInfo *, bool);
@@ -86,7 +86,7 @@ class Drm : public DriverModel {
int maxEuCount;
};
virtual ~Drm();
~Drm() override;
virtual int ioctl(unsigned long request, void *arg);

View File

@@ -39,9 +39,9 @@ class DrmNullDevice : public Drm {
}
}
DrmNullDevice(std::unique_ptr<HwDeviceIdDrm> &&hwDeviceId, RootDeviceEnvironment &rootDeviceEnvironment) : Drm(std::move(hwDeviceId), rootDeviceEnvironment), gpuTimestamp(0){};
DrmNullDevice(std::unique_ptr<HwDeviceIdDrm> &&hwDeviceId, RootDeviceEnvironment &rootDeviceEnvironment) : Drm(std::move(hwDeviceId), rootDeviceEnvironment){};
protected:
uint64_t gpuTimestamp;
uint64_t gpuTimestamp = 0;
};
} // namespace NEO

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2021 Intel Corporation
* Copyright (C) 2018-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -20,7 +20,7 @@ class DeferrableDeletionImpl : public DeferrableDeletion {
public:
DeferrableDeletionImpl(Wddm *wddm, const D3DKMT_HANDLE *handles, uint32_t allocationCount, D3DKMT_HANDLE resourceHandle);
bool apply() override;
~DeferrableDeletionImpl();
~DeferrableDeletionImpl() override;
DeferrableDeletionImpl(const DeferrableDeletionImpl &) = delete;
DeferrableDeletionImpl &operator=(const DeferrableDeletionImpl &) = delete;

View File

@@ -89,7 +89,7 @@ bool DriverInfoWindows::isCompatibleDriverStore() const {
}
bool isCompatibleDriverStore(std::string &&deviceRegistryPath) {
DriverInfoWindows driverInfo(deviceRegistryPath, PhysicalDevicePciBusInfo(PhysicalDevicePciBusInfo::InvalidValue, PhysicalDevicePciBusInfo::InvalidValue, PhysicalDevicePciBusInfo::InvalidValue, PhysicalDevicePciBusInfo::InvalidValue));
DriverInfoWindows driverInfo(deviceRegistryPath, PhysicalDevicePciBusInfo(PhysicalDevicePciBusInfo::invalidValue, PhysicalDevicePciBusInfo::invalidValue, PhysicalDevicePciBusInfo::invalidValue, PhysicalDevicePciBusInfo::invalidValue));
return driverInfo.isCompatibleDriverStore();
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020-2021 Intel Corporation
* Copyright (C) 2020-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -22,7 +22,7 @@ bool isCompatibleDriverStore(std::string &&deviceRegistryPath);
class DriverInfoWindows : public DriverInfo {
public:
DriverInfoWindows(const std::string &path, const PhysicalDevicePciBusInfo &pciBusInfo);
~DriverInfoWindows();
~DriverInfoWindows() override;
std::string getDeviceName(std::string defaultName) override;
std::string getVersion(std::string defaultVersion) override;
bool isCompatibleDriverStore() const;

View File

@@ -421,32 +421,32 @@ bool Wddm::mapGpuVirtualAddress(AllocationStorageData *allocationStorageData) {
}
bool Wddm::mapGpuVirtualAddress(Gmm *gmm, D3DKMT_HANDLE handle, D3DGPU_VIRTUAL_ADDRESS minimumAddress, D3DGPU_VIRTUAL_ADDRESS maximumAddress, D3DGPU_VIRTUAL_ADDRESS preferredAddress, D3DGPU_VIRTUAL_ADDRESS &gpuPtr) {
D3DDDI_MAPGPUVIRTUALADDRESS MapGPUVA = {};
D3DDDI_MAPGPUVIRTUALADDRESS mapGPUVA = {};
D3DDDIGPUVIRTUALADDRESS_PROTECTION_TYPE protectionType = {};
protectionType.Write = TRUE;
uint64_t size = gmm->gmmResourceInfo->getSizeAllocation();
MapGPUVA.hPagingQueue = pagingQueue;
MapGPUVA.hAllocation = handle;
MapGPUVA.Protection = protectionType;
mapGPUVA.hPagingQueue = pagingQueue;
mapGPUVA.hAllocation = handle;
mapGPUVA.Protection = protectionType;
MapGPUVA.SizeInPages = size / MemoryConstants::pageSize;
MapGPUVA.OffsetInPages = 0;
mapGPUVA.SizeInPages = size / MemoryConstants::pageSize;
mapGPUVA.OffsetInPages = 0;
MapGPUVA.BaseAddress = preferredAddress;
MapGPUVA.MinimumAddress = minimumAddress;
MapGPUVA.MaximumAddress = maximumAddress;
mapGPUVA.BaseAddress = preferredAddress;
mapGPUVA.MinimumAddress = minimumAddress;
mapGPUVA.MaximumAddress = maximumAddress;
applyAdditionalMapGPUVAFields(MapGPUVA, gmm);
applyAdditionalMapGPUVAFields(mapGPUVA, gmm);
NTSTATUS status = getGdi()->mapGpuVirtualAddress(&MapGPUVA);
NTSTATUS status = getGdi()->mapGpuVirtualAddress(&mapGPUVA);
auto gmmHelper = rootDeviceEnvironment.getGmmHelper();
gpuPtr = gmmHelper->canonize(MapGPUVA.VirtualAddress);
gpuPtr = gmmHelper->canonize(mapGPUVA.VirtualAddress);
if (status == STATUS_PENDING) {
updatePagingFenceValue(MapGPUVA.PagingFenceValue);
updatePagingFenceValue(mapGPUVA.PagingFenceValue);
status = STATUS_SUCCESS;
}
@@ -455,7 +455,7 @@ bool Wddm::mapGpuVirtualAddress(Gmm *gmm, D3DKMT_HANDLE handle, D3DGPU_VIRTUAL_A
return false;
}
kmDafListener->notifyMapGpuVA(featureTable->flags.ftrKmdDaf, getAdapter(), device, handle, MapGPUVA.VirtualAddress, getGdi()->escape);
kmDafListener->notifyMapGpuVA(featureTable->flags.ftrKmdDaf, getAdapter(), device, handle, mapGPUVA.VirtualAddress, getGdi()->escape);
bool ret = true;
if (gmm->isCompressionEnabled && HwInfoConfig::get(gfxPlatform->eProductFamily)->isPageTableManagerSupported(*rootDeviceEnvironment.getHardwareInfo())) {
for (auto engine : rootDeviceEnvironment.executionEnvironment.memoryManager->getRegisteredEngines()) {
@@ -1102,7 +1102,7 @@ void Wddm::createPagingFenceLogger() {
PhysicalDevicePciBusInfo Wddm::getPciBusInfo() const {
if (adapterBDF.Data == std::numeric_limits<uint32_t>::max()) {
return PhysicalDevicePciBusInfo(PhysicalDevicePciBusInfo::InvalidValue, PhysicalDevicePciBusInfo::InvalidValue, PhysicalDevicePciBusInfo::InvalidValue, PhysicalDevicePciBusInfo::InvalidValue);
return PhysicalDevicePciBusInfo(PhysicalDevicePciBusInfo::invalidValue, PhysicalDevicePciBusInfo::invalidValue, PhysicalDevicePciBusInfo::invalidValue, PhysicalDevicePciBusInfo::invalidValue);
}
return PhysicalDevicePciBusInfo(0, adapterBDF.Bus, adapterBDF.Device, adapterBDF.Function);
}

View File

@@ -65,7 +65,7 @@ class Wddm : public DriverModel {
typedef HRESULT(WINAPI *DXCoreCreateAdapterFactoryFcn)(REFIID riid, void **ppFactory);
typedef void(WINAPI *GetSystemInfoFcn)(SYSTEM_INFO *pSystemInfo);
virtual ~Wddm();
~Wddm() override;
static Wddm *createWddm(std::unique_ptr<HwDeviceIdWddm> &&hwDeviceId, RootDeviceEnvironment &rootDeviceEnvironment);
bool init();
@@ -77,7 +77,7 @@ class Wddm : public DriverModel {
MOCKABLE_VIRTUAL D3DGPU_VIRTUAL_ADDRESS reserveGpuVirtualAddress(D3DGPU_VIRTUAL_ADDRESS minimumAddress, D3DGPU_VIRTUAL_ADDRESS maximumAddress, D3DGPU_SIZE_T size);
MOCKABLE_VIRTUAL bool createContext(OsContextWin &osContext);
MOCKABLE_VIRTUAL void applyAdditionalContextFlags(CREATECONTEXT_PVTDATA &privateData, OsContextWin &osContext, const HardwareInfo &hwInfo);
MOCKABLE_VIRTUAL void applyAdditionalMapGPUVAFields(D3DDDI_MAPGPUVIRTUALADDRESS &MapGPUVA, Gmm *gmm);
MOCKABLE_VIRTUAL void applyAdditionalMapGPUVAFields(D3DDDI_MAPGPUVIRTUALADDRESS &mapGPUVA, Gmm *gmm);
MOCKABLE_VIRTUAL bool freeGpuVirtualAddress(D3DGPU_VIRTUAL_ADDRESS &gpuPtr, uint64_t size);
MOCKABLE_VIRTUAL NTSTATUS createAllocation(const void *alignedCpuPtr, const Gmm *gmm, D3DKMT_HANDLE &outHandle, D3DKMT_HANDLE &outResourceHandle, uint64_t *outSharedHandle);
MOCKABLE_VIRTUAL bool createAllocation(const Gmm *gmm, D3DKMT_HANDLE &outHandle);

View File

@@ -23,7 +23,7 @@ class WddmCommandStreamReceiver : public DeviceCommandStreamReceiver<GfxFamily>
public:
WddmCommandStreamReceiver(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex, const DeviceBitfield deviceBitfield);
virtual ~WddmCommandStreamReceiver();
~WddmCommandStreamReceiver() override;
SubmissionStatus flush(BatchBuffer &batchBuffer, ResidencyContainer &allocationsForResidency) override;
void processResidency(const ResidencyContainer &allocationsForResidency, uint32_t handleId) override;