fix: do not prefer image compression on xe_lpg for linux and WSL

Related-To: HSD-18034872015
Signed-off-by: Jaroslaw Warchulski <jaroslaw.warchulski@intel.com>
This commit is contained in:
Jaroslaw Warchulski
2025-02-28 11:39:26 +00:00
committed by Compute-Runtime-Automation
parent 726d1b6dbb
commit 8814b6ac4f
16 changed files with 110 additions and 28 deletions

View File

@@ -184,6 +184,7 @@ DECLARE_DEBUG_VARIABLE(int32_t, EnableMultiTileCompression, -1, "-1: default, 0:
DECLARE_DEBUG_VARIABLE(int32_t, OverrideGmmResourceUsageField, -1, "-1: default, >=0: gmm.resourceParams.Usage is set to this value")
DECLARE_DEBUG_VARIABLE(int32_t, OverrideGmmCacheableField, -1, "-1: default, >=0: gmm Flags.Info.Cacheable is set to this value")
DECLARE_DEBUG_VARIABLE(int32_t, OverrideBufferSuitableForRenderCompression, -1, "-1: default, 0: Disable, 1: Enable")
DECLARE_DEBUG_VARIABLE(int32_t, OverrideImageSuitableForRenderCompression, -1, "-1: default, 0: Disable, 1: Enable")
DECLARE_DEBUG_VARIABLE(int32_t, OverrideL1CacheControlInSurfaceState, -1, "-1: feature inactive, >=0 : following L1 cache control value will be programmed in render surface state (for regular buffers)")
DECLARE_DEBUG_VARIABLE(int32_t, OverrideL1CacheControlInSurfaceStateForScratchSpace, -1, "-1: feature inactive, >=0 : following L1 cache control value will be programmed in render surface state for scratch space")
DECLARE_DEBUG_VARIABLE(int32_t, OverridePreferredSlmAllocationSizePerDss, -1, "-1: default, >=0: program value for preferred SLM allocation size per dss")

View File

@@ -258,6 +258,7 @@ class ProductHelper {
virtual uint32_t getNumCacheRegions() const = 0;
virtual uint64_t getPatIndex(CacheRegion cacheRegion, CachePolicy cachePolicy) const = 0;
virtual bool isSharingWith3dOrMediaAllowed() const = 0;
virtual bool isImageSuitableForCompression() const = 0;
virtual ~ProductHelper() = default;

View File

@@ -1005,4 +1005,12 @@ bool ProductHelperHw<gfxProduct>::isEvictionIfNecessaryFlagSupported() const {
return true;
}
template <PRODUCT_FAMILY gfxProduct>
bool ProductHelperHw<gfxProduct>::isImageSuitableForCompression() const {
if (debugManager.flags.OverrideImageSuitableForRenderCompression.get() != -1) {
return !!debugManager.flags.OverrideImageSuitableForRenderCompression.get();
}
return true;
}
} // namespace NEO

View File

@@ -199,6 +199,7 @@ class ProductHelperHw : public ProductHelper {
uint32_t getNumCacheRegions() const override;
uint64_t getPatIndex(CacheRegion cacheRegion, CachePolicy cachePolicy) const override;
bool isSharingWith3dOrMediaAllowed() const override;
bool isImageSuitableForCompression() const override;
~ProductHelperHw() override = default;

View File

@@ -5,6 +5,7 @@
*
*/
#include "shared/source/debug_settings/debug_settings_manager.h"
#include "shared/source/helpers/hw_info.h"
#include "shared/source/memory_manager/allocation_type.h"
#include "shared/source/os_interface/linux/product_helper_mtl_and_later.inl"
@@ -13,6 +14,8 @@
namespace NEO {
template <>
int ProductHelperHw<gfxProduct>::configureHardwareCustom(HardwareInfo *hwInfo, OSInterface *osIface) const {
enableCompression(hwInfo);
enableBlitterOperationsSupport(hwInfo);
auto &kmdNotifyProperties = hwInfo->capabilityTable.kmdNotifyProperties;
@@ -49,4 +52,12 @@ bool ProductHelperHw<gfxProduct>::useGemCreateExtInAllocateMemoryByKMD() const {
return true;
}
template <>
bool ProductHelperHw<gfxProduct>::isImageSuitableForCompression() const {
if (debugManager.flags.OverrideImageSuitableForRenderCompression.get() != -1) {
return !!debugManager.flags.OverrideImageSuitableForRenderCompression.get();
}
return false;
}
} // namespace NEO

View File

@@ -390,6 +390,7 @@ ProgramWalkerPartitionSelfCleanup = -1
WparidRegisterProgramming = -1
UsePipeControlAfterPartitionedWalker = -1
OverrideBufferSuitableForRenderCompression = -1
OverrideImageSuitableForRenderCompression = -1
AllowPatchingVfeStateInCommandLists = 0
PrintMemoryRegionSizes = 0
OverrideDrmRegion = -1

View File

@@ -1143,3 +1143,17 @@ HWTEST2_F(ProductHelperTest, WhenCheckAssignEngineRoundRobinSupportedThenReturnF
auto hwInfo = *defaultHwInfo;
EXPECT_EQ(0u, productHelper->getMaxLocalSubRegionSize(hwInfo));
}
HWTEST2_F(ProductHelperTest, givenProductHelperWhenAskedIsImageSuitableForCompressionThenReturnTrue, IsNotXeHpgCore) {
EXPECT_TRUE(productHelper->isImageSuitableForCompression());
}
HWTEST_F(ProductHelperTest, givenDebugFlagWhenCheckingIfImageIsSuitableForCompressionThenReturnCorrectValue) {
DebugManagerStateRestore restore;
debugManager.flags.OverrideImageSuitableForRenderCompression.set(0);
EXPECT_FALSE(productHelper->isImageSuitableForCompression());
debugManager.flags.OverrideImageSuitableForRenderCompression.set(1);
EXPECT_TRUE(productHelper->isImageSuitableForCompression());
}

View File

@@ -100,12 +100,6 @@ ARLTEST_F(ArlProductHelperLinux, givenBooleanUncachedWhenCallOverridePatIndexThe
EXPECT_EQ(3u, productHelper->overridePatIndex(isUncached, patIndex, AllocationType::commandBuffer));
}
ARLTEST_F(ArlProductHelperLinux, givenProductHelperWhenCallConfigureHardwareCustomThenCompressionIsDisabled) {
auto hwInfo = *defaultHwInfo;
hwInfo.featureTable.flags.ftrE2ECompression = true;
productHelper->configureHardwareCustom(&hwInfo, nullptr);
EXPECT_FALSE(hwInfo.capabilityTable.ftrRenderCompressedBuffers);
EXPECT_FALSE(hwInfo.capabilityTable.ftrRenderCompressedImages);
ARLTEST_F(ArlProductHelperLinux, givenProductHelperWhenAskedIsImageSuitableForCompressionThenReturnFalse) {
EXPECT_FALSE(productHelper->isImageSuitableForCompression());
}

View File

@@ -0,0 +1,9 @@
#
# Copyright (C) 2025 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
if(WIN32)
target_sources(neo_shared_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/product_helper_tests_arl_windows.cpp)
endif()

View File

@@ -0,0 +1,18 @@
/*
* Copyright (C) 2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/xe_hpg_core/hw_info_xe_hpg_core.h"
#include "shared/test/common/test_macros/header/per_product_test_definitions.h"
#include "shared/test/unit_test/os_interface/windows/product_helper_win_tests.h"
using namespace NEO;
using ArlProductHelperWindows = ProductHelperTestWindows;
ARLTEST_F(ArlProductHelperWindows, givenProductHelperWhenAskedIsImageSuitableForCompressionThenReturnTrue) {
EXPECT_TRUE(productHelper->isImageSuitableForCompression());
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022-2024 Intel Corporation
* Copyright (C) 2022-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -845,3 +845,7 @@ DG2TEST_F(ProductHelperTestDg2, givenProductHelperWhenGettingEvictIfNecessaryFla
DG2TEST_F(ProductHelperTestDg2, givenProductHelperWhenGettingUseLocalPreferredForCacheableBuffersThenExpectTrue) {
EXPECT_TRUE(productHelper->useLocalPreferredForCacheableBuffers());
}
DG2TEST_F(ProductHelperTestDg2, givenProductHelperWhenAskedIsImageSuitableForCompressionThenReturnTrue) {
EXPECT_TRUE(productHelper->isImageSuitableForCompression());
}

View File

@@ -74,12 +74,6 @@ MTLTEST_F(MtlProductHelperLinux, givenBooleanUncachedWhenCallOverridePatIndexThe
EXPECT_EQ(3u, productHelper->overridePatIndex(isUncached, patIndex, AllocationType::commandBuffer));
}
MTLTEST_F(MtlProductHelperLinux, givenProductHelperWhenCallConfigureHardwareCustomThenCompressionIsDisabled) {
auto hwInfo = *defaultHwInfo;
hwInfo.featureTable.flags.ftrE2ECompression = true;
productHelper->configureHardwareCustom(&hwInfo, nullptr);
EXPECT_FALSE(hwInfo.capabilityTable.ftrRenderCompressedBuffers);
EXPECT_FALSE(hwInfo.capabilityTable.ftrRenderCompressedImages);
MTLTEST_F(MtlProductHelperLinux, givenProductHelperWhenAskedIsImageSuitableForCompressionThenReturnFalse) {
EXPECT_FALSE(productHelper->isImageSuitableForCompression());
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2023-2024 Intel Corporation
* Copyright (C) 2023-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -24,3 +24,7 @@ MTLTEST_F(MtlProductHelperWindows, whenCheckingIsTimestampWaitSupportedForEvents
MTLTEST_F(MtlProductHelperWindows, givenProductHelperWhenIsStagingBuffersEnabledThenTrueIsReturned) {
EXPECT_TRUE(productHelper->isStagingBuffersEnabled());
}
MTLTEST_F(MtlProductHelperWindows, givenProductHelperWhenAskedIsImageSuitableForCompressionThenReturnTrue) {
EXPECT_TRUE(productHelper->isImageSuitableForCompression());
}