fix: respect compression flag in capability table
Related-To: NEO-9465
Signed-off-by: Jaroslaw Warchulski <jaroslaw.warchulski@intel.com>
Source: c010d17842
This commit is contained in:
parent
4f9ff82520
commit
4a080325f4
|
@ -364,8 +364,10 @@ Buffer *Buffer::create(Context *context,
|
|||
auto &rootDeviceEnvironment = *executionEnvironment.rootDeviceEnvironments[rootDeviceIndex];
|
||||
auto hwInfo = rootDeviceEnvironment.getHardwareInfo();
|
||||
auto &gfxCoreHelper = rootDeviceEnvironment.getHelper<GfxCoreHelper>();
|
||||
auto &defaultProductHelper = defaultDevice->getProductHelper();
|
||||
bool compressionSupported = GfxCoreHelper::compressedBuffersSupported(*hwInfo) && !defaultProductHelper.isCompressionForbidden(*hwInfo);
|
||||
|
||||
bool compressionEnabled = MemObjHelper::isSuitableForCompression(GfxCoreHelper::compressedBuffersSupported(*hwInfo), memoryProperties, *context,
|
||||
bool compressionEnabled = MemObjHelper::isSuitableForCompression(compressionSupported, memoryProperties, *context,
|
||||
gfxCoreHelper.isBufferSizeSuitableForCompression(size));
|
||||
|
||||
allocationInfo.allocationType = getGraphicsAllocationTypeAndCompressionPreference(memoryProperties, compressionEnabled,
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
#include "opencl/source/mem_obj/image.h"
|
||||
|
||||
#include "shared/source/command_stream/command_stream_receiver.h"
|
||||
#include "shared/source/debug_settings/debug_settings_manager.h"
|
||||
#include "shared/source/device/device.h"
|
||||
#include "shared/source/device/device_info.h"
|
||||
#include "shared/source/execution_environment/execution_environment.h"
|
||||
|
@ -44,8 +43,6 @@
|
|||
|
||||
#include "igfxfmid.h"
|
||||
|
||||
#include <map>
|
||||
|
||||
namespace NEO {
|
||||
|
||||
ImageFactoryFuncs imageFactory[IGFX_MAX_CORE] = {};
|
||||
|
@ -210,7 +207,10 @@ Image *Image::create(Context *context,
|
|||
}
|
||||
|
||||
auto &clGfxCoreHelper = defaultDevice->getRootDeviceEnvironment().getHelper<ClGfxCoreHelper>();
|
||||
bool preferCompression = MemObjHelper::isSuitableForCompression(!imgInfo.linearStorage, memoryProperties,
|
||||
auto hwInfo = defaultDevice->getRootDeviceEnvironment().getHardwareInfo();
|
||||
bool compressionSupported = !imgInfo.linearStorage && !defaultProductHelper.isCompressionForbidden(*hwInfo);
|
||||
|
||||
bool preferCompression = MemObjHelper::isSuitableForCompression(compressionSupported, memoryProperties,
|
||||
*context, true);
|
||||
preferCompression &= clGfxCoreHelper.allowImageCompression(surfaceFormat->oclImageFormat);
|
||||
preferCompression &= !clGfxCoreHelper.isFormatRedescribable(surfaceFormat->oclImageFormat);
|
||||
|
|
|
@ -7,10 +7,10 @@
|
|||
|
||||
#include "driver_diagnostics_tests.h"
|
||||
|
||||
#include "shared/source/gmm_helper/gmm.h"
|
||||
#include "shared/source/helpers/gfx_core_helper.h"
|
||||
#include "shared/source/memory_manager/os_agnostic_memory_manager.h"
|
||||
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
||||
#include "shared/test/common/mocks/mock_gmm.h"
|
||||
|
||||
#include "opencl/source/command_queue/cl_local_work_size.h"
|
||||
#include "opencl/source/helpers/cl_memory_properties_helpers.h"
|
||||
|
@ -684,9 +684,10 @@ HWTEST2_F(PerformanceHintTest, given64bitCompressedBufferWhenItsCreatedThenPrope
|
|||
snprintf(expectedHint, DriverDiagnostics::maxHintStringSize, DriverDiagnostics::hintFormat[BUFFER_IS_COMPRESSED], buffer.get());
|
||||
|
||||
auto &gfxCoreHelper = device->getGfxCoreHelper();
|
||||
auto compressionSupported = gfxCoreHelper.isBufferSizeSuitableForCompression(size) &&
|
||||
GfxCoreHelper::compressedBuffersSupported(hwInfo);
|
||||
if (compressionSupported) {
|
||||
auto &productHelper = device->getProductHelper();
|
||||
auto compressionEnabled = gfxCoreHelper.isBufferSizeSuitableForCompression(size) &&
|
||||
GfxCoreHelper::compressedBuffersSupported(hwInfo) && !productHelper.isCompressionForbidden(hwInfo);
|
||||
if (compressionEnabled) {
|
||||
EXPECT_TRUE(containsHint(expectedHint, userData));
|
||||
} else {
|
||||
EXPECT_FALSE(containsHint(expectedHint, userData));
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2018-2024 Intel Corporation
|
||||
* Copyright (C) 2018-2025 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
|
@ -11,7 +11,6 @@
|
|||
#include "shared/source/helpers/compiler_product_helper.h"
|
||||
#include "shared/source/helpers/gfx_core_helper.h"
|
||||
#include "shared/source/helpers/local_memory_access_modes.h"
|
||||
#include "shared/source/memory_manager/memory_operations_handler.h"
|
||||
#include "shared/source/memory_manager/migration_sync_data.h"
|
||||
#include "shared/source/memory_manager/unified_memory_manager.h"
|
||||
#include "shared/test/common/fixtures/memory_management_fixture.h"
|
||||
|
@ -775,8 +774,10 @@ TEST_F(CompressedBuffersTests, givenBufferNotCompressedAllocationAndNoHostPtrWhe
|
|||
hwInfo->capabilityTable.ftrRenderCompressedBuffers = true;
|
||||
buffer.reset(Buffer::create(context.get(), 0, bufferSize, nullptr, retVal));
|
||||
allocation = buffer->getGraphicsAllocation(device->getRootDeviceIndex());
|
||||
auto &gfxCoreHelper = context->getDevice(0)->getGfxCoreHelper();
|
||||
if (gfxCoreHelper.isBufferSizeSuitableForCompression(bufferSize)) {
|
||||
auto contextDevice = context->getDevice(0);
|
||||
auto &gfxCoreHelper = contextDevice->getGfxCoreHelper();
|
||||
auto &productHelper = contextDevice->getProductHelper();
|
||||
if (gfxCoreHelper.isBufferSizeSuitableForCompression(bufferSize) && !productHelper.isCompressionForbidden(*hwInfo)) {
|
||||
EXPECT_FALSE(buffer->isMemObjZeroCopy());
|
||||
EXPECT_EQ(allocation->getAllocationType(), AllocationType::buffer);
|
||||
EXPECT_EQ(!memoryManager->allocate32BitGraphicsMemoryImplCalled, allocation->isCompressionEnabled());
|
||||
|
@ -797,9 +798,11 @@ TEST_F(CompressedBuffersTests, givenDebugVariableSetWhenHwFlagIsNotSetThenSelect
|
|||
|
||||
debugManager.flags.RenderCompressedBuffersEnabled.set(1);
|
||||
buffer.reset(Buffer::create(context.get(), 0, bufferSize, nullptr, retVal));
|
||||
auto graphicsAllocation = buffer->getGraphicsAllocation(context->getDevice(0)->getRootDeviceIndex());
|
||||
auto &gfxCoreHelper = context->getDevice(0)->getGfxCoreHelper();
|
||||
if (gfxCoreHelper.isBufferSizeSuitableForCompression(bufferSize)) {
|
||||
auto contextDevice = context->getDevice(0);
|
||||
auto graphicsAllocation = buffer->getGraphicsAllocation(contextDevice->getRootDeviceIndex());
|
||||
auto &gfxCoreHelper = contextDevice->getGfxCoreHelper();
|
||||
auto &productHelper = contextDevice->getProductHelper();
|
||||
if (gfxCoreHelper.isBufferSizeSuitableForCompression(bufferSize) && !productHelper.isCompressionForbidden(*hwInfo)) {
|
||||
EXPECT_EQ(graphicsAllocation->getAllocationType(), AllocationType::buffer);
|
||||
EXPECT_EQ(!memoryManager->allocate32BitGraphicsMemoryImplCalled, graphicsAllocation->isCompressionEnabled());
|
||||
} else if (!device->getProductHelper().isNewCoherencyModelSupported()) {
|
||||
|
@ -858,9 +861,11 @@ TEST_F(CompressedBuffersCopyHostMemoryTests, givenCompressedBufferWhenCopyFromHo
|
|||
hwInfo->capabilityTable.ftrRenderCompressedBuffers = true;
|
||||
|
||||
buffer.reset(Buffer::create(context.get(), CL_MEM_COPY_HOST_PTR, bufferSize, hostPtr, retVal));
|
||||
auto graphicsAllocation = buffer->getGraphicsAllocation(context->getDevice(0)->getRootDeviceIndex());
|
||||
auto &gfxCoreHelper = context->getDevice(0)->getGfxCoreHelper();
|
||||
if (gfxCoreHelper.isBufferSizeSuitableForCompression(bufferSize)) {
|
||||
auto contextDevice = context->getDevice(0);
|
||||
auto graphicsAllocation = buffer->getGraphicsAllocation(contextDevice->getRootDeviceIndex());
|
||||
auto &gfxCoreHelper = contextDevice->getGfxCoreHelper();
|
||||
auto &productHelper = contextDevice->getProductHelper();
|
||||
if (gfxCoreHelper.isBufferSizeSuitableForCompression(bufferSize) && !productHelper.isCompressionForbidden(*hwInfo)) {
|
||||
EXPECT_TRUE(graphicsAllocation->isCompressionEnabled());
|
||||
EXPECT_EQ(1u, mockCmdQ->writeBufferCounter);
|
||||
EXPECT_TRUE(mockCmdQ->writeBufferBlocking);
|
||||
|
@ -900,8 +905,10 @@ TEST_F(CompressedBuffersCopyHostMemoryTests, givenNonCompressedBufferWhenCopyFro
|
|||
}
|
||||
|
||||
TEST_F(CompressedBuffersCopyHostMemoryTests, givenCompressedBufferWhenWriteBufferFailsThenReturnErrorCode) {
|
||||
auto &gfxCoreHelper = context->getDevice(0)->getGfxCoreHelper();
|
||||
if (is32bit || !gfxCoreHelper.isBufferSizeSuitableForCompression(bufferSize)) {
|
||||
auto contextDevice = context->getDevice(0);
|
||||
auto &gfxCoreHelper = contextDevice->getGfxCoreHelper();
|
||||
auto &productHelper = contextDevice->getProductHelper();
|
||||
if (is32bit || !gfxCoreHelper.isBufferSizeSuitableForCompression(bufferSize) || productHelper.isCompressionForbidden(*hwInfo)) {
|
||||
return;
|
||||
}
|
||||
hwInfo->capabilityTable.ftrRenderCompressedBuffers = true;
|
||||
|
|
|
@ -5,41 +5,44 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/built_ins/built_ins.h"
|
||||
#include "shared/source/command_stream/command_stream_receiver_hw.h"
|
||||
#include "shared/source/compiler_interface/compiler_interface.h"
|
||||
#include "shared/source/command_stream/command_stream_receiver.h"
|
||||
#include "shared/source/direct_submission/dispatchers/render_dispatcher.h"
|
||||
#include "shared/source/gmm_helper/gmm.h"
|
||||
#include "shared/source/helpers/aligned_memory.h"
|
||||
#include "shared/source/helpers/bit_helpers.h"
|
||||
#include "shared/source/helpers/surface_format_info.h"
|
||||
#include "shared/source/image/image_surface_state.h"
|
||||
#include "shared/source/memory_manager/graphics_allocation.h"
|
||||
#include "shared/source/memory_manager/memory_manager.h"
|
||||
#include "shared/source/memory_manager/migration_sync_data.h"
|
||||
#include "shared/source/memory_manager/multi_graphics_allocation.h"
|
||||
#include "shared/source/os_interface/os_context.h"
|
||||
#include "shared/test/common/fixtures/memory_management_fixture.h"
|
||||
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
||||
#include "shared/test/common/helpers/engine_descriptor_helper.h"
|
||||
#include "shared/test/common/helpers/kernel_binary_helper.h"
|
||||
#include "shared/test/common/helpers/unit_test_helper.h"
|
||||
#include "shared/test/common/mocks/mock_allocation_properties.h"
|
||||
#include "shared/test/common/mocks/mock_device.h"
|
||||
#include "shared/test/common/mocks/mock_direct_submission_hw.h"
|
||||
#include "shared/test/common/mocks/mock_gmm.h"
|
||||
#include "shared/test/common/mocks/mock_gmm_resource_info.h"
|
||||
#include "shared/test/common/mocks/mock_memory_manager.h"
|
||||
#include "shared/test/common/mocks/mock_release_helper.h"
|
||||
#include "shared/test/common/test_macros/test.h"
|
||||
#include "shared/test/common/test_macros/test_checks_shared.h"
|
||||
|
||||
#include "opencl/extensions/public/cl_ext_private.h"
|
||||
#include "opencl/source/helpers/mipmap.h"
|
||||
#include "opencl/source/mem_obj/buffer.h"
|
||||
#include "opencl/source/mem_obj/image.h"
|
||||
#include "opencl/source/mem_obj/mem_obj_helper.h"
|
||||
#include "opencl/test/unit_test/command_queue/command_queue_fixture.h"
|
||||
#include "opencl/test/unit_test/fixtures/cl_device_fixture.h"
|
||||
#include "opencl/test/unit_test/fixtures/image_fixture.h"
|
||||
#include "opencl/test/unit_test/fixtures/multi_root_device_fixture.h"
|
||||
#include "opencl/test/unit_test/mem_obj/image_compression_fixture.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_command_queue.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_context.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_image.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_platform.h"
|
||||
|
||||
#include "CL/cl.h"
|
||||
#include "memory_properties_flags.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
static const unsigned int testImageDimensions = 45;
|
||||
|
@ -1113,7 +1116,13 @@ HWTEST_F(ImageCompressionTests, givenTiledImageWhenCreatingAllocationThenPreferC
|
|||
ASSERT_NE(nullptr, image);
|
||||
EXPECT_EQ(defaultHwInfo->capabilityTable.supportsImages, image->isTiledAllocation());
|
||||
EXPECT_TRUE(myMemoryManager->mockMethodCalled);
|
||||
EXPECT_EQ(defaultHwInfo->capabilityTable.supportsImages, myMemoryManager->capturedPreferCompressed);
|
||||
|
||||
auto compressionAllowed = !context.getDevice(0)->getProductHelper().isCompressionForbidden(*defaultHwInfo);
|
||||
if (compressionAllowed) {
|
||||
EXPECT_EQ(defaultHwInfo->capabilityTable.supportsImages, myMemoryManager->capturedPreferCompressed);
|
||||
} else {
|
||||
EXPECT_FALSE(myMemoryManager->capturedPreferCompressed);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(ImageCompressionTests, givenNonTiledImageWhenCreatingAllocationThenDontPreferCompression) {
|
||||
|
@ -1146,7 +1155,13 @@ HWTEST_F(ImageCompressionTests, givenTiledImageAndVariousFlagsWhenCreatingAlloca
|
|||
ASSERT_NE(nullptr, image);
|
||||
EXPECT_EQ(defaultHwInfo->capabilityTable.supportsImages, image->isTiledAllocation());
|
||||
EXPECT_TRUE(myMemoryManager->mockMethodCalled);
|
||||
EXPECT_EQ(defaultHwInfo->capabilityTable.supportsImages, myMemoryManager->capturedPreferCompressed);
|
||||
|
||||
auto compressionAllowed = !context.getDevice(0)->getProductHelper().isCompressionForbidden(*defaultHwInfo);
|
||||
if (compressionAllowed) {
|
||||
EXPECT_EQ(defaultHwInfo->capabilityTable.supportsImages, myMemoryManager->capturedPreferCompressed);
|
||||
} else {
|
||||
EXPECT_FALSE(myMemoryManager->capturedPreferCompressed);
|
||||
}
|
||||
|
||||
newFlags = flags | CL_MEM_UNCOMPRESSED_HINT_INTEL;
|
||||
surfaceFormat = Image::getSurfaceFormatFromTable(
|
||||
|
|
|
@ -5,8 +5,6 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#include "shared/test/common/helpers/unit_test_helper.h"
|
||||
|
||||
#include "opencl/source/helpers/cl_memory_properties_helpers.h"
|
||||
#include "opencl/source/mem_obj/image.h"
|
||||
#include "opencl/test/unit_test/mem_obj/image_compression_fixture.h"
|
||||
|
@ -48,7 +46,13 @@ XE_HPG_CORETEST_F(ImageCompressionTests, givenDifferentImageFormatsWhenCreatingI
|
|||
|
||||
ASSERT_NE(nullptr, image);
|
||||
EXPECT_TRUE(myMemoryManager->mockMethodCalled);
|
||||
EXPECT_EQ(format.isCompressable, myMemoryManager->capturedPreferCompressed);
|
||||
|
||||
auto compressionAllowed = !context.getDevice(0)->getProductHelper().isCompressionForbidden(*defaultHwInfo);
|
||||
if (compressionAllowed) {
|
||||
EXPECT_EQ(format.isCompressable, myMemoryManager->capturedPreferCompressed);
|
||||
} else {
|
||||
EXPECT_FALSE(myMemoryManager->capturedPreferCompressed);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -64,7 +68,13 @@ XE_HPG_CORETEST_F(ImageCompressionTests, givenRedescribableFormatWhenCreatingAll
|
|||
mockContext.get(), ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
|
||||
ASSERT_NE(nullptr, image);
|
||||
EXPECT_EQ(defaultHwInfo->capabilityTable.supportsImages, myMemoryManager->capturedPreferCompressed);
|
||||
|
||||
auto compressionAllowed = !context.getDevice(0)->getProductHelper().isCompressionForbidden(*defaultHwInfo);
|
||||
if (compressionAllowed) {
|
||||
EXPECT_EQ(defaultHwInfo->capabilityTable.supportsImages, myMemoryManager->capturedPreferCompressed);
|
||||
} else {
|
||||
EXPECT_FALSE(myMemoryManager->capturedPreferCompressed);
|
||||
}
|
||||
|
||||
imageFormat.image_channel_order = CL_RG;
|
||||
surfaceFormat = Image::getSurfaceFormatFromTable(
|
||||
|
@ -73,5 +83,10 @@ XE_HPG_CORETEST_F(ImageCompressionTests, givenRedescribableFormatWhenCreatingAll
|
|||
mockContext.get(), ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
|
||||
flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
|
||||
ASSERT_NE(nullptr, image);
|
||||
EXPECT_TRUE(myMemoryManager->capturedPreferCompressed);
|
||||
}
|
||||
|
||||
if (compressionAllowed) {
|
||||
EXPECT_EQ(defaultHwInfo->capabilityTable.supportsImages, myMemoryManager->capturedPreferCompressed);
|
||||
} else {
|
||||
EXPECT_FALSE(myMemoryManager->capturedPreferCompressed);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,5 +26,10 @@ int ProductHelperHw<gfxProduct>::configureHardwareCustom(HardwareInfo *hwInfo, O
|
|||
return 0;
|
||||
}
|
||||
|
||||
template <>
|
||||
bool ProductHelperHw<gfxProduct>::isCompressionForbidden(const HardwareInfo &hwInfo) const {
|
||||
return isCompressionForbiddenCommon(true);
|
||||
}
|
||||
|
||||
template class ProductHelperHw<gfxProduct>;
|
||||
} // namespace NEO
|
||||
|
|
|
@ -29,5 +29,10 @@ int ProductHelperHw<gfxProduct>::configureHardwareCustom(HardwareInfo *hwInfo, O
|
|||
return 0;
|
||||
}
|
||||
|
||||
template <>
|
||||
bool ProductHelperHw<gfxProduct>::isCompressionForbidden(const HardwareInfo &hwInfo) const {
|
||||
return isCompressionForbiddenCommon(true);
|
||||
}
|
||||
|
||||
template class ProductHelperHw<gfxProduct>;
|
||||
} // namespace NEO
|
||||
|
|
|
@ -26,5 +26,10 @@ int ProductHelperHw<gfxProduct>::configureHardwareCustom(HardwareInfo *hwInfo, O
|
|||
return 0;
|
||||
}
|
||||
|
||||
template <>
|
||||
bool ProductHelperHw<gfxProduct>::isCompressionForbidden(const HardwareInfo &hwInfo) const {
|
||||
return isCompressionForbiddenCommon(true);
|
||||
}
|
||||
|
||||
template class ProductHelperHw<gfxProduct>;
|
||||
} // namespace NEO
|
||||
|
|
|
@ -26,5 +26,10 @@ int ProductHelperHw<gfxProduct>::configureHardwareCustom(HardwareInfo *hwInfo, O
|
|||
return 0;
|
||||
}
|
||||
|
||||
template <>
|
||||
bool ProductHelperHw<gfxProduct>::isCompressionForbidden(const HardwareInfo &hwInfo) const {
|
||||
return isCompressionForbiddenCommon(true);
|
||||
}
|
||||
|
||||
template class ProductHelperHw<gfxProduct>;
|
||||
} // namespace NEO
|
||||
|
|
|
@ -45,6 +45,7 @@ set(NEO_CORE_OS_INTERFACE
|
|||
${CMAKE_CURRENT_SOURCE_DIR}/product_helper.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/product_helper.inl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/product_helper_before_xe_hpg.inl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/product_helper_before_xe2.inl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/product_helper_hw.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/product_helper_xe_hpc_and_later.inl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/product_helper_xe2_and_later.inl
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2021-2024 Intel Corporation
|
||||
* Copyright (C) 2021-2025 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
|
@ -7,7 +7,6 @@
|
|||
|
||||
#include "shared/source/os_interface/product_helper.h"
|
||||
|
||||
#include "shared/source/built_ins/sip_kernel_type.h"
|
||||
#include "shared/source/command_stream/preemption.h"
|
||||
#include "shared/source/debug_settings/debug_settings_manager.h"
|
||||
#include "shared/source/execution_environment/root_device_environment.h"
|
||||
|
@ -45,6 +44,7 @@ void ProductHelper::setupKmdNotifyProperties(KmdNotifyProperties &kmdNotifyPrope
|
|||
|
||||
int ProductHelper::setupProductSpecificConfig(HardwareInfo &hwInfo, const RootDeviceEnvironment &rootDeviceEnvironment) const {
|
||||
auto osInterface = rootDeviceEnvironment.osInterface.get();
|
||||
setRenderCompressedFlags(hwInfo);
|
||||
int ret = configureHardwareCustom(&hwInfo, osInterface);
|
||||
if (ret != 0) {
|
||||
hwInfo = {};
|
||||
|
|
|
@ -267,6 +267,8 @@ class ProductHelper {
|
|||
virtual bool isL3FlushAfterPostSyncRequired(bool heaplessEnabled) const = 0;
|
||||
virtual void overrideDirectSubmissionTimeouts(std::chrono::microseconds &timeout, std::chrono::microseconds &maxTimeout) const = 0;
|
||||
virtual bool isMisalignedUserPtr2WayCoherent() const = 0;
|
||||
virtual void setRenderCompressedFlags(HardwareInfo &hwInfo) const = 0;
|
||||
virtual bool isCompressionForbidden(const HardwareInfo &hwInfo) const = 0;
|
||||
|
||||
virtual ~ProductHelper() = default;
|
||||
|
||||
|
|
|
@ -39,7 +39,6 @@ namespace NEO {
|
|||
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
int ProductHelperHw<gfxProduct>::configureHardwareCustom(HardwareInfo *hwInfo, OSInterface *osIface) const {
|
||||
enableCompression(hwInfo);
|
||||
enableBlitterOperationsSupport(hwInfo);
|
||||
|
||||
return 0;
|
||||
|
@ -1100,4 +1099,21 @@ bool ProductHelperHw<gfxProduct>::isHostUsmAllocationReuseSupported() const {
|
|||
return true;
|
||||
}
|
||||
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
bool ProductHelperHw<gfxProduct>::isCompressionForbiddenCommon(bool defaultValue) const {
|
||||
auto images = debugManager.flags.RenderCompressedImagesEnabled.get();
|
||||
auto buffers = debugManager.flags.RenderCompressedBuffersEnabled.get();
|
||||
|
||||
if (images == -1 && buffers == -1) {
|
||||
return defaultValue;
|
||||
} else {
|
||||
return (images == 0 && buffers == 0);
|
||||
}
|
||||
}
|
||||
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
bool ProductHelperHw<gfxProduct>::isCompressionForbidden(const HardwareInfo &hwInfo) const {
|
||||
return isCompressionForbiddenCommon(false);
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
|
|
|
@ -9,12 +9,6 @@
|
|||
|
||||
namespace NEO {
|
||||
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
void ProductHelperHw<gfxProduct>::enableCompression(HardwareInfo *hwInfo) const {
|
||||
hwInfo->capabilityTable.ftrRenderCompressedImages = hwInfo->featureTable.flags.ftrE2ECompression;
|
||||
hwInfo->capabilityTable.ftrRenderCompressedBuffers = hwInfo->featureTable.flags.ftrE2ECompression;
|
||||
}
|
||||
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
bool ProductHelperHw<gfxProduct>::useGemCreateExtInAllocateMemoryByKMD() const {
|
||||
return false;
|
||||
|
@ -40,4 +34,10 @@ std::optional<bool> ProductHelperHw<gfxProduct>::isCoherentAllocation(uint64_t p
|
|||
return std::nullopt;
|
||||
}
|
||||
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
void ProductHelperHw<gfxProduct>::setRenderCompressedFlags(HardwareInfo &hwInfo) const {
|
||||
hwInfo.capabilityTable.ftrRenderCompressedImages = hwInfo.featureTable.flags.ftrE2ECompression;
|
||||
hwInfo.capabilityTable.ftrRenderCompressedBuffers = hwInfo.featureTable.flags.ftrE2ECompression;
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
|
|
|
@ -204,19 +204,21 @@ class ProductHelperHw : public ProductHelper {
|
|||
bool isL3FlushAfterPostSyncRequired(bool heaplessEnabled) const override;
|
||||
void overrideDirectSubmissionTimeouts(std::chrono::microseconds &timeout, std::chrono::microseconds &maxTimeout) const override;
|
||||
bool isMisalignedUserPtr2WayCoherent() const override;
|
||||
void setRenderCompressedFlags(HardwareInfo &hwInfo) const override;
|
||||
bool isCompressionForbidden(const HardwareInfo &hwInfo) const override;
|
||||
|
||||
~ProductHelperHw() override = default;
|
||||
|
||||
protected:
|
||||
ProductHelperHw() = default;
|
||||
|
||||
void enableCompression(HardwareInfo *hwInfo) const;
|
||||
void enableBlitterOperationsSupport(HardwareInfo *hwInfo) const;
|
||||
bool getConcurrentAccessMemCapabilitiesSupported(UsmAccessCapabilities capability) const;
|
||||
uint64_t getHostMemCapabilitiesValue() const;
|
||||
bool getHostMemCapabilitiesSupported(const HardwareInfo *hwInfo) const;
|
||||
LocalMemoryAccessMode getDefaultLocalMemoryAccessMode(const HardwareInfo &hwInfo) const override;
|
||||
void fillScmPropertiesSupportStructureBase(StateComputeModePropertiesSupport &propertiesSupport) const override;
|
||||
bool isCompressionForbiddenCommon(bool defaultValue) const;
|
||||
};
|
||||
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
|
|
|
@ -5,21 +5,10 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/debug_settings/debug_settings_manager.h"
|
||||
#include "shared/source/os_interface/product_helper.h"
|
||||
#include "shared/source/os_interface/product_helper_hw.h"
|
||||
#include "shared/source/unified_memory/usm_memory_support.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
namespace NEO {
|
||||
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
void ProductHelperHw<gfxProduct>::enableCompression(HardwareInfo *hwInfo) const {
|
||||
hwInfo->capabilityTable.ftrRenderCompressedImages = hwInfo->featureTable.flags.ftrXe2Compression;
|
||||
hwInfo->capabilityTable.ftrRenderCompressedBuffers = hwInfo->featureTable.flags.ftrXe2Compression;
|
||||
}
|
||||
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
bool ProductHelperHw<gfxProduct>::useGemCreateExtInAllocateMemoryByKMD() const {
|
||||
return true;
|
||||
|
@ -49,4 +38,10 @@ std::optional<bool> ProductHelperHw<gfxProduct>::isCoherentAllocation(uint64_t p
|
|||
return false;
|
||||
}
|
||||
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
void ProductHelperHw<gfxProduct>::setRenderCompressedFlags(HardwareInfo &hwInfo) const {
|
||||
hwInfo.capabilityTable.ftrRenderCompressedImages = hwInfo.featureTable.flags.ftrXe2Compression;
|
||||
hwInfo.capabilityTable.ftrRenderCompressedBuffers = hwInfo.featureTable.flags.ftrXe2Compression;
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
|
|
|
@ -21,8 +21,6 @@ namespace NEO {
|
|||
|
||||
template <>
|
||||
int ProductHelperHw<gfxProduct>::configureHardwareCustom(HardwareInfo *hwInfo, OSInterface *osIface) const {
|
||||
enableCompression(hwInfo);
|
||||
|
||||
hwInfo->featureTable.flags.ftr57bGPUAddressing = (hwInfo->capabilityTable.gpuAddressSpace == maxNBitValue(57));
|
||||
|
||||
enableBlitterOperationsSupport(hwInfo);
|
||||
|
|
|
@ -22,8 +22,6 @@ namespace NEO {
|
|||
|
||||
template <>
|
||||
int ProductHelperHw<gfxProduct>::configureHardwareCustom(HardwareInfo *hwInfo, OSInterface *osIface) const {
|
||||
enableCompression(hwInfo);
|
||||
|
||||
hwInfo->featureTable.flags.ftr57bGPUAddressing = (hwInfo->capabilityTable.gpuAddressSpace == maxNBitValue(57));
|
||||
|
||||
enableBlitterOperationsSupport(hwInfo);
|
||||
|
|
|
@ -16,14 +16,6 @@ constexpr static auto gfxProduct = IGFX_BMG;
|
|||
|
||||
namespace NEO {
|
||||
|
||||
template <>
|
||||
int ProductHelperHw<gfxProduct>::configureHardwareCustom(HardwareInfo *hwInfo, OSInterface *osIface) const {
|
||||
enableCompression(hwInfo);
|
||||
enableBlitterOperationsSupport(hwInfo);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
template <>
|
||||
bool ProductHelperHw<gfxProduct>::restartDirectSubmissionForHostptrFree() const {
|
||||
return true;
|
||||
|
|
|
@ -16,14 +16,6 @@ constexpr static auto gfxProduct = IGFX_LUNARLAKE;
|
|||
|
||||
namespace NEO {
|
||||
|
||||
template <>
|
||||
int ProductHelperHw<gfxProduct>::configureHardwareCustom(HardwareInfo *hwInfo, OSInterface *osIface) const {
|
||||
enableCompression(hwInfo);
|
||||
enableBlitterOperationsSupport(hwInfo);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
template <>
|
||||
uint64_t ProductHelperHw<gfxProduct>::overridePatIndex(bool isUncachedType, uint64_t patIndex, AllocationType allocationType) const {
|
||||
if (this->overridePatToUCAndTwoWayCohForDcFlushMitigation(allocationType)) {
|
||||
|
|
|
@ -22,8 +22,6 @@ namespace NEO {
|
|||
|
||||
template <>
|
||||
int ProductHelperHw<gfxProduct>::configureHardwareCustom(HardwareInfo *hwInfo, OSInterface *osIface) const {
|
||||
enableCompression(hwInfo);
|
||||
|
||||
hwInfo->featureTable.flags.ftr57bGPUAddressing = (hwInfo->capabilityTable.gpuAddressSpace == maxNBitValue(57));
|
||||
|
||||
enableBlitterOperationsSupport(hwInfo);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2022-2024 Intel Corporation
|
||||
* Copyright (C) 2022-2025 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
|
@ -12,8 +12,6 @@
|
|||
namespace NEO {
|
||||
template <>
|
||||
int ProductHelperHw<gfxProduct>::configureHardwareCustom(HardwareInfo *hwInfo, OSInterface *osIface) const {
|
||||
enableCompression(hwInfo);
|
||||
|
||||
hwInfo->featureTable.flags.ftr57bGPUAddressing = (hwInfo->capabilityTable.gpuAddressSpace == maxNBitValue(57));
|
||||
|
||||
enableBlitterOperationsSupport(hwInfo);
|
||||
|
|
|
@ -16,14 +16,6 @@ constexpr static auto gfxProduct = IGFX_PVC;
|
|||
|
||||
namespace NEO {
|
||||
|
||||
template <>
|
||||
int ProductHelperHw<gfxProduct>::configureHardwareCustom(HardwareInfo *hwInfo, OSInterface *osIface) const {
|
||||
enableCompression(hwInfo);
|
||||
enableBlitterOperationsSupport(hwInfo);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
template class ProductHelperHw<gfxProduct>;
|
||||
|
||||
} // namespace NEO
|
||||
|
|
|
@ -21,7 +21,6 @@ namespace NEO {
|
|||
|
||||
template <>
|
||||
int ProductHelperHw<gfxProduct>::configureHardwareCustom(HardwareInfo *hwInfo, OSInterface *osIface) const {
|
||||
enableCompression(hwInfo);
|
||||
enableBlitterOperationsSupport(hwInfo);
|
||||
|
||||
hwInfo->workaroundTable.flags.wa_15010089951 = true;
|
||||
|
|
|
@ -25,7 +25,6 @@ bool ProductHelperHw<gfxProduct>::isDirectSubmissionSupported(ReleaseHelper *rel
|
|||
|
||||
template <>
|
||||
int ProductHelperHw<gfxProduct>::configureHardwareCustom(HardwareInfo *hwInfo, OSInterface *osIface) const {
|
||||
enableCompression(hwInfo);
|
||||
enableBlitterOperationsSupport(hwInfo);
|
||||
|
||||
hwInfo->workaroundTable.flags.wa_15010089951 = true;
|
||||
|
|
|
@ -49,4 +49,9 @@ bool ProductHelperHw<gfxProduct>::useGemCreateExtInAllocateMemoryByKMD() const {
|
|||
return true;
|
||||
}
|
||||
|
||||
template <>
|
||||
bool ProductHelperHw<gfxProduct>::isCompressionForbidden(const HardwareInfo &hwInfo) const {
|
||||
return isCompressionForbiddenCommon(true);
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
|
|
|
@ -341,10 +341,6 @@ template <>
|
|||
void ProductHelperHw<IGFX_UNKNOWN>::updateScmCommand(void *const commandPtr, const StateComputeModeProperties &properties) const {
|
||||
}
|
||||
|
||||
template <>
|
||||
void ProductHelperHw<IGFX_UNKNOWN>::enableCompression(HardwareInfo *hwInfo) const {
|
||||
}
|
||||
|
||||
template <>
|
||||
bool ProductHelperHw<IGFX_UNKNOWN>::isCooperativeEngineSupported(const HardwareInfo &hwInfo) const {
|
||||
return false;
|
||||
|
@ -504,6 +500,14 @@ bool ProductHelperHw<IGFX_UNKNOWN>::is48bResourceNeededForRayTracing() const {
|
|||
return true;
|
||||
}
|
||||
|
||||
template <>
|
||||
bool ProductHelperHw<IGFX_UNKNOWN>::isCompressionForbidden(const HardwareInfo &hwInfo) const {
|
||||
return false;
|
||||
}
|
||||
|
||||
template <>
|
||||
void ProductHelperHw<IGFX_UNKNOWN>::setRenderCompressedFlags(HardwareInfo &hwInfo) const {}
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
#include "shared/source/os_interface/product_helper.inl"
|
||||
|
|
|
@ -32,6 +32,7 @@ using IsBeforeXeHpcCore = IsBeforeGfxCore<IGFX_XE_HPC_CORE>;
|
|||
|
||||
using IsAtLeastXe2HpgCore = IsAtLeastGfxCore<IGFX_XE2_HPG_CORE>;
|
||||
using IsAtMostXe2HpgCore = IsAtMostGfxCore<IGFX_XE2_HPG_CORE>;
|
||||
using IsBeforeXe2HpgCore = IsBeforeGfxCore<IGFX_XE2_HPG_CORE>;
|
||||
using IsWithinXeHpCoreAndXe2HpgCore = IsWithinGfxCore<IGFX_XE_HP_CORE, IGFX_XE2_HPG_CORE>;
|
||||
using IsXeHpcCoreOrXe2HpgCore = IsAnyGfxCores<IGFX_XE_HPC_CORE, IGFX_XE2_HPG_CORE>;
|
||||
using IsWithinXeHpCoreAndXe3Core = IsWithinGfxCore<IGFX_XE_HP_CORE, IGFX_XE3_CORE>;
|
||||
|
|
|
@ -1,14 +1,11 @@
|
|||
/*
|
||||
* Copyright (C) 2019-2023 Intel Corporation
|
||||
* Copyright (C) 2019-2025 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/execution_environment/root_device_environment.h"
|
||||
#include "shared/source/gen12lp/hw_info_gen12lp.h"
|
||||
#include "shared/source/os_interface/os_interface.h"
|
||||
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
||||
#include "shared/test/common/libult/gen12lp/special_ult_helper_gen12lp.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"
|
||||
|
@ -17,20 +14,6 @@ using namespace NEO;
|
|||
|
||||
using Gen12lpProductHelperWindows = ProductHelperTestWindows;
|
||||
|
||||
GEN12LPTEST_F(Gen12lpProductHelperWindows, givenE2ECSetByKmdWhenConfiguringHwThenAdjustInternalImageFlag) {
|
||||
FeatureTable &localFeatureTable = outHwInfo.featureTable;
|
||||
|
||||
localFeatureTable.flags.ftrE2ECompression = true;
|
||||
productHelper->configureHardwareCustom(&outHwInfo, nullptr);
|
||||
EXPECT_TRUE(outHwInfo.capabilityTable.ftrRenderCompressedBuffers);
|
||||
EXPECT_TRUE(outHwInfo.capabilityTable.ftrRenderCompressedImages);
|
||||
|
||||
localFeatureTable.flags.ftrE2ECompression = false;
|
||||
productHelper->configureHardwareCustom(&outHwInfo, nullptr);
|
||||
EXPECT_FALSE(outHwInfo.capabilityTable.ftrRenderCompressedBuffers);
|
||||
EXPECT_FALSE(outHwInfo.capabilityTable.ftrRenderCompressedImages);
|
||||
}
|
||||
|
||||
GEN12LPTEST_F(Gen12lpProductHelperWindows, givenGen12LpProductWhenAdjustPlatformForProductFamilyCalledThenOverrideWithCorrectFamily) {
|
||||
|
||||
PLATFORM *testPlatform = &outHwInfo.platform;
|
||||
|
|
|
@ -9,8 +9,6 @@
|
|||
#include "shared/source/gmm_helper/resource_info.h"
|
||||
#include "shared/source/helpers/gfx_core_helper.h"
|
||||
#include "shared/source/helpers/hw_info.h"
|
||||
#include "shared/source/os_interface/product_helper.h"
|
||||
#include "shared/source/release_helper/release_helper.h"
|
||||
#include "shared/test/common/fixtures/device_fixture.h"
|
||||
#include "shared/test/common/fixtures/mock_execution_environment_gmm_fixture.h"
|
||||
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
||||
|
@ -18,7 +16,6 @@
|
|||
#include "shared/test/common/helpers/gtest_helpers.h"
|
||||
#include "shared/test/common/mocks/mock_execution_environment.h"
|
||||
#include "shared/test/common/mocks/mock_gmm.h"
|
||||
#include "shared/test/common/mocks/mock_gmm_resource_info.h"
|
||||
#include "shared/test/common/test_macros/hw_test.h"
|
||||
#include "shared/test/common/test_macros/test.h"
|
||||
#include "shared/test/unit_test/os_interface/product_helper_tests.h"
|
||||
|
@ -61,22 +58,6 @@ struct GmmAdditionalCompressionSettingsTests : public MockExecutionEnvironmentGm
|
|||
|
||||
using ProductHelperAtLeastXe2Tests = ::Test<DeviceFixture>;
|
||||
|
||||
HWTEST2_F(ProductHelperAtLeastXe2Tests, givenFtrXe2CompressionIsTrueWhenEnableCompressionThenSetCompression, IsAtLeastXe2HpgCore) {
|
||||
auto &productHelper = getHelper<ProductHelper>();
|
||||
auto hwInfo = this->hardwareInfo;
|
||||
hwInfo.featureTable.flags.ftrE2ECompression = true;
|
||||
hwInfo.featureTable.flags.ftrXe2Compression = false;
|
||||
productHelper.configureHardwareCustom(&hwInfo, nullptr);
|
||||
EXPECT_FALSE(hwInfo.capabilityTable.ftrRenderCompressedImages);
|
||||
EXPECT_FALSE(hwInfo.capabilityTable.ftrRenderCompressedBuffers);
|
||||
|
||||
hwInfo.featureTable.flags.ftrE2ECompression = false;
|
||||
hwInfo.featureTable.flags.ftrXe2Compression = true;
|
||||
productHelper.configureHardwareCustom(&hwInfo, nullptr);
|
||||
EXPECT_TRUE(hwInfo.capabilityTable.ftrRenderCompressedImages);
|
||||
EXPECT_TRUE(hwInfo.capabilityTable.ftrRenderCompressedBuffers);
|
||||
}
|
||||
|
||||
HWTEST2_F(GmmAdditionalCompressionSettingsTests, whenApplyAdditionalCompressionSettingsThenSetNotCompressed, IsAtLeastXe2HpgCore) {
|
||||
auto gmm = std::make_unique<MockGmm>(getGmmHelper());
|
||||
gmm->resourceParams.Flags.Info.NotCompressed = 0;
|
||||
|
|
|
@ -9,20 +9,16 @@
|
|||
|
||||
#include "shared/source/command_stream/preemption_mode.h"
|
||||
#include "shared/source/helpers/compiler_product_helper.h"
|
||||
#include "shared/source/helpers/constants.h"
|
||||
#include "shared/source/helpers/gfx_core_helper.h"
|
||||
#include "shared/source/os_interface/linux/i915.h"
|
||||
#include "shared/source/os_interface/os_interface.h"
|
||||
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
||||
#include "shared/test/common/helpers/default_hw_info.h"
|
||||
#include "shared/test/common/helpers/gfx_core_helper_tests.h"
|
||||
#include "shared/test/common/helpers/mock_product_helper_hw.h"
|
||||
#include "shared/test/common/helpers/raii_product_helper.h"
|
||||
#include "shared/test/common/helpers/unit_test_helper.h"
|
||||
#include "shared/test/common/helpers/variable_backup.h"
|
||||
#include "shared/test/common/mocks/mock_execution_environment.h"
|
||||
#include "shared/test/common/test_macros/hw_test.h"
|
||||
|
||||
#include <cstring>
|
||||
#include "shared/test/common/test_macros/test.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
|
@ -273,15 +269,6 @@ TEST_F(MockProductHelperTestLinux, GivenConfigPreemptionDrmEnabledAllPreemptionD
|
|||
EXPECT_TRUE(drm->isPreemptionSupported());
|
||||
}
|
||||
|
||||
TEST_F(MockProductHelperTestLinux, givenPlatformEnabledFtrCompressionWhenInitializingThenFlagsAreSet) {
|
||||
pInHwInfo.capabilityTable.ftrRenderCompressedImages = true;
|
||||
pInHwInfo.capabilityTable.ftrRenderCompressedBuffers = true;
|
||||
int ret = mockProductHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, *executionEnvironment->rootDeviceEnvironments[0].get());
|
||||
EXPECT_EQ(0, ret);
|
||||
EXPECT_TRUE(outHwInfo.capabilityTable.ftrRenderCompressedImages);
|
||||
EXPECT_TRUE(outHwInfo.capabilityTable.ftrRenderCompressedBuffers);
|
||||
}
|
||||
|
||||
TEST_F(MockProductHelperTestLinux, givenPointerToHwInfoWhenConfigureHwInfoCalledThenRequiedSurfaceSizeIsSettedProperly) {
|
||||
EXPECT_EQ(MemoryConstants::pageSize, pInHwInfo.capabilityTable.requiredPreemptionSurfaceSize);
|
||||
int ret = mockProductHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, *executionEnvironment->rootDeviceEnvironments[0].get());
|
||||
|
@ -335,6 +322,7 @@ TEST_F(MockProductHelperTestLinux, givenFailingGttSizeIoctlWhenInitializingHwInf
|
|||
EXPECT_NE(0u, outHwInfo.capabilityTable.gpuAddressSpace);
|
||||
EXPECT_EQ(pInHwInfo.capabilityTable.gpuAddressSpace, outHwInfo.capabilityTable.gpuAddressSpace);
|
||||
}
|
||||
|
||||
using HwConfigLinux = ::testing::Test;
|
||||
|
||||
HWTEST2_F(HwConfigLinux, givenPlatformWithPlatformQuerySupportedWhenItIsCalledThenReturnTrue, IsAtLeastMtl) {
|
||||
|
@ -352,3 +340,31 @@ HWTEST2_F(ProductHelperTest, givenProductHelperWhenIsPlatformQueryNotSupportedTh
|
|||
HWTEST2_F(ProductHelperTest, givenProductHelperWhenAskedIsDisableScratchPagesSupportedThenReturnTrue, IsAtLeastXeHpcCore) {
|
||||
EXPECT_TRUE(productHelper->isDisableScratchPagesSupported());
|
||||
}
|
||||
|
||||
HWTEST2_F(ProductHelperTestLinux, givenE2ECompressionWhenConfiguringHwInfoDrmThenCompressionFlagsAreCorrectlySet, IsBeforeXe2HpgCore) {
|
||||
pInHwInfo.featureTable.flags.ftrE2ECompression = true;
|
||||
int ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, *executionEnvironment->rootDeviceEnvironments[0].get());
|
||||
EXPECT_EQ(0, ret);
|
||||
EXPECT_TRUE(outHwInfo.capabilityTable.ftrRenderCompressedBuffers);
|
||||
EXPECT_TRUE(outHwInfo.capabilityTable.ftrRenderCompressedImages);
|
||||
|
||||
pInHwInfo.featureTable.flags.ftrE2ECompression = false;
|
||||
ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, *executionEnvironment->rootDeviceEnvironments[0].get());
|
||||
EXPECT_EQ(0, ret);
|
||||
EXPECT_FALSE(outHwInfo.capabilityTable.ftrRenderCompressedBuffers);
|
||||
EXPECT_FALSE(outHwInfo.capabilityTable.ftrRenderCompressedImages);
|
||||
}
|
||||
|
||||
HWTEST2_F(ProductHelperTestLinux, givenXe2CompressionWhenConfiguringHwInfoDrmThenCompressionFlagsAreCorrectlySet, IsAtLeastXe2HpgCore) {
|
||||
pInHwInfo.featureTable.flags.ftrXe2Compression = true;
|
||||
int ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, *executionEnvironment->rootDeviceEnvironments[0].get());
|
||||
EXPECT_EQ(0, ret);
|
||||
EXPECT_TRUE(outHwInfo.capabilityTable.ftrRenderCompressedBuffers);
|
||||
EXPECT_TRUE(outHwInfo.capabilityTable.ftrRenderCompressedImages);
|
||||
|
||||
pInHwInfo.featureTable.flags.ftrXe2Compression = false;
|
||||
ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, *executionEnvironment->rootDeviceEnvironments[0].get());
|
||||
EXPECT_EQ(0, ret);
|
||||
EXPECT_FALSE(outHwInfo.capabilityTable.ftrRenderCompressedBuffers);
|
||||
EXPECT_FALSE(outHwInfo.capabilityTable.ftrRenderCompressedImages);
|
||||
}
|
||||
|
|
|
@ -1136,3 +1136,22 @@ HWTEST2_F(ProductHelperTest, givenProductHelperWhenGetMaxLocalSubRegionSizeCalle
|
|||
auto hwInfo = *defaultHwInfo;
|
||||
EXPECT_EQ(0u, productHelper->getMaxLocalSubRegionSize(hwInfo));
|
||||
}
|
||||
|
||||
HWTEST_F(ProductHelperTest, givenProductHelperWhenCheckingIsCompressionForbiddenThenCorrectValueIsReturned) {
|
||||
DebugManagerStateRestore restore;
|
||||
auto hwInfo = *defaultHwInfo;
|
||||
|
||||
debugManager.flags.RenderCompressedImagesEnabled.set(0);
|
||||
debugManager.flags.RenderCompressedBuffersEnabled.set(0);
|
||||
EXPECT_TRUE(productHelper->isCompressionForbidden(hwInfo));
|
||||
|
||||
debugManager.flags.RenderCompressedImagesEnabled.set(1);
|
||||
EXPECT_FALSE(productHelper->isCompressionForbidden(hwInfo));
|
||||
|
||||
debugManager.flags.RenderCompressedImagesEnabled.set(0);
|
||||
debugManager.flags.RenderCompressedBuffersEnabled.set(1);
|
||||
EXPECT_FALSE(productHelper->isCompressionForbidden(hwInfo));
|
||||
|
||||
debugManager.flags.RenderCompressedImagesEnabled.set(1);
|
||||
EXPECT_FALSE(productHelper->isCompressionForbidden(hwInfo));
|
||||
}
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
#include "shared/source/os_interface/os_interface.h"
|
||||
#include "shared/source/os_interface/product_helper.h"
|
||||
#include "shared/source/os_interface/windows/wddm/wddm.h"
|
||||
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
||||
#include "shared/test/common/mocks/mock_execution_environment.h"
|
||||
#include "shared/test/common/test_macros/hw_test.h"
|
||||
|
||||
|
@ -93,4 +92,34 @@ HWTEST_F(ProductHelperTestWindows, givenFtrIaCoherencyFlagWhenConfiguringHwInfoT
|
|||
productHelper->configureHwInfoWddm(&initialHwInfo, &outHwInfo, *rootDeviceEnvironment.get());
|
||||
EXPECT_EQ(initialCoherencyStatus, outHwInfo.capabilityTable.ftrSupportsCoherency);
|
||||
}
|
||||
|
||||
HWTEST2_F(ProductHelperTestWindows, givenE2ECompressionWhenConfiguringHwInfoWddmThenCompressionFlagsAreCorrectlySet, IsBeforeXe2HpgCore) {
|
||||
HardwareInfo initialHwInfo = *defaultHwInfo;
|
||||
|
||||
outHwInfo.featureTable.flags.ftrE2ECompression = true;
|
||||
productHelper->configureHwInfoWddm(&initialHwInfo, &outHwInfo, *rootDeviceEnvironment.get());
|
||||
EXPECT_TRUE(outHwInfo.capabilityTable.ftrRenderCompressedBuffers);
|
||||
EXPECT_TRUE(outHwInfo.capabilityTable.ftrRenderCompressedImages);
|
||||
|
||||
outHwInfo.featureTable.flags.ftrE2ECompression = false;
|
||||
productHelper->configureHwInfoWddm(&initialHwInfo, &outHwInfo, *rootDeviceEnvironment.get());
|
||||
EXPECT_FALSE(outHwInfo.capabilityTable.ftrRenderCompressedBuffers);
|
||||
EXPECT_FALSE(outHwInfo.capabilityTable.ftrRenderCompressedImages);
|
||||
}
|
||||
|
||||
HWTEST2_F(ProductHelperTestWindows, givenE2ECompressionWhenConfiguringHwInfoWddmThenCompressionFlagsAreCorrectlySet, IsAtLeastXe2HpgCore) {
|
||||
HardwareInfo initialHwInfo = *defaultHwInfo;
|
||||
|
||||
outHwInfo.featureTable.flags.ftrXe2Compression = true;
|
||||
productHelper->configureHwInfoWddm(&initialHwInfo, &outHwInfo, *rootDeviceEnvironment.get());
|
||||
EXPECT_TRUE(outHwInfo.capabilityTable.ftrRenderCompressedBuffers);
|
||||
EXPECT_TRUE(outHwInfo.capabilityTable.ftrRenderCompressedImages);
|
||||
|
||||
outHwInfo.featureTable.flags.ftrXe2Compression = false;
|
||||
productHelper->configureHwInfoWddm(&initialHwInfo, &outHwInfo, *rootDeviceEnvironment.get());
|
||||
EXPECT_FALSE(outHwInfo.capabilityTable.ftrRenderCompressedBuffers);
|
||||
EXPECT_FALSE(outHwInfo.capabilityTable.ftrRenderCompressedImages);
|
||||
}
|
||||
|
||||
>>>>>>> c010d17842 (fix: respect compression flag in capability table)
|
||||
} // namespace NEO
|
||||
|
|
|
@ -10,10 +10,9 @@
|
|||
#include "shared/test/common/helpers/default_hw_info.h"
|
||||
#include "shared/test/common/helpers/gtest_helpers.h"
|
||||
#include "shared/test/common/os_interface/linux/drm_mock_extended.h"
|
||||
#include "shared/test/common/test_macros/header/per_product_test_definitions.h"
|
||||
#include "shared/test/unit_test/os_interface/linux/product_helper_linux_tests.h"
|
||||
|
||||
#include "per_product_test_definitions.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
struct ArlProductHelperLinux : ProductHelperTestLinux {
|
||||
|
@ -100,12 +99,7 @@ ARLTEST_F(ArlProductHelperLinux, givenBooleanUncachedWhenCallOverridePatIndexThe
|
|||
EXPECT_EQ(3u, productHelper->overridePatIndex(isUncached, patIndex, AllocationType::commandBuffer));
|
||||
}
|
||||
|
||||
ARLTEST_F(ArlProductHelperLinux, givenProductHelperWhenCallConfigureHardwareCustomThenCompressionIsDisabled) {
|
||||
ARLTEST_F(ArlProductHelperLinux, givenProductHelperThenCompressionIsNotAllowed) {
|
||||
auto hwInfo = *defaultHwInfo;
|
||||
hwInfo.featureTable.flags.ftrE2ECompression = true;
|
||||
|
||||
productHelper->configureHardwareCustom(&hwInfo, nullptr);
|
||||
|
||||
EXPECT_FALSE(hwInfo.capabilityTable.ftrRenderCompressedBuffers);
|
||||
EXPECT_FALSE(hwInfo.capabilityTable.ftrRenderCompressedImages);
|
||||
EXPECT_TRUE(productHelper->isCompressionForbidden(hwInfo));
|
||||
}
|
||||
|
|
|
@ -74,12 +74,7 @@ MTLTEST_F(MtlProductHelperLinux, givenBooleanUncachedWhenCallOverridePatIndexThe
|
|||
EXPECT_EQ(3u, productHelper->overridePatIndex(isUncached, patIndex, AllocationType::commandBuffer));
|
||||
}
|
||||
|
||||
MTLTEST_F(MtlProductHelperLinux, givenProductHelperWhenCallConfigureHardwareCustomThenCompressionIsDisabled) {
|
||||
MTLTEST_F(MtlProductHelperLinux, givenProductHelperThenCompressionIsNotAllowed) {
|
||||
auto hwInfo = *defaultHwInfo;
|
||||
hwInfo.featureTable.flags.ftrE2ECompression = true;
|
||||
|
||||
productHelper->configureHardwareCustom(&hwInfo, nullptr);
|
||||
|
||||
EXPECT_FALSE(hwInfo.capabilityTable.ftrRenderCompressedBuffers);
|
||||
EXPECT_FALSE(hwInfo.capabilityTable.ftrRenderCompressedImages);
|
||||
EXPECT_TRUE(productHelper->isCompressionForbidden(hwInfo));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue