From 0df7e3279ec6a9ed5509b0d9fa3851642d86cc4a Mon Sep 17 00:00:00 2001 From: Mateusz Jablonski Date: Wed, 30 Aug 2023 14:41:51 +0000 Subject: [PATCH] refactor: remove not needed logic around DisallowLowQualityFiltering Signed-off-by: Mateusz Jablonski --- shared/source/gen11/image_core_gen11.cpp | 5 +-- shared/source/gen12lp/image_core_gen12lp.cpp | 5 +-- shared/source/gen8/image_core_gen8.cpp | 6 +-- shared/source/gen9/image_core_gen9.cpp | 5 +-- .../hw_cmds_generated_xe_hpg_core.inl | 4 +- shared/source/image/CMakeLists.txt | 3 +- shared/source/image/image_bdw_and_later.inl | 9 ---- shared/source/image/image_surface_state.h | 4 -- .../xe_hpc_core/image_core_xe_hpc_core.cpp | 5 +-- .../xe_hpg_core/image_core_xe_hpg_core.cpp | 8 +--- .../unit_test/xe_hpg_core/mtl/CMakeLists.txt | 1 - .../mtl/test_image_surface_state_mtl.cpp | 44 ------------------- 12 files changed, 10 insertions(+), 89 deletions(-) delete mode 100644 shared/source/image/image_bdw_and_later.inl delete mode 100644 shared/test/unit_test/xe_hpg_core/mtl/test_image_surface_state_mtl.cpp diff --git a/shared/source/gen11/image_core_gen11.cpp b/shared/source/gen11/image_core_gen11.cpp index f8f87f7633..5b86e5faf8 100644 --- a/shared/source/gen11/image_core_gen11.cpp +++ b/shared/source/gen11/image_core_gen11.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2022 Intel Corporation + * Copyright (C) 2020-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -12,8 +12,5 @@ namespace NEO { typedef Gen11Family Family; -// clang-format off -#include "shared/source/image/image_bdw_and_later.inl" #include "shared/source/image/image_skl_and_later.inl" -// clang-format on } // namespace NEO diff --git a/shared/source/gen12lp/image_core_gen12lp.cpp b/shared/source/gen12lp/image_core_gen12lp.cpp index ad59fabf6c..b941a30462 100644 --- a/shared/source/gen12lp/image_core_gen12lp.cpp +++ b/shared/source/gen12lp/image_core_gen12lp.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2022 Intel Corporation + * Copyright (C) 2020-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -12,8 +12,5 @@ namespace NEO { using Family = Gen12LpFamily; -// clang-format off -#include "shared/source/image/image_bdw_and_later.inl" #include "shared/source/image/image_skl_and_later.inl" -// clang-format on } // namespace NEO diff --git a/shared/source/gen8/image_core_gen8.cpp b/shared/source/gen8/image_core_gen8.cpp index 91a9ae01fd..c396cfd2e4 100644 --- a/shared/source/gen8/image_core_gen8.cpp +++ b/shared/source/gen8/image_core_gen8.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2022 Intel Corporation + * Copyright (C) 2020-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -14,8 +14,4 @@ typedef Gen8Family Family; template <> void setMipTailStartLod(Family::RENDER_SURFACE_STATE *surfaceState, Gmm *gmm) {} - -// clang-format off -#include "shared/source/image/image_bdw_and_later.inl" -// clang-format on } // namespace NEO diff --git a/shared/source/gen9/image_core_gen9.cpp b/shared/source/gen9/image_core_gen9.cpp index e96c2155ab..f03b072505 100644 --- a/shared/source/gen9/image_core_gen9.cpp +++ b/shared/source/gen9/image_core_gen9.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2022 Intel Corporation + * Copyright (C) 2020-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -12,8 +12,5 @@ namespace NEO { typedef Gen9Family Family; -// clang-format off -#include "shared/source/image/image_bdw_and_later.inl" #include "shared/source/image/image_skl_and_later.inl" -// clang-format on } // namespace NEO diff --git a/shared/source/generated/xe_hpg_core/hw_cmds_generated_xe_hpg_core.inl b/shared/source/generated/xe_hpg_core/hw_cmds_generated_xe_hpg_core.inl index f486706d91..f396f53c09 100644 --- a/shared/source/generated/xe_hpg_core/hw_cmds_generated_xe_hpg_core.inl +++ b/shared/source/generated/xe_hpg_core/hw_cmds_generated_xe_hpg_core.inl @@ -1728,6 +1728,7 @@ typedef struct tagRENDER_SURFACE_STATE { TheStructure.Common.MemoryCompressionType = MEMORY_COMPRESSION_TYPE_MEDIA_COMPRESSION; TheStructure._SurfaceFormatIsPlanar.HalfPitchForChroma = HALF_PITCH_FOR_CHROMA_DISABLE; TheStructure._SurfaceFormatIsnotPlanar.AuxiliarySurfaceMode = AUXILIARY_SURFACE_MODE_AUX_NONE; + TheStructure.Common.DisallowLowQualityFiltering = false; } static tagRENDER_SURFACE_STATE sInit() { RENDER_SURFACE_STATE state; @@ -2128,7 +2129,8 @@ typedef struct tagRENDER_SURFACE_STATE { inline uint32_t getClearColorAddressHigh() const { // patched return TheStructure.Common.ClearAddressHigh; } - inline void setDisallowLowQualityFiltering(const bool value) { + inline void setDisallowLowQualityFiltering(const bool value) { // patched + UNRECOVERABLE_IF(true); TheStructure.Common.DisallowLowQualityFiltering = value; } inline bool getDisallowLowQualityFiltering() const { diff --git a/shared/source/image/CMakeLists.txt b/shared/source/image/CMakeLists.txt index 1cd90277b9..2611f81940 100644 --- a/shared/source/image/CMakeLists.txt +++ b/shared/source/image/CMakeLists.txt @@ -1,5 +1,5 @@ # -# Copyright (C) 2020-2021 Intel Corporation +# Copyright (C) 2020-2023 Intel Corporation # # SPDX-License-Identifier: MIT # @@ -7,7 +7,6 @@ set(NEO_CORE_IMAGE ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt ${CMAKE_CURRENT_SOURCE_DIR}/image_surface_state.h - ${CMAKE_CURRENT_SOURCE_DIR}/image_bdw_and_later.inl ${CMAKE_CURRENT_SOURCE_DIR}/image_skl_and_later.inl ) diff --git a/shared/source/image/image_bdw_and_later.inl b/shared/source/image/image_bdw_and_later.inl deleted file mode 100644 index 7e49cf6dab..0000000000 --- a/shared/source/image/image_bdw_and_later.inl +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Copyright (C) 2020-2021 Intel Corporation - * - * SPDX-License-Identifier: MIT - * - */ - -template <> -void setFilterMode(typename Family::RENDER_SURFACE_STATE *surfaceState, const HardwareInfo *hwInfo){}; diff --git a/shared/source/image/image_surface_state.h b/shared/source/image/image_surface_state.h index 2b5236d330..f50852ce4c 100644 --- a/shared/source/image/image_surface_state.h +++ b/shared/source/image/image_surface_state.h @@ -15,9 +15,6 @@ #include "shared/source/helpers/surface_format_info.h" namespace NEO { -template -void setFilterMode(typename GfxFamily::RENDER_SURFACE_STATE *surfaceState, const HardwareInfo *hwInfo); - template inline void setImageSurfaceState(typename GfxFamily::RENDER_SURFACE_STATE *surfaceState, const ImageInfo &imageInfo, Gmm *gmm, GmmHelper &gmmHelper, uint32_t cubeFaceIndex, uint64_t gpuAddress, const SurfaceOffsets &surfaceOffsets, bool isNV12Format) { using RENDER_SURFACE_STATE = typename GfxFamily::RENDER_SURFACE_STATE; @@ -92,7 +89,6 @@ inline void setImageSurfaceState(typename GfxFamily::RENDER_SURFACE_STATE *surfa } surfaceState->setSurfaceFormat(static_cast(imageInfo.surfaceFormat->genxSurfaceFormat)); - setFilterMode(surfaceState, gmmHelper.getHardwareInfo()); } template diff --git a/shared/source/xe_hpc_core/image_core_xe_hpc_core.cpp b/shared/source/xe_hpc_core/image_core_xe_hpc_core.cpp index cef29ca944..b63dc86750 100644 --- a/shared/source/xe_hpc_core/image_core_xe_hpc_core.cpp +++ b/shared/source/xe_hpc_core/image_core_xe_hpc_core.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021-2022 Intel Corporation + * Copyright (C) 2021-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -12,8 +12,5 @@ namespace NEO { using Family = XeHpcCoreFamily; -// clang-format off -#include "shared/source/image/image_bdw_and_later.inl" #include "shared/source/image/image_skl_and_later.inl" -// clang-format on } // namespace NEO diff --git a/shared/source/xe_hpg_core/image_core_xe_hpg_core.cpp b/shared/source/xe_hpg_core/image_core_xe_hpg_core.cpp index dcfe89632c..8be82b7e1b 100644 --- a/shared/source/xe_hpg_core/image_core_xe_hpg_core.cpp +++ b/shared/source/xe_hpg_core/image_core_xe_hpg_core.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021-2022 Intel Corporation + * Copyright (C) 2021-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -12,11 +12,5 @@ namespace NEO { using Family = XeHpgCoreFamily; -template <> -void setFilterMode(Family::RENDER_SURFACE_STATE *surfaceState, const HardwareInfo *hwInfo) { - surfaceState->setDisallowLowQualityFiltering(false); -} -// clang-format off #include "shared/source/image/image_skl_and_later.inl" -// clang-format on } // namespace NEO diff --git a/shared/test/unit_test/xe_hpg_core/mtl/CMakeLists.txt b/shared/test/unit_test/xe_hpg_core/mtl/CMakeLists.txt index 0f7ae52788..77e6b8a885 100644 --- a/shared/test/unit_test/xe_hpg_core/mtl/CMakeLists.txt +++ b/shared/test/unit_test/xe_hpg_core/mtl/CMakeLists.txt @@ -20,7 +20,6 @@ if(TESTS_MTL) ${CMAKE_CURRENT_SOURCE_DIR}/product_config_helper_tests_mtl.cpp ${CMAKE_CURRENT_SOURCE_DIR}/test_device_caps_mtl.cpp ${CMAKE_CURRENT_SOURCE_DIR}/test_encode_dispatch_kernel_mtl.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test_image_surface_state_mtl.cpp ) add_subdirectories() diff --git a/shared/test/unit_test/xe_hpg_core/mtl/test_image_surface_state_mtl.cpp b/shared/test/unit_test/xe_hpg_core/mtl/test_image_surface_state_mtl.cpp deleted file mode 100644 index 8fa8228dd9..0000000000 --- a/shared/test/unit_test/xe_hpg_core/mtl/test_image_surface_state_mtl.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (C) 2022-2023 Intel Corporation - * - * SPDX-License-Identifier: MIT - * - */ - -#include "shared/source/xe_hpg_core/hw_cmds_mtl.h" -#include "shared/test/common/test_macros/header/per_product_test_definitions.h" -#include "shared/test/unit_test/image/image_surface_state_fixture.h" - -using namespace NEO; - -using ImageSurfaceStateTestsMtl = ImageSurfaceStateTests; - -MTLTEST_F(ImageSurfaceStateTestsMtl, givenMtlWhenCallSetFilterModeThenDisallowLowQualityFliteringIsAllwaysFalse) { - auto size = sizeof(typename FamilyType::RENDER_SURFACE_STATE); - auto surfaceState = std::make_unique(size); - auto castSurfaceState = reinterpret_cast(surfaceState.get()); - - setFilterMode(castSurfaceState, &pDevice->getHardwareInfo()); - EXPECT_FALSE(castSurfaceState->getDisallowLowQualityFiltering()); -} - -MTLTEST_F(ImageSurfaceStateTestsMtl, givenMtlWhenCallSetImageSurfaceStateThenDisallowLowQualityFliteringIsAllwaysFalse) { - auto size = sizeof(typename FamilyType::RENDER_SURFACE_STATE); - auto surfaceState = std::make_unique(size); - auto castSurfaceState = reinterpret_cast(surfaceState.get()); - const uint32_t cubeFaceIndex = 2u; - - SurfaceFormatInfo surfaceFormatInfo; - surfaceFormatInfo.genxSurfaceFormat = GFX3DSTATE_SURFACEFORMAT::GFX3DSTATE_SURFACEFORMAT_A32_FLOAT; - imageInfo.surfaceFormat = &surfaceFormatInfo; - SurfaceOffsets surfaceOffsets; - surfaceOffsets.offset = 0u; - surfaceOffsets.xOffset = 11u; - surfaceOffsets.yOffset = 12u; - surfaceOffsets.yOffsetForUVplane = 13u; - - const uint64_t gpuAddress = 0x000001a78a8a8000; - - setImageSurfaceState(castSurfaceState, imageInfo, mockGmm.get(), *gmmHelper, cubeFaceIndex, gpuAddress, surfaceOffsets, true); - EXPECT_FALSE(castSurfaceState->getDisallowLowQualityFiltering()); -}