Skip to content

Commit 22c25a2

Browse files
Extra checks for gen12lp
Signed-off-by: Sebastian Luzynski <[email protected]>
1 parent e4eb6d4 commit 22c25a2

File tree

11 files changed

+33
-10
lines changed

11 files changed

+33
-10
lines changed

opencl/test/unit_test/gen12lp/hw_helper_tests_gen12lp.inl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2019-2020 Intel Corporation
2+
* Copyright (C) 2019-2021 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*

opencl/test/unit_test/helpers/hw_helper_tests.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1191,3 +1191,11 @@ TEST_F(HwHelperTest, WhenGettingIsCpuImageTransferPreferredThenFalseIsReturned)
11911191
auto &hwHelper = HwHelper::get(renderCoreFamily);
11921192
EXPECT_FALSE(hwHelper.isCpuImageTransferPreferred(*defaultHwInfo));
11931193
}
1194+
1195+
TEST_F(HwHelperTest, whenFtrGpGpuMidThreadLevelPreemptFeatureDisabledThenFalseIsReturned) {
1196+
HwHelper &hwHelper = HwHelper::get(renderCoreFamily);
1197+
FeatureTable featureTable = {};
1198+
featureTable.ftrGpGpuMidThreadLevelPreempt = false;
1199+
bool result = hwHelper.isAdditionalFeatureFlagRequired(&featureTable);
1200+
EXPECT_FALSE(result);
1201+
}

opencl/test/unit_test/mocks/mock_wddm.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2018-2020 Intel Corporation
2+
* Copyright (C) 2018-2021 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -153,9 +153,9 @@ bool WddmMock::createContext(OsContextWin &osContext) {
153153
return createContextResult.success = Wddm::createContext(osContext);
154154
}
155155

156-
void WddmMock::applyAdditionalContextFlags(CREATECONTEXT_PVTDATA &privateData, OsContextWin &osContext) {
156+
void WddmMock::applyAdditionalContextFlags(CREATECONTEXT_PVTDATA &privateData, OsContextWin &osContext, const HardwareInfo &hwInfo) {
157157
applyAdditionalContextFlagsResult.called++;
158-
Wddm::applyAdditionalContextFlags(privateData, osContext);
158+
Wddm::applyAdditionalContextFlags(privateData, osContext, hwInfo);
159159
}
160160

161161
bool WddmMock::destroyContext(D3DKMT_HANDLE context) {

opencl/test/unit_test/mocks/mock_wddm.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#pragma once
99

1010
#include "shared/source/helpers/constants.h"
11+
#include "shared/source/helpers/hw_info.h"
1112
#include "shared/source/memory_manager/host_ptr_defines.h"
1213
#include "shared/source/os_interface/windows/wddm/wddm.h"
1314
#include "shared/source/os_interface/windows/wddm_residency_allocations_container.h"
@@ -65,7 +66,7 @@ class WddmMock : public Wddm {
6566
bool destroyAllocation(WddmAllocation *alloc, OsContextWin *osContext);
6667
bool openSharedHandle(D3DKMT_HANDLE handle, WddmAllocation *alloc) override;
6768
bool createContext(OsContextWin &osContext) override;
68-
void applyAdditionalContextFlags(CREATECONTEXT_PVTDATA &privateData, OsContextWin &osContext) override;
69+
void applyAdditionalContextFlags(CREATECONTEXT_PVTDATA &privateData, OsContextWin &osContext, const HardwareInfo &hwInfo) override;
6970
bool destroyContext(D3DKMT_HANDLE context) override;
7071
bool queryAdapterInfo() override;
7172
bool submit(uint64_t commandBuffer, size_t size, void *commandHeader, WddmSubmitArguments &submitArguments) override;

shared/source/gen12lp/helpers_gen12lp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2019-2020 Intel Corporation
2+
* Copyright (C) 2019-2021 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*

shared/source/gen12lp/hw_helper_gen12lp.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ bool HwHelperHw<Family>::isWaDisableRccRhwoOptimizationRequired() const {
5151
return true;
5252
}
5353

54+
template <>
55+
bool HwHelperHw<Family>::isAdditionalFeatureFlagRequired(const FeatureTable *featureTable) const {
56+
return featureTable->ftrGpGpuMidThreadLevelPreempt;
57+
}
58+
5459
template <>
5560
uint32_t HwHelperHw<Family>::getComputeUnitsUsedForScratch(const HardwareInfo *pHwInfo) const {
5661
/* For ICL+ maxThreadCount equals (EUCount * 8).

shared/source/helpers/hw_helper.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ class HwHelper {
102102

103103
virtual bool isForceEmuInt32DivRemSPWARequired(const HardwareInfo &hwInfo) = 0;
104104
virtual bool isWaDisableRccRhwoOptimizationRequired() const = 0;
105+
virtual bool isAdditionalFeatureFlagRequired(const FeatureTable *featureTable) const = 0;
105106
virtual uint32_t getMinimalSIMDSize() = 0;
106107
virtual uint32_t getHwRevIdFromStepping(uint32_t stepping, const HardwareInfo &hwInfo) const = 0;
107108
virtual uint32_t getSteppingFromHwRevId(uint32_t hwRevId, const HardwareInfo &hwInfo) const = 0;
@@ -281,6 +282,8 @@ class HwHelperHw : public HwHelper {
281282

282283
bool isWaDisableRccRhwoOptimizationRequired() const override;
283284

285+
bool isAdditionalFeatureFlagRequired(const FeatureTable *featureTable) const override;
286+
284287
uint32_t getMinimalSIMDSize() override;
285288

286289
uint64_t getGpuTimeStampInNS(uint64_t timeStamp, double frequency) const override;

shared/source/helpers/hw_helper_base.inl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -529,4 +529,9 @@ bool HwHelperHw<GfxFamily>::isSipWANeeded(const HardwareInfo &hwInfo) const {
529529
return false;
530530
}
531531

532+
template <typename GfxFamily>
533+
bool HwHelperHw<GfxFamily>::isAdditionalFeatureFlagRequired(const FeatureTable *featureTable) const {
534+
return false;
535+
}
536+
532537
} // namespace NEO

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,8 @@ bool Wddm::createContext(OsContextWin &osContext) {
763763
PrivateData.pHwContextId = &hwContextId;
764764
PrivateData.IsMediaUsage = false;
765765
PrivateData.NoRingFlushes = DebugManager.flags.UseNoRingFlushesKmdMode.get();
766-
applyAdditionalContextFlags(PrivateData, osContext);
766+
auto &rootDeviceEnvironment = this->getRootDeviceEnvironment();
767+
applyAdditionalContextFlags(PrivateData, osContext, *rootDeviceEnvironment.getHardwareInfo());
767768

768769
CreateContext.EngineAffinity = 0;
769770
CreateContext.Flags.NullRendering = static_cast<UINT>(DebugManager.flags.EnableNullHardware.get());

shared/source/os_interface/windows/wddm/wddm.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class Wddm {
6060
bool mapGpuVirtualAddress(AllocationStorageData *allocationStorageData);
6161
MOCKABLE_VIRTUAL D3DGPU_VIRTUAL_ADDRESS reserveGpuVirtualAddress(D3DGPU_VIRTUAL_ADDRESS minimumAddress, D3DGPU_VIRTUAL_ADDRESS maximumAddress, D3DGPU_SIZE_T size);
6262
MOCKABLE_VIRTUAL bool createContext(OsContextWin &osContext);
63-
MOCKABLE_VIRTUAL void applyAdditionalContextFlags(CREATECONTEXT_PVTDATA &privateData, OsContextWin &osContext);
63+
MOCKABLE_VIRTUAL void applyAdditionalContextFlags(CREATECONTEXT_PVTDATA &privateData, OsContextWin &osContext, const HardwareInfo &hwInfo);
6464
MOCKABLE_VIRTUAL bool freeGpuVirtualAddress(D3DGPU_VIRTUAL_ADDRESS &gpuPtr, uint64_t size);
6565
MOCKABLE_VIRTUAL NTSTATUS createAllocation(const void *alignedCpuPtr, const Gmm *gmm, D3DKMT_HANDLE &outHandle, D3DKMT_HANDLE &outResourceHandle, D3DKMT_HANDLE *outSharedHandle);
6666
MOCKABLE_VIRTUAL bool createAllocation64k(const Gmm *gmm, D3DKMT_HANDLE &outHandle);

0 commit comments

Comments
 (0)