Refactor: don't pass redundant hw info to applyAdditionalContextFlags

Wddm already contains reference to root device environment

Related-To: NEO-6853
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski 2023-01-02 08:41:11 +00:00 committed by Compute-Runtime-Automation
parent 30f0b1d9eb
commit 28319a8e81
9 changed files with 22 additions and 23 deletions

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2018-2022 Intel Corporation * Copyright (C) 2018-2023 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@ -918,8 +918,7 @@ bool Wddm::createContext(OsContextWin &osContext) {
privateData.pHwContextId = &hwContextId; privateData.pHwContextId = &hwContextId;
privateData.NoRingFlushes = DebugManager.flags.UseNoRingFlushesKmdMode.get(); privateData.NoRingFlushes = DebugManager.flags.UseNoRingFlushesKmdMode.get();
auto &rootDeviceEnvironment = this->getRootDeviceEnvironment(); applyAdditionalContextFlags(privateData, osContext);
applyAdditionalContextFlags(privateData, osContext, *rootDeviceEnvironment.getHardwareInfo());
createContext.EngineAffinity = 0; createContext.EngineAffinity = 0;
createContext.Flags.NullRendering = static_cast<UINT>(DebugManager.flags.EnableNullHardware.get()); createContext.Flags.NullRendering = static_cast<UINT>(DebugManager.flags.EnableNullHardware.get());

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2018-2022 Intel Corporation * Copyright (C) 2018-2023 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@ -66,7 +66,7 @@ class Wddm : public DriverModel {
bool mapGpuVirtualAddress(AllocationStorageData *allocationStorageData); bool mapGpuVirtualAddress(AllocationStorageData *allocationStorageData);
MOCKABLE_VIRTUAL D3DGPU_VIRTUAL_ADDRESS reserveGpuVirtualAddress(D3DGPU_VIRTUAL_ADDRESS baseAddress, D3DGPU_VIRTUAL_ADDRESS minimumAddress, D3DGPU_VIRTUAL_ADDRESS maximumAddress, D3DGPU_SIZE_T size); MOCKABLE_VIRTUAL D3DGPU_VIRTUAL_ADDRESS reserveGpuVirtualAddress(D3DGPU_VIRTUAL_ADDRESS baseAddress, D3DGPU_VIRTUAL_ADDRESS minimumAddress, D3DGPU_VIRTUAL_ADDRESS maximumAddress, D3DGPU_SIZE_T size);
MOCKABLE_VIRTUAL bool createContext(OsContextWin &osContext); MOCKABLE_VIRTUAL bool createContext(OsContextWin &osContext);
MOCKABLE_VIRTUAL void applyAdditionalContextFlags(CREATECONTEXT_PVTDATA &privateData, OsContextWin &osContext, const HardwareInfo &hwInfo); MOCKABLE_VIRTUAL void applyAdditionalContextFlags(CREATECONTEXT_PVTDATA &privateData, OsContextWin &osContext);
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 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 NTSTATUS createAllocation(const void *alignedCpuPtr, const Gmm *gmm, D3DKMT_HANDLE &outHandle, D3DKMT_HANDLE &outResourceHandle, uint64_t *outSharedHandle);

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2020-2021 Intel Corporation * Copyright (C) 2020-2023 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@ -8,7 +8,7 @@
#include "shared/source/os_interface/windows/wddm/wddm.h" #include "shared/source/os_interface/windows/wddm/wddm.h"
namespace NEO { namespace NEO {
void Wddm::applyAdditionalContextFlags(CREATECONTEXT_PVTDATA &privateData, OsContextWin &osContext, const HardwareInfo &hwInfo) { void Wddm::applyAdditionalContextFlags(CREATECONTEXT_PVTDATA &privateData, OsContextWin &osContext) {
} }
} // namespace NEO } // namespace NEO

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2018-2022 Intel Corporation * Copyright (C) 2018-2023 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@ -170,9 +170,9 @@ bool WddmMock::createContext(OsContextWin &osContext) {
return createContextResult.success = Wddm::createContext(osContext); return createContextResult.success = Wddm::createContext(osContext);
} }
void WddmMock::applyAdditionalContextFlags(CREATECONTEXT_PVTDATA &privateData, OsContextWin &osContext, const HardwareInfo &hwInfo) { void WddmMock::applyAdditionalContextFlags(CREATECONTEXT_PVTDATA &privateData, OsContextWin &osContext) {
applyAdditionalContextFlagsResult.called++; applyAdditionalContextFlagsResult.called++;
Wddm::applyAdditionalContextFlags(privateData, osContext, hwInfo); Wddm::applyAdditionalContextFlags(privateData, osContext);
} }
bool WddmMock::destroyContext(D3DKMT_HANDLE context) { bool WddmMock::destroyContext(D3DKMT_HANDLE context) {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2018-2022 Intel Corporation * Copyright (C) 2018-2023 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@ -71,7 +71,7 @@ class WddmMock : public Wddm {
bool destroyAllocation(WddmAllocation *alloc, OsContextWin *osContext); bool destroyAllocation(WddmAllocation *alloc, OsContextWin *osContext);
bool openSharedHandle(D3DKMT_HANDLE handle, WddmAllocation *alloc) override; bool openSharedHandle(D3DKMT_HANDLE handle, WddmAllocation *alloc) override;
bool createContext(OsContextWin &osContext) override; bool createContext(OsContextWin &osContext) override;
void applyAdditionalContextFlags(CREATECONTEXT_PVTDATA &privateData, OsContextWin &osContext, const HardwareInfo &hwInfo) override; void applyAdditionalContextFlags(CREATECONTEXT_PVTDATA &privateData, OsContextWin &osContext) override;
bool destroyContext(D3DKMT_HANDLE context) override; bool destroyContext(D3DKMT_HANDLE context) override;
bool queryAdapterInfo() override; bool queryAdapterInfo() override;
bool submit(uint64_t commandBuffer, size_t size, void *commandHeader, WddmSubmitArguments &submitArguments) override; bool submit(uint64_t commandBuffer, size_t size, void *commandHeader, WddmSubmitArguments &submitArguments) override;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2022 Intel Corporation * Copyright (C) 2022-2023 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@ -30,7 +30,7 @@ Wddm::CreateDXGIFactoryFcn getCreateDxgiFactory() {
} }
Wddm::DXCoreCreateAdapterFactoryFcn getDXCoreCreateAdapterFactory() { Wddm::DXCoreCreateAdapterFactoryFcn getDXCoreCreateAdapterFactory() {
return ULTDXCoreCreateAdapterFactory; return ultDxCoreCreateAdapterFactory;
} }
Wddm::GetSystemInfoFcn getGetSystemInfo() { Wddm::GetSystemInfoFcn getGetSystemInfo() {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2021-2022 Intel Corporation * Copyright (C) 2021-2023 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@ -11,12 +11,12 @@
namespace NEO { namespace NEO {
HRESULT WINAPI ULTDXCoreCreateAdapterFactory(REFIID riid, void **ppFactory) { HRESULT WINAPI ultDxCoreCreateAdapterFactory(REFIID riid, void **ppFactory) {
*reinterpret_cast<UltDXCoreAdapterFactory **>(ppFactory) = new UltDXCoreAdapterFactory; *reinterpret_cast<UltDXCoreAdapterFactory **>(ppFactory) = new UltDXCoreAdapterFactory;
return S_OK; return S_OK;
} }
void WINAPI ULTGetSystemInfo(SYSTEM_INFO *pSystemInfo) { void WINAPI ultGetSystemInfo(SYSTEM_INFO *pSystemInfo) {
#ifdef _WIN32 #ifdef _WIN32
pSystemInfo->lpMaximumApplicationAddress = is32bit ? (LPVOID)MemoryConstants::max32BitAppAddress : (LPVOID)MemoryConstants::max64BitAppAddress; pSystemInfo->lpMaximumApplicationAddress = is32bit ? (LPVOID)MemoryConstants::max32BitAppAddress : (LPVOID)MemoryConstants::max64BitAppAddress;
#endif #endif

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2021-2022 Intel Corporation * Copyright (C) 2021-2023 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@ -284,7 +284,7 @@ class UltDXCoreAdapterFactory : public IDXCoreAdapterFactory {
} }
}; };
HRESULT WINAPI ULTDXCoreCreateAdapterFactory(REFIID riid, void **ppFactory); HRESULT WINAPI ultDxCoreCreateAdapterFactory(REFIID riid, void **ppFactory);
void WINAPI ULTGetSystemInfo(SYSTEM_INFO *pSystemInfo); void WINAPI ultGetSystemInfo(SYSTEM_INFO *pSystemInfo);
} // namespace NEO } // namespace NEO

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2018-2021 Intel Corporation * Copyright (C) 2018-2023 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@ -16,10 +16,10 @@ Wddm::CreateDXGIFactoryFcn getCreateDxgiFactory() {
} }
Wddm::DXCoreCreateAdapterFactoryFcn getDXCoreCreateAdapterFactory() { Wddm::DXCoreCreateAdapterFactoryFcn getDXCoreCreateAdapterFactory() {
return ULTDXCoreCreateAdapterFactory; return ultDxCoreCreateAdapterFactory;
} }
Wddm::GetSystemInfoFcn getGetSystemInfo() { Wddm::GetSystemInfoFcn getGetSystemInfo() {
return ULTGetSystemInfo; return ultGetSystemInfo;
} }
} // namespace NEO } // namespace NEO