Revert "Remove not needed hwHelper"
This reverts commit 0d11b51c6b
.
Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
This commit is contained in:
parent
82a5472422
commit
0845a3b34b
|
@ -351,9 +351,18 @@ TEST_F(GmmTests, givenNonZeroRowPitchWhenQueryImgFromBufferParamsThenUseUserValu
|
|||
EXPECT_EQ(imgInfo.rowPitch, expectedRowPitch);
|
||||
}
|
||||
|
||||
using GmmCanonizeTests = GmmTests;
|
||||
struct GmmTestsCanonize : public GmmTests {
|
||||
void SetUp() override {
|
||||
uint32_t addressWidth = 48u;
|
||||
HwHelper::get(renderCoreFamily).adjustAddressWidthForCanonize(addressWidth);
|
||||
if (addressWidth != 48u) {
|
||||
GTEST_SKIP();
|
||||
}
|
||||
GmmTests::SetUp();
|
||||
}
|
||||
};
|
||||
|
||||
TEST_F(GmmCanonizeTests, WhenCanonizingThenCorrectAddressIsReturned) {
|
||||
TEST_F(GmmTestsCanonize, WhenCanonizingThenCorrectAddressIsReturned) {
|
||||
auto hwInfo = *defaultHwInfo;
|
||||
|
||||
// 48 bit - canonize to 48 bit
|
||||
|
@ -376,7 +385,7 @@ TEST_F(GmmCanonizeTests, WhenCanonizingThenCorrectAddressIsReturned) {
|
|||
EXPECT_EQ(GmmHelper::canonize(testAddr2), goodAddr2);
|
||||
}
|
||||
|
||||
TEST_F(GmmCanonizeTests, WhenDecanonizingThenCorrectAddressIsReturned) {
|
||||
TEST_F(GmmTestsCanonize, WhenDecanonizingThenCorrectAddressIsReturned) {
|
||||
auto hwInfo = *defaultHwInfo;
|
||||
|
||||
// 48 bit - decanonize to 48 bit
|
||||
|
|
|
@ -1158,6 +1158,14 @@ HWTEST_F(HwHelperTest, givenHwHelperWhenAskingForIsaSystemMemoryPlacementThenRet
|
|||
EXPECT_NE(localMemoryEnabled, hwHelper.useSystemMemoryPlacementForISA(hardwareInfo));
|
||||
}
|
||||
|
||||
HWTEST_F(HwHelperTest, givenHwHelperWhenAdjustAddressWidthForCanonizeThenAddressWidthDoesntChange) {
|
||||
HwHelper &hwHelper = HwHelper::get(hardwareInfo.platform.eRenderCoreFamily);
|
||||
uint32_t addressWidth = 48;
|
||||
|
||||
hwHelper.adjustAddressWidthForCanonize(addressWidth);
|
||||
EXPECT_EQ(48u, addressWidth);
|
||||
}
|
||||
|
||||
TEST_F(HwHelperTest, givenInvalidEngineTypeWhenGettingEngineGroupTypeThenThrow) {
|
||||
HwHelper &hwHelper = HwHelper::get(hardwareInfo.platform.eRenderCoreFamily);
|
||||
EXPECT_ANY_THROW(hwHelper.getEngineGroupType(aub_stream::EngineType::NUM_ENGINES, hardwareInfo));
|
||||
|
|
|
@ -37,6 +37,7 @@ uint32_t GmmHelper::getMOCS(uint32_t type) const {
|
|||
|
||||
GmmHelper::GmmHelper(OSInterface *osInterface, const HardwareInfo *pHwInfo) : hwInfo(pHwInfo) {
|
||||
auto hwInfoAddressWidth = Math::log2(hwInfo->capabilityTable.gpuAddressSpace + 1);
|
||||
HwHelper::get(hwInfo->platform.eRenderCoreFamily).adjustAddressWidthForCanonize(hwInfoAddressWidth);
|
||||
GmmHelper::addressWidth = std::max(hwInfoAddressWidth, static_cast<uint32_t>(48));
|
||||
|
||||
gmmClientContext = GmmHelper::createGmmContextWrapperFunc(osInterface, const_cast<HardwareInfo *>(pHwInfo));
|
||||
|
|
|
@ -132,6 +132,7 @@ class HwHelper {
|
|||
virtual bool isCooperativeDispatchSupported(const EngineGroupType engineGroupType, const PRODUCT_FAMILY productFamily) const = 0;
|
||||
virtual size_t getMaxFillPaternSizeForCopyEngine() const = 0;
|
||||
virtual bool isCopyOnlyEngineType(EngineGroupType type) const = 0;
|
||||
virtual void adjustAddressWidthForCanonize(uint32_t &addressWidth) const = 0;
|
||||
virtual bool isSipWANeeded(const HardwareInfo &hwInfo) const = 0;
|
||||
virtual bool isDisableOverdispatchAvailable(const HardwareInfo &hwInfo) const = 0;
|
||||
virtual bool isCpuImageTransferPreferred(const HardwareInfo &hwInfo) const = 0;
|
||||
|
@ -354,6 +355,8 @@ class HwHelperHw : public HwHelper {
|
|||
|
||||
bool isCopyOnlyEngineType(EngineGroupType type) const override;
|
||||
|
||||
void adjustAddressWidthForCanonize(uint32_t &addressWidth) const override;
|
||||
|
||||
bool isSipWANeeded(const HardwareInfo &hwInfo) const override;
|
||||
|
||||
bool isDisableOverdispatchAvailable(const HardwareInfo &hwInfo) const override;
|
||||
|
|
|
@ -621,6 +621,10 @@ bool HwHelperHw<GfxFamily>::isCopyOnlyEngineType(EngineGroupType type) const {
|
|||
return NEO::EngineGroupType::Copy == type;
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
void HwHelperHw<GfxFamily>::adjustAddressWidthForCanonize(uint32_t &addressWidth) const {
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
bool HwHelperHw<GfxFamily>::isSipWANeeded(const HardwareInfo &hwInfo) const {
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue