From d55afceb8b49c55368d49d21b51f0d229f229849 Mon Sep 17 00:00:00 2001 From: Szymon Morek Date: Mon, 10 May 2021 16:03:59 +0000 Subject: [PATCH] Additional method to disable compression Resolves: NEO-5828 Signed-off-by: Szymon Morek --- shared/source/gmm_helper/gmm.cpp | 4 +++- shared/source/helpers/hw_helper.h | 4 ++++ shared/source/helpers/hw_helper_base.inl | 3 +++ shared/source/os_interface/hw_info_config.inl | 6 ------ shared/source/os_interface/hw_info_config_bdw_plus.inl | 6 ++++++ 5 files changed, 16 insertions(+), 7 deletions(-) diff --git a/shared/source/gmm_helper/gmm.cpp b/shared/source/gmm_helper/gmm.cpp index 9ab4429c8a..ec4dd0758d 100644 --- a/shared/source/gmm_helper/gmm.cpp +++ b/shared/source/gmm_helper/gmm.cpp @@ -125,7 +125,8 @@ void Gmm::setupImageResourceParams(ImageInfo &imgInfo) { } void Gmm::applyAuxFlagsForBuffer(bool preferRenderCompression) { - bool allowRenderCompression = HwHelper::renderCompressedBuffersSupported(*clientContext->getHardwareInfo()) && + auto hardwareInfo = clientContext->getHardwareInfo(); + bool allowRenderCompression = HwHelper::renderCompressedBuffersSupported(*hardwareInfo) && preferRenderCompression; if (allowRenderCompression) { @@ -134,6 +135,7 @@ void Gmm::applyAuxFlagsForBuffer(bool preferRenderCompression) { resourceParams.Flags.Gpu.UnifiedAuxSurface = 1; isRenderCompressed = true; } + HwHelper::get(hardwareInfo->platform.eRenderCoreFamily).applyAdditionalCompressionSettings(*this, !isRenderCompressed); } void Gmm::queryImageParams(ImageInfo &imgInfo) { diff --git a/shared/source/helpers/hw_helper.h b/shared/source/helpers/hw_helper.h index f2360eee30..a82652ec7b 100644 --- a/shared/source/helpers/hw_helper.h +++ b/shared/source/helpers/hw_helper.h @@ -28,6 +28,7 @@ namespace NEO { class GmmHelper; class GraphicsAllocation; class TagAllocatorBase; +class Gmm; struct AllocationData; struct AllocationProperties; struct EngineControl; @@ -154,6 +155,7 @@ class HwHelper { DeviceBitfield deviceBitfield) const = 0; virtual size_t getTimestampPacketAllocatorAlignment() const = 0; virtual size_t getSingleTimestampPacketSize() const = 0; + virtual void applyAdditionalCompressionSettings(Gmm &gmm, bool isNotCompressed) const = 0; static uint32_t getSubDevicesCount(const HardwareInfo *pHwInfo); static uint32_t getEnginesCount(const HardwareInfo &hwInfo); @@ -384,6 +386,8 @@ class HwHelperHw : public HwHelper { size_t getSingleTimestampPacketSize() const override; + void applyAdditionalCompressionSettings(Gmm &gmm, bool isNotCompressed) const override; + protected: LocalMemoryAccessMode getDefaultLocalMemoryAccessMode(const HardwareInfo &hwInfo) const override; diff --git a/shared/source/helpers/hw_helper_base.inl b/shared/source/helpers/hw_helper_base.inl index c156b64111..7389789690 100644 --- a/shared/source/helpers/hw_helper_base.inl +++ b/shared/source/helpers/hw_helper_base.inl @@ -656,4 +656,7 @@ size_t HwHelperHw::getPreemptionAllocationAlignment() const { return 256 * MemoryConstants::kiloByte; } +template +void HwHelperHw::applyAdditionalCompressionSettings(Gmm &gmm, bool isNotCompressed) const {} + } // namespace NEO diff --git a/shared/source/os_interface/hw_info_config.inl b/shared/source/os_interface/hw_info_config.inl index 5c199f8964..bd8454a3de 100644 --- a/shared/source/os_interface/hw_info_config.inl +++ b/shared/source/os_interface/hw_info_config.inl @@ -40,12 +40,6 @@ void HwInfoConfigHw::adjustPlatformForProductFamily(HardwareInfo *hw template void HwInfoConfigHw::adjustSamplerState(void *sampler, const HardwareInfo &hwInfo) {} -template -void HwInfoConfigHw::enableRenderCompression(HardwareInfo *hwInfo) { - hwInfo->capabilityTable.ftrRenderCompressedImages = hwInfo->featureTable.ftrE2ECompression; - hwInfo->capabilityTable.ftrRenderCompressedBuffers = hwInfo->featureTable.ftrE2ECompression; -} - template void HwInfoConfigHw::enableBlitterOperationsSupport(HardwareInfo *hwInfo) { hwInfo->capabilityTable.blitterOperationsSupported = HwHelper::get(hwInfo->platform.eRenderCoreFamily).obtainBlitterPreference(*hwInfo); diff --git a/shared/source/os_interface/hw_info_config_bdw_plus.inl b/shared/source/os_interface/hw_info_config_bdw_plus.inl index c127b24f68..91611a560e 100644 --- a/shared/source/os_interface/hw_info_config_bdw_plus.inl +++ b/shared/source/os_interface/hw_info_config_bdw_plus.inl @@ -19,4 +19,10 @@ uint64_t HwInfoConfigHw::getCrossDeviceSharedMemCapabilities() { return 0; } +template +void HwInfoConfigHw::enableRenderCompression(HardwareInfo *hwInfo) { + hwInfo->capabilityTable.ftrRenderCompressedImages = hwInfo->featureTable.ftrE2ECompression; + hwInfo->capabilityTable.ftrRenderCompressedBuffers = hwInfo->featureTable.ftrE2ECompression; +} + } // namespace NEO