Skip to content

Commit 4a08032

Browse files
fix: respect compression flag in capability table
Related-To: NEO-9465 Signed-off-by: Jaroslaw Warchulski <[email protected]> Source: c010d17
1 parent 4f9ff82 commit 4a08032

36 files changed

+237
-168
lines changed

opencl/source/mem_obj/buffer.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -364,8 +364,10 @@ Buffer *Buffer::create(Context *context,
364364
auto &rootDeviceEnvironment = *executionEnvironment.rootDeviceEnvironments[rootDeviceIndex];
365365
auto hwInfo = rootDeviceEnvironment.getHardwareInfo();
366366
auto &gfxCoreHelper = rootDeviceEnvironment.getHelper<GfxCoreHelper>();
367+
auto &defaultProductHelper = defaultDevice->getProductHelper();
368+
bool compressionSupported = GfxCoreHelper::compressedBuffersSupported(*hwInfo) && !defaultProductHelper.isCompressionForbidden(*hwInfo);
367369

368-
bool compressionEnabled = MemObjHelper::isSuitableForCompression(GfxCoreHelper::compressedBuffersSupported(*hwInfo), memoryProperties, *context,
370+
bool compressionEnabled = MemObjHelper::isSuitableForCompression(compressionSupported, memoryProperties, *context,
369371
gfxCoreHelper.isBufferSizeSuitableForCompression(size));
370372

371373
allocationInfo.allocationType = getGraphicsAllocationTypeAndCompressionPreference(memoryProperties, compressionEnabled,

opencl/source/mem_obj/image.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#include "opencl/source/mem_obj/image.h"
99

1010
#include "shared/source/command_stream/command_stream_receiver.h"
11-
#include "shared/source/debug_settings/debug_settings_manager.h"
1211
#include "shared/source/device/device.h"
1312
#include "shared/source/device/device_info.h"
1413
#include "shared/source/execution_environment/execution_environment.h"
@@ -44,8 +43,6 @@
4443

4544
#include "igfxfmid.h"
4645

47-
#include <map>
48-
4946
namespace NEO {
5047

5148
ImageFactoryFuncs imageFactory[IGFX_MAX_CORE] = {};
@@ -210,7 +207,10 @@ Image *Image::create(Context *context,
210207
}
211208

212209
auto &clGfxCoreHelper = defaultDevice->getRootDeviceEnvironment().getHelper<ClGfxCoreHelper>();
213-
bool preferCompression = MemObjHelper::isSuitableForCompression(!imgInfo.linearStorage, memoryProperties,
210+
auto hwInfo = defaultDevice->getRootDeviceEnvironment().getHardwareInfo();
211+
bool compressionSupported = !imgInfo.linearStorage && !defaultProductHelper.isCompressionForbidden(*hwInfo);
212+
213+
bool preferCompression = MemObjHelper::isSuitableForCompression(compressionSupported, memoryProperties,
214214
*context, true);
215215
preferCompression &= clGfxCoreHelper.allowImageCompression(surfaceFormat->oclImageFormat);
216216
preferCompression &= !clGfxCoreHelper.isFormatRedescribable(surfaceFormat->oclImageFormat);

opencl/test/unit_test/context/driver_diagnostics_tests.cpp

+5-4
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77

88
#include "driver_diagnostics_tests.h"
99

10+
#include "shared/source/gmm_helper/gmm.h"
1011
#include "shared/source/helpers/gfx_core_helper.h"
1112
#include "shared/source/memory_manager/os_agnostic_memory_manager.h"
1213
#include "shared/test/common/helpers/debug_manager_state_restore.h"
13-
#include "shared/test/common/mocks/mock_gmm.h"
1414

1515
#include "opencl/source/command_queue/cl_local_work_size.h"
1616
#include "opencl/source/helpers/cl_memory_properties_helpers.h"
@@ -684,9 +684,10 @@ HWTEST2_F(PerformanceHintTest, given64bitCompressedBufferWhenItsCreatedThenPrope
684684
snprintf(expectedHint, DriverDiagnostics::maxHintStringSize, DriverDiagnostics::hintFormat[BUFFER_IS_COMPRESSED], buffer.get());
685685

686686
auto &gfxCoreHelper = device->getGfxCoreHelper();
687-
auto compressionSupported = gfxCoreHelper.isBufferSizeSuitableForCompression(size) &&
688-
GfxCoreHelper::compressedBuffersSupported(hwInfo);
689-
if (compressionSupported) {
687+
auto &productHelper = device->getProductHelper();
688+
auto compressionEnabled = gfxCoreHelper.isBufferSizeSuitableForCompression(size) &&
689+
GfxCoreHelper::compressedBuffersSupported(hwInfo) && !productHelper.isCompressionForbidden(hwInfo);
690+
if (compressionEnabled) {
690691
EXPECT_TRUE(containsHint(expectedHint, userData));
691692
} else {
692693
EXPECT_FALSE(containsHint(expectedHint, userData));

opencl/test/unit_test/mem_obj/buffer_tests.cpp

+19-12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2018-2024 Intel Corporation
2+
* Copyright (C) 2018-2025 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -11,7 +11,6 @@
1111
#include "shared/source/helpers/compiler_product_helper.h"
1212
#include "shared/source/helpers/gfx_core_helper.h"
1313
#include "shared/source/helpers/local_memory_access_modes.h"
14-
#include "shared/source/memory_manager/memory_operations_handler.h"
1514
#include "shared/source/memory_manager/migration_sync_data.h"
1615
#include "shared/source/memory_manager/unified_memory_manager.h"
1716
#include "shared/test/common/fixtures/memory_management_fixture.h"
@@ -775,8 +774,10 @@ TEST_F(CompressedBuffersTests, givenBufferNotCompressedAllocationAndNoHostPtrWhe
775774
hwInfo->capabilityTable.ftrRenderCompressedBuffers = true;
776775
buffer.reset(Buffer::create(context.get(), 0, bufferSize, nullptr, retVal));
777776
allocation = buffer->getGraphicsAllocation(device->getRootDeviceIndex());
778-
auto &gfxCoreHelper = context->getDevice(0)->getGfxCoreHelper();
779-
if (gfxCoreHelper.isBufferSizeSuitableForCompression(bufferSize)) {
777+
auto contextDevice = context->getDevice(0);
778+
auto &gfxCoreHelper = contextDevice->getGfxCoreHelper();
779+
auto &productHelper = contextDevice->getProductHelper();
780+
if (gfxCoreHelper.isBufferSizeSuitableForCompression(bufferSize) && !productHelper.isCompressionForbidden(*hwInfo)) {
780781
EXPECT_FALSE(buffer->isMemObjZeroCopy());
781782
EXPECT_EQ(allocation->getAllocationType(), AllocationType::buffer);
782783
EXPECT_EQ(!memoryManager->allocate32BitGraphicsMemoryImplCalled, allocation->isCompressionEnabled());
@@ -797,9 +798,11 @@ TEST_F(CompressedBuffersTests, givenDebugVariableSetWhenHwFlagIsNotSetThenSelect
797798

798799
debugManager.flags.RenderCompressedBuffersEnabled.set(1);
799800
buffer.reset(Buffer::create(context.get(), 0, bufferSize, nullptr, retVal));
800-
auto graphicsAllocation = buffer->getGraphicsAllocation(context->getDevice(0)->getRootDeviceIndex());
801-
auto &gfxCoreHelper = context->getDevice(0)->getGfxCoreHelper();
802-
if (gfxCoreHelper.isBufferSizeSuitableForCompression(bufferSize)) {
801+
auto contextDevice = context->getDevice(0);
802+
auto graphicsAllocation = buffer->getGraphicsAllocation(contextDevice->getRootDeviceIndex());
803+
auto &gfxCoreHelper = contextDevice->getGfxCoreHelper();
804+
auto &productHelper = contextDevice->getProductHelper();
805+
if (gfxCoreHelper.isBufferSizeSuitableForCompression(bufferSize) && !productHelper.isCompressionForbidden(*hwInfo)) {
803806
EXPECT_EQ(graphicsAllocation->getAllocationType(), AllocationType::buffer);
804807
EXPECT_EQ(!memoryManager->allocate32BitGraphicsMemoryImplCalled, graphicsAllocation->isCompressionEnabled());
805808
} else if (!device->getProductHelper().isNewCoherencyModelSupported()) {
@@ -858,9 +861,11 @@ TEST_F(CompressedBuffersCopyHostMemoryTests, givenCompressedBufferWhenCopyFromHo
858861
hwInfo->capabilityTable.ftrRenderCompressedBuffers = true;
859862

860863
buffer.reset(Buffer::create(context.get(), CL_MEM_COPY_HOST_PTR, bufferSize, hostPtr, retVal));
861-
auto graphicsAllocation = buffer->getGraphicsAllocation(context->getDevice(0)->getRootDeviceIndex());
862-
auto &gfxCoreHelper = context->getDevice(0)->getGfxCoreHelper();
863-
if (gfxCoreHelper.isBufferSizeSuitableForCompression(bufferSize)) {
864+
auto contextDevice = context->getDevice(0);
865+
auto graphicsAllocation = buffer->getGraphicsAllocation(contextDevice->getRootDeviceIndex());
866+
auto &gfxCoreHelper = contextDevice->getGfxCoreHelper();
867+
auto &productHelper = contextDevice->getProductHelper();
868+
if (gfxCoreHelper.isBufferSizeSuitableForCompression(bufferSize) && !productHelper.isCompressionForbidden(*hwInfo)) {
864869
EXPECT_TRUE(graphicsAllocation->isCompressionEnabled());
865870
EXPECT_EQ(1u, mockCmdQ->writeBufferCounter);
866871
EXPECT_TRUE(mockCmdQ->writeBufferBlocking);
@@ -900,8 +905,10 @@ TEST_F(CompressedBuffersCopyHostMemoryTests, givenNonCompressedBufferWhenCopyFro
900905
}
901906

902907
TEST_F(CompressedBuffersCopyHostMemoryTests, givenCompressedBufferWhenWriteBufferFailsThenReturnErrorCode) {
903-
auto &gfxCoreHelper = context->getDevice(0)->getGfxCoreHelper();
904-
if (is32bit || !gfxCoreHelper.isBufferSizeSuitableForCompression(bufferSize)) {
908+
auto contextDevice = context->getDevice(0);
909+
auto &gfxCoreHelper = contextDevice->getGfxCoreHelper();
910+
auto &productHelper = contextDevice->getProductHelper();
911+
if (is32bit || !gfxCoreHelper.isBufferSizeSuitableForCompression(bufferSize) || productHelper.isCompressionForbidden(*hwInfo)) {
905912
return;
906913
}
907914
hwInfo->capabilityTable.ftrRenderCompressedBuffers = true;

opencl/test/unit_test/mem_obj/image_tests.cpp

+27-12
Original file line numberDiff line numberDiff line change
@@ -5,41 +5,44 @@
55
*
66
*/
77

8-
#include "shared/source/built_ins/built_ins.h"
9-
#include "shared/source/command_stream/command_stream_receiver_hw.h"
10-
#include "shared/source/compiler_interface/compiler_interface.h"
8+
#include "shared/source/command_stream/command_stream_receiver.h"
9+
#include "shared/source/direct_submission/dispatchers/render_dispatcher.h"
10+
#include "shared/source/gmm_helper/gmm.h"
1111
#include "shared/source/helpers/aligned_memory.h"
12+
#include "shared/source/helpers/bit_helpers.h"
13+
#include "shared/source/helpers/surface_format_info.h"
1214
#include "shared/source/image/image_surface_state.h"
15+
#include "shared/source/memory_manager/graphics_allocation.h"
16+
#include "shared/source/memory_manager/memory_manager.h"
1317
#include "shared/source/memory_manager/migration_sync_data.h"
18+
#include "shared/source/memory_manager/multi_graphics_allocation.h"
1419
#include "shared/source/os_interface/os_context.h"
1520
#include "shared/test/common/fixtures/memory_management_fixture.h"
1621
#include "shared/test/common/helpers/debug_manager_state_restore.h"
17-
#include "shared/test/common/helpers/engine_descriptor_helper.h"
1822
#include "shared/test/common/helpers/kernel_binary_helper.h"
19-
#include "shared/test/common/helpers/unit_test_helper.h"
20-
#include "shared/test/common/mocks/mock_allocation_properties.h"
23+
#include "shared/test/common/mocks/mock_device.h"
2124
#include "shared/test/common/mocks/mock_direct_submission_hw.h"
22-
#include "shared/test/common/mocks/mock_gmm.h"
2325
#include "shared/test/common/mocks/mock_gmm_resource_info.h"
2426
#include "shared/test/common/mocks/mock_memory_manager.h"
25-
#include "shared/test/common/mocks/mock_release_helper.h"
2627
#include "shared/test/common/test_macros/test.h"
2728
#include "shared/test/common/test_macros/test_checks_shared.h"
2829

30+
#include "opencl/extensions/public/cl_ext_private.h"
2931
#include "opencl/source/helpers/mipmap.h"
3032
#include "opencl/source/mem_obj/buffer.h"
3133
#include "opencl/source/mem_obj/image.h"
32-
#include "opencl/source/mem_obj/mem_obj_helper.h"
3334
#include "opencl/test/unit_test/command_queue/command_queue_fixture.h"
3435
#include "opencl/test/unit_test/fixtures/cl_device_fixture.h"
3536
#include "opencl/test/unit_test/fixtures/image_fixture.h"
36-
#include "opencl/test/unit_test/fixtures/multi_root_device_fixture.h"
3737
#include "opencl/test/unit_test/mem_obj/image_compression_fixture.h"
3838
#include "opencl/test/unit_test/mocks/mock_command_queue.h"
3939
#include "opencl/test/unit_test/mocks/mock_context.h"
4040
#include "opencl/test/unit_test/mocks/mock_image.h"
4141
#include "opencl/test/unit_test/mocks/mock_platform.h"
4242

43+
#include "CL/cl.h"
44+
#include "memory_properties_flags.h"
45+
4346
using namespace NEO;
4447

4548
static const unsigned int testImageDimensions = 45;
@@ -1113,7 +1116,13 @@ HWTEST_F(ImageCompressionTests, givenTiledImageWhenCreatingAllocationThenPreferC
11131116
ASSERT_NE(nullptr, image);
11141117
EXPECT_EQ(defaultHwInfo->capabilityTable.supportsImages, image->isTiledAllocation());
11151118
EXPECT_TRUE(myMemoryManager->mockMethodCalled);
1116-
EXPECT_EQ(defaultHwInfo->capabilityTable.supportsImages, myMemoryManager->capturedPreferCompressed);
1119+
1120+
auto compressionAllowed = !context.getDevice(0)->getProductHelper().isCompressionForbidden(*defaultHwInfo);
1121+
if (compressionAllowed) {
1122+
EXPECT_EQ(defaultHwInfo->capabilityTable.supportsImages, myMemoryManager->capturedPreferCompressed);
1123+
} else {
1124+
EXPECT_FALSE(myMemoryManager->capturedPreferCompressed);
1125+
}
11171126
}
11181127

11191128
TEST_F(ImageCompressionTests, givenNonTiledImageWhenCreatingAllocationThenDontPreferCompression) {
@@ -1146,7 +1155,13 @@ HWTEST_F(ImageCompressionTests, givenTiledImageAndVariousFlagsWhenCreatingAlloca
11461155
ASSERT_NE(nullptr, image);
11471156
EXPECT_EQ(defaultHwInfo->capabilityTable.supportsImages, image->isTiledAllocation());
11481157
EXPECT_TRUE(myMemoryManager->mockMethodCalled);
1149-
EXPECT_EQ(defaultHwInfo->capabilityTable.supportsImages, myMemoryManager->capturedPreferCompressed);
1158+
1159+
auto compressionAllowed = !context.getDevice(0)->getProductHelper().isCompressionForbidden(*defaultHwInfo);
1160+
if (compressionAllowed) {
1161+
EXPECT_EQ(defaultHwInfo->capabilityTable.supportsImages, myMemoryManager->capturedPreferCompressed);
1162+
} else {
1163+
EXPECT_FALSE(myMemoryManager->capturedPreferCompressed);
1164+
}
11501165

11511166
newFlags = flags | CL_MEM_UNCOMPRESSED_HINT_INTEL;
11521167
surfaceFormat = Image::getSurfaceFormatFromTable(

opencl/test/unit_test/xe_hpg_core/image_tests_xe_hpg_core.cpp

+21-6
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
*
66
*/
77

8-
#include "shared/test/common/helpers/unit_test_helper.h"
9-
108
#include "opencl/source/helpers/cl_memory_properties_helpers.h"
119
#include "opencl/source/mem_obj/image.h"
1210
#include "opencl/test/unit_test/mem_obj/image_compression_fixture.h"
@@ -48,7 +46,13 @@ XE_HPG_CORETEST_F(ImageCompressionTests, givenDifferentImageFormatsWhenCreatingI
4846

4947
ASSERT_NE(nullptr, image);
5048
EXPECT_TRUE(myMemoryManager->mockMethodCalled);
51-
EXPECT_EQ(format.isCompressable, myMemoryManager->capturedPreferCompressed);
49+
50+
auto compressionAllowed = !context.getDevice(0)->getProductHelper().isCompressionForbidden(*defaultHwInfo);
51+
if (compressionAllowed) {
52+
EXPECT_EQ(format.isCompressable, myMemoryManager->capturedPreferCompressed);
53+
} else {
54+
EXPECT_FALSE(myMemoryManager->capturedPreferCompressed);
55+
}
5256
}
5357
}
5458

@@ -64,7 +68,13 @@ XE_HPG_CORETEST_F(ImageCompressionTests, givenRedescribableFormatWhenCreatingAll
6468
mockContext.get(), ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
6569
flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
6670
ASSERT_NE(nullptr, image);
67-
EXPECT_EQ(defaultHwInfo->capabilityTable.supportsImages, myMemoryManager->capturedPreferCompressed);
71+
72+
auto compressionAllowed = !context.getDevice(0)->getProductHelper().isCompressionForbidden(*defaultHwInfo);
73+
if (compressionAllowed) {
74+
EXPECT_EQ(defaultHwInfo->capabilityTable.supportsImages, myMemoryManager->capturedPreferCompressed);
75+
} else {
76+
EXPECT_FALSE(myMemoryManager->capturedPreferCompressed);
77+
}
6878

6979
imageFormat.image_channel_order = CL_RG;
7080
surfaceFormat = Image::getSurfaceFormatFromTable(
@@ -73,5 +83,10 @@ XE_HPG_CORETEST_F(ImageCompressionTests, givenRedescribableFormatWhenCreatingAll
7383
mockContext.get(), ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
7484
flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
7585
ASSERT_NE(nullptr, image);
76-
EXPECT_TRUE(myMemoryManager->capturedPreferCompressed);
77-
}
86+
87+
if (compressionAllowed) {
88+
EXPECT_EQ(defaultHwInfo->capabilityTable.supportsImages, myMemoryManager->capturedPreferCompressed);
89+
} else {
90+
EXPECT_FALSE(myMemoryManager->capturedPreferCompressed);
91+
}
92+
}

shared/source/gen12lp/linux/product_helper_adlp.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,10 @@ int ProductHelperHw<gfxProduct>::configureHardwareCustom(HardwareInfo *hwInfo, O
2626
return 0;
2727
}
2828

29+
template <>
30+
bool ProductHelperHw<gfxProduct>::isCompressionForbidden(const HardwareInfo &hwInfo) const {
31+
return isCompressionForbiddenCommon(true);
32+
}
33+
2934
template class ProductHelperHw<gfxProduct>;
3035
} // namespace NEO

shared/source/gen12lp/linux/product_helper_dg1.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,10 @@ int ProductHelperHw<gfxProduct>::configureHardwareCustom(HardwareInfo *hwInfo, O
2929
return 0;
3030
}
3131

32+
template <>
33+
bool ProductHelperHw<gfxProduct>::isCompressionForbidden(const HardwareInfo &hwInfo) const {
34+
return isCompressionForbiddenCommon(true);
35+
}
36+
3237
template class ProductHelperHw<gfxProduct>;
3338
} // namespace NEO

shared/source/gen12lp/linux/product_helper_rkl.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,10 @@ int ProductHelperHw<gfxProduct>::configureHardwareCustom(HardwareInfo *hwInfo, O
2626
return 0;
2727
}
2828

29+
template <>
30+
bool ProductHelperHw<gfxProduct>::isCompressionForbidden(const HardwareInfo &hwInfo) const {
31+
return isCompressionForbiddenCommon(true);
32+
}
33+
2934
template class ProductHelperHw<gfxProduct>;
3035
} // namespace NEO

shared/source/gen12lp/linux/product_helper_tgllp.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,10 @@ int ProductHelperHw<gfxProduct>::configureHardwareCustom(HardwareInfo *hwInfo, O
2626
return 0;
2727
}
2828

29+
template <>
30+
bool ProductHelperHw<gfxProduct>::isCompressionForbidden(const HardwareInfo &hwInfo) const {
31+
return isCompressionForbiddenCommon(true);
32+
}
33+
2934
template class ProductHelperHw<gfxProduct>;
3035
} // namespace NEO

shared/source/os_interface/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ set(NEO_CORE_OS_INTERFACE
4545
${CMAKE_CURRENT_SOURCE_DIR}/product_helper.h
4646
${CMAKE_CURRENT_SOURCE_DIR}/product_helper.inl
4747
${CMAKE_CURRENT_SOURCE_DIR}/product_helper_before_xe_hpg.inl
48+
${CMAKE_CURRENT_SOURCE_DIR}/product_helper_before_xe2.inl
4849
${CMAKE_CURRENT_SOURCE_DIR}/product_helper_hw.h
4950
${CMAKE_CURRENT_SOURCE_DIR}/product_helper_xe_hpc_and_later.inl
5051
${CMAKE_CURRENT_SOURCE_DIR}/product_helper_xe2_and_later.inl

shared/source/os_interface/product_helper.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
/*
2-
* Copyright (C) 2021-2024 Intel Corporation
2+
* Copyright (C) 2021-2025 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
66
*/
77

88
#include "shared/source/os_interface/product_helper.h"
99

10-
#include "shared/source/built_ins/sip_kernel_type.h"
1110
#include "shared/source/command_stream/preemption.h"
1211
#include "shared/source/debug_settings/debug_settings_manager.h"
1312
#include "shared/source/execution_environment/root_device_environment.h"
@@ -45,6 +44,7 @@ void ProductHelper::setupKmdNotifyProperties(KmdNotifyProperties &kmdNotifyPrope
4544

4645
int ProductHelper::setupProductSpecificConfig(HardwareInfo &hwInfo, const RootDeviceEnvironment &rootDeviceEnvironment) const {
4746
auto osInterface = rootDeviceEnvironment.osInterface.get();
47+
setRenderCompressedFlags(hwInfo);
4848
int ret = configureHardwareCustom(&hwInfo, osInterface);
4949
if (ret != 0) {
5050
hwInfo = {};

shared/source/os_interface/product_helper.h

+2
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,8 @@ class ProductHelper {
267267
virtual bool isL3FlushAfterPostSyncRequired(bool heaplessEnabled) const = 0;
268268
virtual void overrideDirectSubmissionTimeouts(std::chrono::microseconds &timeout, std::chrono::microseconds &maxTimeout) const = 0;
269269
virtual bool isMisalignedUserPtr2WayCoherent() const = 0;
270+
virtual void setRenderCompressedFlags(HardwareInfo &hwInfo) const = 0;
271+
virtual bool isCompressionForbidden(const HardwareInfo &hwInfo) const = 0;
270272

271273
virtual ~ProductHelper() = default;
272274

shared/source/os_interface/product_helper.inl

+17-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ namespace NEO {
3939

4040
template <PRODUCT_FAMILY gfxProduct>
4141
int ProductHelperHw<gfxProduct>::configureHardwareCustom(HardwareInfo *hwInfo, OSInterface *osIface) const {
42-
enableCompression(hwInfo);
4342
enableBlitterOperationsSupport(hwInfo);
4443

4544
return 0;
@@ -1100,4 +1099,21 @@ bool ProductHelperHw<gfxProduct>::isHostUsmAllocationReuseSupported() const {
11001099
return true;
11011100
}
11021101

1102+
template <PRODUCT_FAMILY gfxProduct>
1103+
bool ProductHelperHw<gfxProduct>::isCompressionForbiddenCommon(bool defaultValue) const {
1104+
auto images = debugManager.flags.RenderCompressedImagesEnabled.get();
1105+
auto buffers = debugManager.flags.RenderCompressedBuffersEnabled.get();
1106+
1107+
if (images == -1 && buffers == -1) {
1108+
return defaultValue;
1109+
} else {
1110+
return (images == 0 && buffers == 0);
1111+
}
1112+
}
1113+
1114+
template <PRODUCT_FAMILY gfxProduct>
1115+
bool ProductHelperHw<gfxProduct>::isCompressionForbidden(const HardwareInfo &hwInfo) const {
1116+
return isCompressionForbiddenCommon(false);
1117+
}
1118+
11031119
} // namespace NEO

0 commit comments

Comments
 (0)