diff --git a/opencl/test/unit_test/gen12lp/dg1/hw_helper_tests_dg1.cpp b/opencl/test/unit_test/gen12lp/dg1/hw_helper_tests_dg1.cpp index 65a18a4c59..b65ed2bd2c 100644 --- a/opencl/test/unit_test/gen12lp/dg1/hw_helper_tests_dg1.cpp +++ b/opencl/test/unit_test/gen12lp/dg1/hw_helper_tests_dg1.cpp @@ -108,3 +108,13 @@ DG1TEST_F(HwHelperTestDg1, givenDg1WhenGettingLocalMemoryAccessModeThenReturnCpu EXPECT_EQ(LocalMemoryAccessMode::Default, hwHelper.getDefaultLocalMemoryAccessMode(*defaultHwInfo)); } + +DG1TEST_F(HwHelperTestDg1, givenBufferAllocationTypeWhenSetExtraAllocationDataIsCalledThenIsLockableIsSet) { + auto &hwHelper = HwHelper::get(renderCoreFamily); + AllocationData allocData{}; + allocData.flags.useSystemMemory = true; + AllocationProperties allocProperties(0, 1, GraphicsAllocation::AllocationType::BUFFER, {}); + allocData.storageInfo.isLockable = false; + hwHelper.setExtraAllocationData(allocData, allocProperties, *defaultHwInfo); + EXPECT_TRUE(allocData.storageInfo.isLockable); +} diff --git a/shared/source/gen12lp/hw_helper_gen12lp.cpp b/shared/source/gen12lp/hw_helper_gen12lp.cpp index 7d2e3893c5..324598625d 100644 --- a/shared/source/gen12lp/hw_helper_gen12lp.cpp +++ b/shared/source/gen12lp/hw_helper_gen12lp.cpp @@ -291,6 +291,11 @@ void HwHelperHw::setExtraAllocationData(AllocationData &allocationD allocationData.flags.useSystemMemory = true; } } + if (IGFX_DG1 == hwInfo.platform.eProductFamily) { + if (properties.allocationType == GraphicsAllocation::AllocationType::BUFFER) { + allocationData.storageInfo.isLockable = true; + } + } } template class HwHelperHw; diff --git a/shared/source/memory_manager/definitions/storage_info.h b/shared/source/memory_manager/definitions/storage_info.h index 54f22679b2..9c642fcac5 100644 --- a/shared/source/memory_manager/definitions/storage_info.h +++ b/shared/source/memory_manager/definitions/storage_info.h @@ -12,5 +12,6 @@ struct StorageInfo { uint32_t getNumBanks() const; uint32_t getMemoryBanks() const { return 0u; } bool multiStorage = false; + bool isLockable = false; }; } // namespace NEO