diff --git a/level_zero/core/test/unit_tests/mocks/mock_device_for_spirv.cpp b/level_zero/core/test/unit_tests/mocks/mock_device_for_spirv.cpp index 57ba059a83..19fd2e5ca5 100644 --- a/level_zero/core/test/unit_tests/mocks/mock_device_for_spirv.cpp +++ b/level_zero/core/test/unit_tests/mocks/mock_device_for_spirv.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2022 Intel Corporation + * Copyright (C) 2020-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -21,7 +21,7 @@ ze_result_t MockDeviceForSpv::createModule(const ze_module_build_log_handle_t *buildLog, ModuleType type) { const std::string builtinCopyfill("builtin_copyfill"); const std::string builtinImages("builtin_images"); - if ((wasModuleCreated) && ((useImagesBuiltins != useImagesBuiltins_prev) || (isStateless != isStateless_prev))) + if ((wasModuleCreated) && ((useImagesBuiltins != useImagesBuiltinsPrev) || (isStateless != isStatelessPrev))) wasModuleCreated = false; if (!wasModuleCreated) { @@ -44,8 +44,8 @@ ze_result_t MockDeviceForSpv::createModule(const ze_result_t result = ZE_RESULT_SUCCESS; mockModulePtr.reset(Module::create(this, &moduleDesc, moduleBuildLog, ModuleType::Builtin, &result)); wasModuleCreated = true; - useImagesBuiltins_prev = useImagesBuiltins; - isStateless_prev = isStateless; + useImagesBuiltinsPrev = useImagesBuiltins; + isStatelessPrev = isStateless; } *module = mockModulePtr.get(); return ZE_RESULT_SUCCESS; diff --git a/level_zero/core/test/unit_tests/mocks/mock_device_for_spirv.h b/level_zero/core/test/unit_tests/mocks/mock_device_for_spirv.h index d718948c51..51e4fd227f 100644 --- a/level_zero/core/test/unit_tests/mocks/mock_device_for_spirv.h +++ b/level_zero/core/test/unit_tests/mocks/mock_device_for_spirv.h @@ -18,8 +18,8 @@ template class MockDeviceForSpv : public Mock { protected: bool wasModuleCreated = false; - bool useImagesBuiltins_prev = false; - bool isStateless_prev = false; + bool useImagesBuiltinsPrev = false; + bool isStatelessPrev = false; std::unique_ptr mockModulePtr; public: diff --git a/level_zero/core/test/unit_tests/sources/tracing/test_image_api_tracing.cpp b/level_zero/core/test/unit_tests/sources/tracing/test_image_api_tracing.cpp index a95a015352..561beeb3d1 100644 --- a/level_zero/core/test/unit_tests/sources/tracing/test_image_api_tracing.cpp +++ b/level_zero/core/test/unit_tests/sources/tracing/test_image_api_tracing.cpp @@ -63,10 +63,10 @@ TEST_F(ZeApiTracingRuntimeTests, WhenCallingImageDestroyTracingWrapperWithOneSet struct { ze_device_handle_t hDevice0; ze_image_desc_t desc0; - ze_image_properties_t ImageProperties0; + ze_image_properties_t imageProperties0; ze_device_handle_t hDevice1; ze_image_desc_t desc1; - ze_image_properties_t ImageProperties1; + ze_image_properties_t imageProperties1; void *instanceData0; void *instanceData3; } ImageGetProperties_args; @@ -88,7 +88,7 @@ TEST_F(ZeApiTracingRuntimeMultipleArgumentsTests, WhenCallingImageGetPropertiesT [](ze_device_handle_t hDevice, const ze_image_desc_t *desc, ze_image_properties_t *pImageProperties) { EXPECT_EQ(ImageGetProperties_args.hDevice1, hDevice); EXPECT_EQ(&ImageGetProperties_args.desc1, desc); - EXPECT_EQ(&ImageGetProperties_args.ImageProperties1, pImageProperties); + EXPECT_EQ(&ImageGetProperties_args.imageProperties1, pImageProperties); return ZE_RESULT_SUCCESS; }; @@ -100,10 +100,10 @@ TEST_F(ZeApiTracingRuntimeMultipleArgumentsTests, WhenCallingImageGetPropertiesT [](ze_image_get_properties_params_t *params, ze_result_t result, void *pTracerUserData, void **ppTracerInstanceUserData) { EXPECT_EQ(ImageGetProperties_args.hDevice0, *params->phDevice); EXPECT_EQ(&ImageGetProperties_args.desc0, *params->pdesc); - EXPECT_EQ(&ImageGetProperties_args.ImageProperties0, *params->ppImageProperties); + EXPECT_EQ(&ImageGetProperties_args.imageProperties0, *params->ppImageProperties); *params->phDevice = ImageGetProperties_args.hDevice1; *params->pdesc = &ImageGetProperties_args.desc1; - *params->ppImageProperties = &ImageGetProperties_args.ImageProperties1; + *params->ppImageProperties = &ImageGetProperties_args.imageProperties1; ASSERT_NE(nullptr, pTracerUserData); int *val = static_cast(pTracerUserData); EXPECT_EQ(*val, 1); @@ -123,7 +123,7 @@ TEST_F(ZeApiTracingRuntimeMultipleArgumentsTests, WhenCallingImageGetPropertiesT EXPECT_EQ(result, ZE_RESULT_SUCCESS); EXPECT_EQ(ImageGetProperties_args.hDevice1, *params->phDevice); EXPECT_EQ(&ImageGetProperties_args.desc1, *params->pdesc); - EXPECT_EQ(&ImageGetProperties_args.ImageProperties1, *params->ppImageProperties); + EXPECT_EQ(&ImageGetProperties_args.imageProperties1, *params->ppImageProperties); ASSERT_NE(nullptr, pTracerUserData); int *val = static_cast(pTracerUserData); EXPECT_EQ(*val, 2); @@ -141,7 +141,7 @@ TEST_F(ZeApiTracingRuntimeMultipleArgumentsTests, WhenCallingImageGetPropertiesT [](ze_image_get_properties_params_t *params, ze_result_t result, void *pTracerUserData, void **ppTracerInstanceUserData) { EXPECT_EQ(ImageGetProperties_args.hDevice1, *params->phDevice); EXPECT_EQ(&ImageGetProperties_args.desc1, *params->pdesc); - EXPECT_EQ(&ImageGetProperties_args.ImageProperties1, *params->ppImageProperties); + EXPECT_EQ(&ImageGetProperties_args.imageProperties1, *params->ppImageProperties); ASSERT_NE(nullptr, pTracerUserData); int *val = static_cast(pTracerUserData); EXPECT_EQ(*val, 11); @@ -157,7 +157,7 @@ TEST_F(ZeApiTracingRuntimeMultipleArgumentsTests, WhenCallingImageGetPropertiesT EXPECT_EQ(result, ZE_RESULT_SUCCESS); EXPECT_EQ(ImageGetProperties_args.hDevice1, *params->phDevice); EXPECT_EQ(&ImageGetProperties_args.desc1, *params->pdesc); - EXPECT_EQ(&ImageGetProperties_args.ImageProperties1, *params->ppImageProperties); + EXPECT_EQ(&ImageGetProperties_args.imageProperties1, *params->ppImageProperties); ASSERT_NE(nullptr, pTracerUserData); int *val = static_cast(pTracerUserData); EXPECT_EQ(*val, 21); @@ -172,7 +172,7 @@ TEST_F(ZeApiTracingRuntimeMultipleArgumentsTests, WhenCallingImageGetPropertiesT [](ze_image_get_properties_params_t *params, ze_result_t result, void *pTracerUserData, void **ppTracerInstanceUserData) { EXPECT_EQ(ImageGetProperties_args.hDevice1, *params->phDevice); EXPECT_EQ(&ImageGetProperties_args.desc1, *params->pdesc); - EXPECT_EQ(&ImageGetProperties_args.ImageProperties1, *params->ppImageProperties); + EXPECT_EQ(&ImageGetProperties_args.imageProperties1, *params->ppImageProperties); ASSERT_NE(nullptr, pTracerUserData); int *val = static_cast(pTracerUserData); EXPECT_EQ(*val, 31); @@ -192,7 +192,7 @@ TEST_F(ZeApiTracingRuntimeMultipleArgumentsTests, WhenCallingImageGetPropertiesT EXPECT_EQ(result, ZE_RESULT_SUCCESS); EXPECT_EQ(ImageGetProperties_args.hDevice1, *params->phDevice); EXPECT_EQ(&ImageGetProperties_args.desc1, *params->pdesc); - EXPECT_EQ(&ImageGetProperties_args.ImageProperties1, *params->ppImageProperties); + EXPECT_EQ(&ImageGetProperties_args.imageProperties1, *params->ppImageProperties); ASSERT_NE(nullptr, pTracerUserData); int *val = static_cast(pTracerUserData); EXPECT_EQ(*val, 62); @@ -204,7 +204,7 @@ TEST_F(ZeApiTracingRuntimeMultipleArgumentsTests, WhenCallingImageGetPropertiesT setTracerCallbacksAndEnableTracer(); - result = zeImageGetPropertiesTracing(ImageGetProperties_args.hDevice0, &ImageGetProperties_args.desc0, &ImageGetProperties_args.ImageProperties0); + result = zeImageGetPropertiesTracing(ImageGetProperties_args.hDevice0, &ImageGetProperties_args.desc0, &ImageGetProperties_args.imageProperties0); EXPECT_EQ(ZE_RESULT_SUCCESS, result); validateDefaultUserDataFinal(); } diff --git a/level_zero/core/test/unit_tests/sources/tracing/test_sampler_api_tracing.cpp b/level_zero/core/test/unit_tests/sources/tracing/test_sampler_api_tracing.cpp index 61fb9db2cc..f964698bf3 100644 --- a/level_zero/core/test/unit_tests/sources/tracing/test_sampler_api_tracing.cpp +++ b/level_zero/core/test/unit_tests/sources/tracing/test_sampler_api_tracing.cpp @@ -41,11 +41,11 @@ TEST_F(ZeApiTracingRuntimeTests, WhenCallingSamplerDestroyTracingWrapperWithOneS struct { ze_context_handle_t hContext0; ze_device_handle_t hDevice0; - ze_sampler_desc_t Desc0; + ze_sampler_desc_t desc0; ze_sampler_handle_t hSampler0; ze_context_handle_t hContext1; ze_device_handle_t hDevice1; - ze_sampler_desc_t Desc1; + ze_sampler_desc_t desc1; ze_sampler_handle_t hSampler1; ze_sampler_handle_t hSamplerAPI; void *instanceData0; @@ -75,7 +75,7 @@ TEST_F(ZeApiTracingRuntimeMultipleArgumentsTests, [](ze_context_handle_t hContext, ze_device_handle_t hDevice, const ze_sampler_desc_t *pDesc, ze_sampler_handle_t *phSampler) { EXPECT_EQ(sampler_create_args.hContext1, hContext); EXPECT_EQ(sampler_create_args.hDevice1, hDevice); - EXPECT_EQ(&sampler_create_args.Desc1, pDesc); + EXPECT_EQ(&sampler_create_args.desc1, pDesc); EXPECT_EQ(&sampler_create_args.hSampler1, phSampler); EXPECT_EQ(sampler_create_args.hSampler1, *phSampler); sampler_create_args.hSamplerAPI = generateRandomHandle(); @@ -91,7 +91,7 @@ TEST_F(ZeApiTracingRuntimeMultipleArgumentsTests, [](ze_sampler_create_params_t *params, ze_result_t result, void *pTracerUserData, void **ppTracerInstanceUserData) { EXPECT_EQ(sampler_create_args.hContext0, *params->phContext); EXPECT_EQ(sampler_create_args.hDevice0, *params->phDevice); - EXPECT_EQ(&sampler_create_args.Desc0, *params->pdesc); + EXPECT_EQ(&sampler_create_args.desc0, *params->pdesc); EXPECT_EQ(&sampler_create_args.hSampler0, *params->pphSampler); ze_sampler_handle_t **ppHandle; @@ -109,7 +109,7 @@ TEST_F(ZeApiTracingRuntimeMultipleArgumentsTests, EXPECT_EQ(sampler_create_args.hSampler0, handle); *params->phContext = sampler_create_args.hContext1; *params->phDevice = sampler_create_args.hDevice1; - *params->pdesc = &sampler_create_args.Desc1; + *params->pdesc = &sampler_create_args.desc1; *params->pphSampler = &sampler_create_args.hSampler1; ASSERT_NE(nullptr, pTracerUserData); int *val = static_cast(pTracerUserData); @@ -130,7 +130,7 @@ TEST_F(ZeApiTracingRuntimeMultipleArgumentsTests, EXPECT_EQ(result, ZE_RESULT_SUCCESS); EXPECT_EQ(sampler_create_args.hContext1, *params->phContext); EXPECT_EQ(sampler_create_args.hDevice1, *params->phDevice); - EXPECT_EQ(&sampler_create_args.Desc1, *params->pdesc); + EXPECT_EQ(&sampler_create_args.desc1, *params->pdesc); EXPECT_EQ(&sampler_create_args.hSampler1, *params->pphSampler); ze_sampler_handle_t **ppHandle; @@ -163,7 +163,7 @@ TEST_F(ZeApiTracingRuntimeMultipleArgumentsTests, [](ze_sampler_create_params_t *params, ze_result_t result, void *pTracerUserData, void **ppTracerInstanceUserData) { EXPECT_EQ(sampler_create_args.hContext1, *params->phContext); EXPECT_EQ(sampler_create_args.hDevice1, *params->phDevice); - EXPECT_EQ(&sampler_create_args.Desc1, *params->pdesc); + EXPECT_EQ(&sampler_create_args.desc1, *params->pdesc); EXPECT_EQ(&sampler_create_args.hSampler1, *params->pphSampler); ze_sampler_handle_t **ppHandle; @@ -194,7 +194,7 @@ TEST_F(ZeApiTracingRuntimeMultipleArgumentsTests, EXPECT_EQ(result, ZE_RESULT_SUCCESS); EXPECT_EQ(sampler_create_args.hContext1, *params->phContext); EXPECT_EQ(sampler_create_args.hDevice1, *params->phDevice); - EXPECT_EQ(&sampler_create_args.Desc1, *params->pdesc); + EXPECT_EQ(&sampler_create_args.desc1, *params->pdesc); EXPECT_EQ(&sampler_create_args.hSampler1, *params->pphSampler); ze_sampler_handle_t **ppHandle; @@ -224,7 +224,7 @@ TEST_F(ZeApiTracingRuntimeMultipleArgumentsTests, [](ze_sampler_create_params_t *params, ze_result_t result, void *pTracerUserData, void **ppTracerInstanceUserData) { EXPECT_EQ(sampler_create_args.hContext1, *params->phContext); EXPECT_EQ(sampler_create_args.hDevice1, *params->phDevice); - EXPECT_EQ(&sampler_create_args.Desc1, *params->pdesc); + EXPECT_EQ(&sampler_create_args.desc1, *params->pdesc); EXPECT_EQ(&sampler_create_args.hSampler1, *params->pphSampler); ze_sampler_handle_t **ppHandle; @@ -259,7 +259,7 @@ TEST_F(ZeApiTracingRuntimeMultipleArgumentsTests, EXPECT_EQ(result, ZE_RESULT_SUCCESS); EXPECT_EQ(sampler_create_args.hContext1, *params->phContext); EXPECT_EQ(sampler_create_args.hDevice1, *params->phDevice); - EXPECT_EQ(&sampler_create_args.Desc1, *params->pdesc); + EXPECT_EQ(&sampler_create_args.desc1, *params->pdesc); EXPECT_EQ(&sampler_create_args.hSampler1, *params->pphSampler); ze_sampler_handle_t **ppHandle; @@ -286,7 +286,7 @@ TEST_F(ZeApiTracingRuntimeMultipleArgumentsTests, setTracerCallbacksAndEnableTracer(); - result = zeSamplerCreateTracing(sampler_create_args.hContext0, sampler_create_args.hDevice0, &sampler_create_args.Desc0, &sampler_create_args.hSampler0); + result = zeSamplerCreateTracing(sampler_create_args.hContext0, sampler_create_args.hDevice0, &sampler_create_args.desc0, &sampler_create_args.hSampler0); EXPECT_EQ(ZE_RESULT_SUCCESS, result); EXPECT_EQ(sampler_create_args.hSampler1, sampler_create_args.hSamplerAPI); validateDefaultUserDataFinal(); diff --git a/level_zero/sysman/test/unit_tests/sources/firmware_util/test_fw_util_helper.cpp b/level_zero/sysman/test/unit_tests/sources/firmware_util/test_fw_util_helper.cpp index 7515b88e4d..b2635f65e0 100644 --- a/level_zero/sysman/test/unit_tests/sources/firmware_util/test_fw_util_helper.cpp +++ b/level_zero/sysman/test/unit_tests/sources/firmware_util/test_fw_util_helper.cpp @@ -146,11 +146,11 @@ TEST(FwGetProcAddressTest, GivenValidFwUtilMethodNameWhenFirmwareUtilIsInitalize public: ~IFRmockOsLibrary() override = default; void *getProcAddress(const std::string &procName) override { - IFRfuncMap["igsc_ifr_get_status_ext"] = reinterpret_cast(&mockDeviceIfrGetStatusExt); - IFRfuncMap["igsc_ifr_run_array_scan_test"] = reinterpret_cast(&mockdeviceIfrRunArrayScanTest); - IFRfuncMap["igsc_ifr_run_mem_ppr_test"] = reinterpret_cast(&mockdeviceIfrRunMemPPRTest); - auto it = IFRfuncMap.find(procName); - if (IFRfuncMap.end() == it) { + ifrFuncMap["igsc_ifr_get_status_ext"] = reinterpret_cast(&mockDeviceIfrGetStatusExt); + ifrFuncMap["igsc_ifr_run_array_scan_test"] = reinterpret_cast(&mockdeviceIfrRunArrayScanTest); + ifrFuncMap["igsc_ifr_run_mem_ppr_test"] = reinterpret_cast(&mockdeviceIfrRunMemPPRTest); + auto it = ifrFuncMap.find(procName); + if (ifrFuncMap.end() == it) { return nullptr; } else { return it->second; @@ -158,7 +158,7 @@ TEST(FwGetProcAddressTest, GivenValidFwUtilMethodNameWhenFirmwareUtilIsInitalize return nullptr; } bool isLoaded() override { return true; } - std::map IFRfuncMap; + std::map ifrFuncMap; }; uint16_t domain = 0; uint8_t bus = 0; diff --git a/level_zero/tools/test/unit_tests/sources/debug/linux/test_debug_api_linux.cpp b/level_zero/tools/test/unit_tests/sources/debug/linux/test_debug_api_linux.cpp index 106dacddb7..b853c440cb 100644 --- a/level_zero/tools/test/unit_tests/sources/debug/linux/test_debug_api_linux.cpp +++ b/level_zero/tools/test/unit_tests/sources/debug/linux/test_debug_api_linux.cpp @@ -7335,7 +7335,7 @@ TEST_F(DebugApiRegistersAccessTest, GivenVmHandleNotFoundWhenReadSbaBufferCalled struct MockRenderSurfaceState { uint32_t unused0[8]; - uint64_t SurfaceBaseAddress; + uint64_t surfaceBaseAddress; uint32_t unused1[6]; }; static_assert(64 == sizeof(MockRenderSurfaceState)); @@ -7360,7 +7360,7 @@ void sbaInit(std::vector &stateSaveArea, uint64_t stateSaveAreaGpuVa, SbaT char *sbaCpuPtr = stateSaveArea.data() + maxDbgSurfaceSize; char *rssCpuPtr = sbaCpuPtr + sizeof(SbaTrackedAddresses) + renderSurfaceStateOffset; memcpy(sbaCpuPtr, &sba, sizeof(sba)); - reinterpret_cast(rssCpuPtr)->SurfaceBaseAddress = 0xBA5EBA5E; + reinterpret_cast(rssCpuPtr)->surfaceBaseAddress = 0xBA5EBA5E; } TEST_F(DebugApiRegistersAccessTest, GivenReadSbaBufferCalledThenSbaBufferIsRead) { @@ -7484,7 +7484,7 @@ TEST_F(DebugApiRegistersAccessTest, GivenScarcthPointerAndZeroAddressInSurfaceSt char *sbaCpuPtr = session->stateSaveAreaHeader.data() + maxDbgSurfaceSize; char *rssCpuPtr = sbaCpuPtr + sizeof(SbaTrackedAddresses) + renderSurfaceStateOffset; memcpy(sbaCpuPtr, &sbaExpected, sizeof(sbaExpected)); - reinterpret_cast(rssCpuPtr)->SurfaceBaseAddress = 0; + reinterpret_cast(rssCpuPtr)->surfaceBaseAddress = 0; EXPECT_EQ(ZE_RESULT_SUCCESS, zetDebugWriteRegisters(session->toHandle(), thread, ZET_DEBUG_REGSET_TYPE_GRF_INTEL_GPU, 0, 1, r0)); diff --git a/level_zero/tools/test/unit_tests/sources/sysman/firmware_util/test_fw_util_helper.cpp b/level_zero/tools/test/unit_tests/sources/sysman/firmware_util/test_fw_util_helper.cpp index 9590c9c5c7..4b111767b1 100644 --- a/level_zero/tools/test/unit_tests/sources/sysman/firmware_util/test_fw_util_helper.cpp +++ b/level_zero/tools/test/unit_tests/sources/sysman/firmware_util/test_fw_util_helper.cpp @@ -160,11 +160,11 @@ TEST(FwGetProcAddressTest, GivenValidFwUtilMethodNameWhenFirmwareUtilIsInitalize public: ~IFRmockOsLibrary() override = default; void *getProcAddress(const std::string &procName) override { - IFRfuncMap["igsc_ifr_get_status_ext"] = reinterpret_cast(&mockDeviceIfrGetStatusExt); - IFRfuncMap["igsc_ifr_run_array_scan_test"] = reinterpret_cast(&mockDeviceIfrRunArrayScanTest); - IFRfuncMap["igsc_ifr_run_mem_ppr_test"] = reinterpret_cast(&mockDeviceIfrRunMemPPRTest); - auto it = IFRfuncMap.find(procName); - if (IFRfuncMap.end() == it) { + ifrFuncMap["igsc_ifr_get_status_ext"] = reinterpret_cast(&mockDeviceIfrGetStatusExt); + ifrFuncMap["igsc_ifr_run_array_scan_test"] = reinterpret_cast(&mockDeviceIfrRunArrayScanTest); + ifrFuncMap["igsc_ifr_run_mem_ppr_test"] = reinterpret_cast(&mockDeviceIfrRunMemPPRTest); + auto it = ifrFuncMap.find(procName); + if (ifrFuncMap.end() == it) { return nullptr; } else { return it->second; @@ -172,7 +172,7 @@ TEST(FwGetProcAddressTest, GivenValidFwUtilMethodNameWhenFirmwareUtilIsInitalize return nullptr; } bool isLoaded() override { return true; } - std::map IFRfuncMap; + std::map ifrFuncMap; }; uint16_t domain = 0; uint8_t bus = 0; diff --git a/opencl/source/command_queue/gpgpu_walker_bdw_and_later.inl b/opencl/source/command_queue/gpgpu_walker_bdw_and_later.inl index f7a67b3554..21c15bb06e 100644 --- a/opencl/source/command_queue/gpgpu_walker_bdw_and_later.inl +++ b/opencl/source/command_queue/gpgpu_walker_bdw_and_later.inl @@ -110,7 +110,7 @@ void GpgpuWalkerHelper::dispatchProfilingCommandsStart( using MI_STORE_REGISTER_MEM = typename GfxFamily::MI_STORE_REGISTER_MEM; // PIPE_CONTROL for global timestamp - uint64_t timeStampAddress = hwTimeStamps.getGpuAddress() + offsetof(HwTimeStamps, GlobalStartTS); + uint64_t timeStampAddress = hwTimeStamps.getGpuAddress() + offsetof(HwTimeStamps, globalStartTS); PipeControlArgs args; MemorySynchronizationCommands::addBarrierWithPostSyncOperation( *commandStream, @@ -123,7 +123,7 @@ void GpgpuWalkerHelper::dispatchProfilingCommandsStart( auto &gfxCoreHelper = rootDeviceEnvironment.getHelper(); if (!gfxCoreHelper.useOnlyGlobalTimestamps()) { // MI_STORE_REGISTER_MEM for context local timestamp - timeStampAddress = hwTimeStamps.getGpuAddress() + offsetof(HwTimeStamps, ContextStartTS); + timeStampAddress = hwTimeStamps.getGpuAddress() + offsetof(HwTimeStamps, contextStartTS); // low part auto pMICmdLow = commandStream->getSpaceForCmd(); @@ -143,7 +143,7 @@ void GpgpuWalkerHelper::dispatchProfilingCommandsEnd( using MI_STORE_REGISTER_MEM = typename GfxFamily::MI_STORE_REGISTER_MEM; // PIPE_CONTROL for global timestamp - uint64_t timeStampAddress = hwTimeStamps.getGpuAddress() + offsetof(HwTimeStamps, GlobalEndTS); + uint64_t timeStampAddress = hwTimeStamps.getGpuAddress() + offsetof(HwTimeStamps, globalEndTS); PipeControlArgs args; MemorySynchronizationCommands::addBarrierWithPostSyncOperation( *commandStream, @@ -156,7 +156,7 @@ void GpgpuWalkerHelper::dispatchProfilingCommandsEnd( auto &gfxCoreHelper = rootDeviceEnvironment.getHelper(); if (!gfxCoreHelper.useOnlyGlobalTimestamps()) { // MI_STORE_REGISTER_MEM for context local timestamp - uint64_t timeStampAddress = hwTimeStamps.getGpuAddress() + offsetof(HwTimeStamps, ContextEndTS); + uint64_t timeStampAddress = hwTimeStamps.getGpuAddress() + offsetof(HwTimeStamps, contextEndTS); // low part auto pMICmdLow = commandStream->getSpaceForCmd(); diff --git a/opencl/test/unit_test/api/cl_create_sampler_with_properties_tests.inl b/opencl/test/unit_test/api/cl_create_sampler_with_properties_tests.inl index 86e7ef4316..a2fd58702a 100644 --- a/opencl/test/unit_test/api/cl_create_sampler_with_properties_tests.inl +++ b/opencl/test/unit_test/api/cl_create_sampler_with_properties_tests.inl @@ -22,7 +22,7 @@ struct SamplerWithPropertiesTest : public ApiFixture<>, } void SetUp() override { - std::tie(NormalizdProperties, AddressingProperties, FilterProperties) = GetParam(); + std::tie(normalizdProperties, addressingProperties, filterProperties) = GetParam(); ApiFixture::setUp(); } @@ -30,9 +30,9 @@ struct SamplerWithPropertiesTest : public ApiFixture<>, ApiFixture::tearDown(); } - cl_sampler_properties NormalizdProperties = 0; - cl_sampler_properties AddressingProperties = 0; - cl_sampler_properties FilterProperties = 0; + cl_sampler_properties normalizdProperties = 0; + cl_sampler_properties addressingProperties = 0; + cl_sampler_properties filterProperties = 0; }; using ClCreateSamplerWithPropertiesTests = ApiTests; @@ -124,19 +124,19 @@ TEST_P(ClCreateSamplerWithPropertiesTests2, GivenCorrectParametersWhenCreatingSa 0}; cl_queue_properties *pProp = &properties[0]; - if (NormalizdProperties) { + if (normalizdProperties) { *pProp++ = CL_SAMPLER_NORMALIZED_COORDS; - *pProp++ = (cl_queue_properties)NormalizdProperties; + *pProp++ = (cl_queue_properties)normalizdProperties; } - if (AddressingProperties) { + if (addressingProperties) { *pProp++ = CL_SAMPLER_ADDRESSING_MODE; - *pProp++ = (cl_queue_properties)AddressingProperties; + *pProp++ = (cl_queue_properties)addressingProperties; } - if (FilterProperties) { + if (filterProperties) { *pProp++ = CL_SAMPLER_FILTER_MODE; - *pProp++ = (cl_queue_properties)FilterProperties; + *pProp++ = (cl_queue_properties)filterProperties; } *pProp++ = 0; @@ -161,11 +161,11 @@ TEST_P(ClCreateSamplerWithPropertiesTests2, GivenInvalidPropertiesWhenCreatingSa 0}; cl_queue_properties *pProp = &properties[0]; - if (NormalizdProperties) { + if (normalizdProperties) { *pProp++ = CL_SAMPLER_NORMALIZED_COORDS; - *pProp++ = (cl_queue_properties)NormalizdProperties; + *pProp++ = (cl_queue_properties)normalizdProperties; *pProp++ = CL_SAMPLER_NORMALIZED_COORDS; - *pProp++ = (cl_queue_properties)NormalizdProperties; + *pProp++ = (cl_queue_properties)normalizdProperties; *pProp++ = 0; @@ -178,11 +178,11 @@ TEST_P(ClCreateSamplerWithPropertiesTests2, GivenInvalidPropertiesWhenCreatingSa } pProp = &properties[0]; - if (AddressingProperties) { + if (addressingProperties) { *pProp++ = CL_SAMPLER_ADDRESSING_MODE; - *pProp++ = (cl_queue_properties)AddressingProperties; + *pProp++ = (cl_queue_properties)addressingProperties; *pProp++ = CL_SAMPLER_ADDRESSING_MODE; - *pProp++ = (cl_queue_properties)AddressingProperties; + *pProp++ = (cl_queue_properties)addressingProperties; *pProp++ = 0; @@ -195,11 +195,11 @@ TEST_P(ClCreateSamplerWithPropertiesTests2, GivenInvalidPropertiesWhenCreatingSa } pProp = &properties[0]; - if (FilterProperties) { + if (filterProperties) { *pProp++ = CL_SAMPLER_FILTER_MODE; - *pProp++ = (cl_queue_properties)FilterProperties; + *pProp++ = (cl_queue_properties)filterProperties; *pProp++ = CL_SAMPLER_FILTER_MODE; - *pProp++ = (cl_queue_properties)FilterProperties; + *pProp++ = (cl_queue_properties)filterProperties; *pProp++ = 0; @@ -212,13 +212,13 @@ TEST_P(ClCreateSamplerWithPropertiesTests2, GivenInvalidPropertiesWhenCreatingSa } } -static cl_sampler_properties NormalizdProperties[] = +static cl_sampler_properties normalizdProperties[] = { CL_TRUE, CL_FALSE, }; -static cl_sampler_properties AddressingProperties[] = +static cl_sampler_properties addressingProperties[] = { CL_ADDRESS_NONE, CL_ADDRESS_CLAMP_TO_EDGE, @@ -227,7 +227,7 @@ static cl_sampler_properties AddressingProperties[] = CL_ADDRESS_MIRRORED_REPEAT, }; -static cl_sampler_properties FilterProperties[] = +static cl_sampler_properties filterProperties[] = { CL_FILTER_NEAREST, CL_FILTER_LINEAR, @@ -236,9 +236,9 @@ static cl_sampler_properties FilterProperties[] = INSTANTIATE_TEST_CASE_P(api, ClCreateSamplerWithPropertiesTests2, ::testing::Combine( - ::testing::ValuesIn(NormalizdProperties), - ::testing::ValuesIn(AddressingProperties), - ::testing::ValuesIn(FilterProperties))); + ::testing::ValuesIn(normalizdProperties), + ::testing::ValuesIn(addressingProperties), + ::testing::ValuesIn(filterProperties))); TEST_F(ClCreateSamplerWithPropertiesTests, GivenMipMapDataWhenCreatingSamplerWithPropertiesThenSamplerIsCreatedAndCorrectlyPopulated) { SamplerLodProperty minLodProperty; diff --git a/opencl/test/unit_test/api/cl_enqueue_map_buffer_tests.inl b/opencl/test/unit_test/api/cl_enqueue_map_buffer_tests.inl index 056be86c63..b33bba55ac 100644 --- a/opencl/test/unit_test/api/cl_enqueue_map_buffer_tests.inl +++ b/opencl/test/unit_test/api/cl_enqueue_map_buffer_tests.inl @@ -141,7 +141,7 @@ class EnqueueMapBufferFlagsTest : public ApiFixture<>, protected: void SetUp() override { ApiFixture::setUp(); - buffer_flags = GetParam(); + bufferFlags = GetParam(); unsigned int bufferSize = 16; pHostMem = new unsigned char[bufferSize]; @@ -149,7 +149,7 @@ class EnqueueMapBufferFlagsTest : public ApiFixture<>, buffer = clCreateBuffer( pContext, - buffer_flags, + bufferFlags, bufferSize, pHostMem, &retVal); @@ -165,7 +165,7 @@ class EnqueueMapBufferFlagsTest : public ApiFixture<>, } cl_int retVal = CL_SUCCESS; - cl_mem_flags buffer_flags = 0; + cl_mem_flags bufferFlags = 0; unsigned char *pHostMem; cl_mem buffer; }; diff --git a/opencl/test/unit_test/api/cl_enqueue_read_buffer_rect_tests.inl b/opencl/test/unit_test/api/cl_enqueue_read_buffer_rect_tests.inl index 3149b52844..1bb2d32119 100644 --- a/opencl/test/unit_test/api/cl_enqueue_read_buffer_rect_tests.inl +++ b/opencl/test/unit_test/api/cl_enqueue_read_buffer_rect_tests.inl @@ -274,7 +274,7 @@ class EnqueueReadBufferRectFlagsTest : public ApiFixture<>, protected: void SetUp() override { ApiFixture::setUp(); - buffer_flags = GetParam(); + bufferFlags = GetParam(); unsigned int bufferSize = 16; pHostMem = new unsigned char[bufferSize]; @@ -282,7 +282,7 @@ class EnqueueReadBufferRectFlagsTest : public ApiFixture<>, buffer = clCreateBuffer( pContext, - buffer_flags, + bufferFlags, bufferSize, pHostMem, &retVal); @@ -298,7 +298,7 @@ class EnqueueReadBufferRectFlagsTest : public ApiFixture<>, } cl_int retVal = CL_SUCCESS; - cl_mem_flags buffer_flags = 0; + cl_mem_flags bufferFlags = 0; unsigned char *pHostMem; cl_mem buffer; }; diff --git a/opencl/test/unit_test/api/cl_enqueue_read_buffer_tests.inl b/opencl/test/unit_test/api/cl_enqueue_read_buffer_tests.inl index ae465cdc96..673e9690f4 100644 --- a/opencl/test/unit_test/api/cl_enqueue_read_buffer_tests.inl +++ b/opencl/test/unit_test/api/cl_enqueue_read_buffer_tests.inl @@ -77,7 +77,7 @@ class EnqueueReadBufferFlagsTest : public ApiFixture<>, protected: void SetUp() override { ApiFixture::setUp(); - buffer_flags = GetParam(); + bufferFlags = GetParam(); unsigned int bufferSize = 16; pHostMem = new unsigned char[bufferSize]; @@ -85,7 +85,7 @@ class EnqueueReadBufferFlagsTest : public ApiFixture<>, buffer = clCreateBuffer( pContext, - buffer_flags, + bufferFlags, bufferSize, pHostMem, &retVal); @@ -101,7 +101,7 @@ class EnqueueReadBufferFlagsTest : public ApiFixture<>, } cl_int retVal = CL_SUCCESS; - cl_mem_flags buffer_flags = 0; + cl_mem_flags bufferFlags = 0; unsigned char *pHostMem; cl_mem buffer; }; diff --git a/opencl/test/unit_test/api/cl_get_event_profiling_info_tests.inl b/opencl/test/unit_test/api/cl_get_event_profiling_info_tests.inl index 3f2790d041..53317301dc 100644 --- a/opencl/test/unit_test/api/cl_get_event_profiling_info_tests.inl +++ b/opencl/test/unit_test/api/cl_get_event_profiling_info_tests.inl @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2022 Intel Corporation + * Copyright (C) 2018-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -285,7 +285,7 @@ class ClEventProfilingWithPerfCountersTests : public DeviceInstrumentationFixtur event = std::make_unique(commandQueue.get(), 0, 0, 0); event->setStatus(CL_COMPLETE); event->setProfilingEnabled(true); - commandQueue->getPerfCounters()->getApiReport(event->getHwPerfCounterNode(), 0, nullptr, ¶m_value_size, true); + commandQueue->getPerfCounters()->getApiReport(event->getHwPerfCounterNode(), 0, nullptr, ¶mValueSize, true); eventCl = static_cast(event.get()); } @@ -297,19 +297,19 @@ class ClEventProfilingWithPerfCountersTests : public DeviceInstrumentationFixtur std::unique_ptr context; std::unique_ptr commandQueue; std::unique_ptr event; - size_t param_value_size = 0; + size_t paramValueSize = 0; cl_event eventCl = nullptr; - cl_ulong param_value = 0; - size_t param_value_size_ret = 0; + cl_ulong paramValue = 0; + size_t paramValueSizeRet = 0; }; TEST_F(ClEventProfilingWithPerfCountersTests, GivenDisabledPerfCountersWhenGettingEventProfilingInfoThenInvalidValueErrorIsReturned) { event->setPerfCountersEnabled(false); cl_int retVal = clGetEventProfilingInfo(eventCl, CL_PROFILING_COMMAND_PERFCOUNTERS_INTEL, - param_value_size, - ¶m_value, - ¶m_value_size_ret); + paramValueSize, + ¶mValue, + ¶mValueSizeRet); EXPECT_EQ(CL_INVALID_VALUE, retVal); } @@ -317,9 +317,9 @@ TEST_F(ClEventProfilingWithPerfCountersTests, GivenEnabledPerfCountersWhenGettin event->setPerfCountersEnabled(true); cl_int retVal = clGetEventProfilingInfo(eventCl, CL_PROFILING_COMMAND_PERFCOUNTERS_INTEL, - param_value_size, - ¶m_value, - ¶m_value_size_ret); + paramValueSize, + ¶mValue, + ¶mValueSizeRet); EXPECT_EQ(CL_SUCCESS, retVal); } @@ -327,8 +327,8 @@ TEST_F(ClEventProfilingWithPerfCountersTests, GivenEnabledPerfCountersAndIncorre event->setPerfCountersEnabled(true); cl_int retVal = clGetEventProfilingInfo(eventCl, CL_PROFILING_COMMAND_PERFCOUNTERS_INTEL, - param_value_size - 1, - ¶m_value, - ¶m_value_size_ret); + paramValueSize - 1, + ¶mValue, + ¶mValueSizeRet); EXPECT_EQ(CL_PROFILING_INFO_NOT_AVAILABLE, retVal); } diff --git a/opencl/test/unit_test/api/cl_get_kernel_sub_group_info_khr_tests.inl b/opencl/test/unit_test/api/cl_get_kernel_sub_group_info_khr_tests.inl index e9cac26902..25b522e72f 100644 --- a/opencl/test/unit_test/api/cl_get_kernel_sub_group_info_khr_tests.inl +++ b/opencl/test/unit_test/api/cl_get_kernel_sub_group_info_khr_tests.inl @@ -14,10 +14,10 @@ struct KernelSubGroupInfoKhrFixture : HelloWorldFixture(pKernel->getKernelInfo().getMaxSimdSize()); - ASSERT_GE(MaxSimdSize, 8u); - MaxWorkDim = static_cast(pClDevice->getDeviceInfo().maxWorkItemDimensions); - ASSERT_EQ(MaxWorkDim, 3u); + maxSimdSize = static_cast(pKernel->getKernelInfo().getMaxSimdSize()); + ASSERT_GE(maxSimdSize, 8u); + maxWorkDim = static_cast(pClDevice->getDeviceInfo().maxWorkItemDimensions); + ASSERT_EQ(maxWorkDim, 3u); } void tearDown() { @@ -27,9 +27,9 @@ struct KernelSubGroupInfoKhrFixture : HelloWorldFixture KernelSubGroupInfoKhrReturnCountTest; @@ -100,7 +100,7 @@ TEST_P(KernelSubGroupInfoKhrReturnCountTest, GivenLwsParameterWhenGettingSubGrou inputValue[0] = GetParam().gwsX; inputValue[1] = GetParam().gwsY; inputValue[2] = GetParam().gwsZ; - CalculatedWGS = inputValue[0] * inputValue[1] * inputValue[2]; + calculatedWGS = inputValue[0] * inputValue[1] * inputValue[2]; retVal = clGetKernelSubGroupInfoKHR( pMultiDeviceKernel, @@ -115,10 +115,10 @@ TEST_P(KernelSubGroupInfoKhrReturnCountTest, GivenLwsParameterWhenGettingSubGrou EXPECT_EQ(retVal, CL_SUCCESS); EXPECT_EQ(paramValueSizeRet, sizeof(size_t)); - if (CalculatedWGS % MaxSimdSize == 0) { - EXPECT_EQ(paramValue, CalculatedWGS / MaxSimdSize); + if (calculatedWGS % maxSimdSize == 0) { + EXPECT_EQ(paramValue, calculatedWGS / maxSimdSize); } else { - EXPECT_EQ(paramValue, (CalculatedWGS / MaxSimdSize) + 1); + EXPECT_EQ(paramValue, (calculatedWGS / maxSimdSize) + 1); } } @@ -249,7 +249,7 @@ TEST_P(KernelSubGroupInfoKhrInputParamsTest, GivenInvalidInputWhenGettingKernelS pMultiDeviceKernel, pClDevice, GetParam(), - (sizeof(size_t) * MaxWorkDim) - 1, + (sizeof(size_t) * maxWorkDim) - 1, inputValue, 0, nullptr, @@ -257,12 +257,12 @@ TEST_P(KernelSubGroupInfoKhrInputParamsTest, GivenInvalidInputWhenGettingKernelS EXPECT_EQ(retVal, CL_INVALID_VALUE); - // work dim > MaxWorkDim + // work dim > maxWorkDim retVal = clGetKernelSubGroupInfoKHR( pMultiDeviceKernel, pClDevice, GetParam(), - sizeof(size_t) * (MaxWorkDim + 1), + sizeof(size_t) * (maxWorkDim + 1), inputValue, 0, nullptr, @@ -275,7 +275,7 @@ TEST_P(KernelSubGroupInfoKhrInputParamsTest, GivenInvalidInputWhenGettingKernelS pMultiDeviceKernel, pClDevice, GetParam(), - sizeof(size_t) * (MaxWorkDim), + sizeof(size_t) * (maxWorkDim), nullptr, 0, nullptr, diff --git a/opencl/test/unit_test/api/cl_intel_accelerator_tests.inl b/opencl/test/unit_test/api/cl_intel_accelerator_tests.inl index 55aa2b683d..4956652734 100644 --- a/opencl/test/unit_test/api/cl_intel_accelerator_tests.inl +++ b/opencl/test/unit_test/api/cl_intel_accelerator_tests.inl @@ -112,7 +112,7 @@ struct IntelAcceleratorGetInfoTest : IntelAcceleratorTestWithValidDescriptor { } protected: - size_t param_value_size_ret = 0; + size_t paramValueSizeRet = 0; }; TEST_F(IntelAcceleratorTest, GivenNullAcceleratorWhenGettingAcceleratorInfoThenClInvalidAcceleratorIntelErrorIsReturned) { @@ -154,10 +154,10 @@ TEST_F(IntelAcceleratorGetInfoTest, GivenClAcceleratorReferenceCountIntelWhenGet CL_ACCELERATOR_REFERENCE_COUNT_INTEL, sizeof(cl_uint), nullptr, - ¶m_value_size_ret); + ¶mValueSizeRet); EXPECT_EQ(CL_SUCCESS, result); - EXPECT_EQ(sizeof(cl_uint), param_value_size_ret); + EXPECT_EQ(sizeof(cl_uint), paramValueSizeRet); } TEST_F(IntelAcceleratorGetInfoTest, GivenClAcceleratorReferenceCountIntelWhenGettingAcceleratorInfoThenParamValueIsOne) { @@ -182,10 +182,10 @@ TEST_F(IntelAcceleratorGetInfoTest, GivenLongForDescriptorSizeWhenGettingAcceler CL_ACCELERATOR_REFERENCE_COUNT_INTEL, sizeof(cl_uint) + 1, ¶mValue, - ¶m_value_size_ret); + ¶mValueSizeRet); EXPECT_EQ(CL_SUCCESS, result); - EXPECT_EQ(sizeof(cl_uint), param_value_size_ret); + EXPECT_EQ(sizeof(cl_uint), paramValueSizeRet); EXPECT_EQ(1u, paramValue); } @@ -197,7 +197,7 @@ TEST_F(IntelAcceleratorGetInfoTest, GivenShortForDescriptorSizeWhenGettingAccele CL_ACCELERATOR_REFERENCE_COUNT_INTEL, sizeof(cl_uint) - 1, ¶mValue, - ¶m_value_size_ret); + ¶mValueSizeRet); EXPECT_EQ(CL_INVALID_VALUE, result); } @@ -208,10 +208,10 @@ TEST_F(IntelAcceleratorGetInfoTest, GivenZeroForDescriptorSizeGivenLongForDescri CL_ACCELERATOR_REFERENCE_COUNT_INTEL, 0, nullptr, - ¶m_value_size_ret); + ¶mValueSizeRet); EXPECT_EQ(CL_SUCCESS, result); - EXPECT_EQ(sizeof(cl_uint), param_value_size_ret); + EXPECT_EQ(sizeof(cl_uint), paramValueSizeRet); } TEST_F(IntelAcceleratorGetInfoTest, GivenCallToRetainAcceleratorWhenGettingAcceleratorInfoThenParamValueIsTwo) { @@ -225,7 +225,7 @@ TEST_F(IntelAcceleratorGetInfoTest, GivenCallToRetainAcceleratorWhenGettingAccel CL_ACCELERATOR_REFERENCE_COUNT_INTEL, sizeof(cl_uint), ¶mValue, - ¶m_value_size_ret); + ¶mValueSizeRet); EXPECT_EQ(CL_SUCCESS, result); EXPECT_EQ(2u, paramValue); @@ -239,7 +239,7 @@ TEST_F(IntelAcceleratorGetInfoTest, GivenCallToRetainAcceleratorWhenGettingAccel CL_ACCELERATOR_REFERENCE_COUNT_INTEL, sizeof(cl_uint), ¶mValue, - ¶m_value_size_ret); + ¶mValueSizeRet); EXPECT_EQ(CL_SUCCESS, result); EXPECT_EQ(1u, paramValue); @@ -251,10 +251,10 @@ TEST_F(IntelAcceleratorGetInfoTest, GivenNullPtrForParamValueWhenGettingAccelera CL_ACCELERATOR_CONTEXT_INTEL, sizeof(cl_context), nullptr, - ¶m_value_size_ret); + ¶mValueSizeRet); EXPECT_EQ(CL_SUCCESS, result); - EXPECT_EQ(sizeof(cl_context), param_value_size_ret); + EXPECT_EQ(sizeof(cl_context), paramValueSizeRet); } TEST_F(IntelAcceleratorGetInfoTest, GivenLongForDescriptorSizeWhenGettingAcceleratorContextInfoThenCorrectValuesAreReturned) { @@ -265,10 +265,10 @@ TEST_F(IntelAcceleratorGetInfoTest, GivenLongForDescriptorSizeWhenGettingAcceler CL_ACCELERATOR_CONTEXT_INTEL, sizeof(cl_context) + 1, ¶mValue, - ¶m_value_size_ret); + ¶mValueSizeRet); EXPECT_EQ(CL_SUCCESS, result); - EXPECT_EQ(sizeof(cl_context), param_value_size_ret); + EXPECT_EQ(sizeof(cl_context), paramValueSizeRet); } TEST_F(IntelAcceleratorGetInfoTest, GivenAcceleratorContextIntelWhenGettingAcceleratorInfoThenCorrectValuesAreReturned) { @@ -279,10 +279,10 @@ TEST_F(IntelAcceleratorGetInfoTest, GivenAcceleratorContextIntelWhenGettingAccel CL_ACCELERATOR_CONTEXT_INTEL, sizeof(cl_context), ¶mValue, - ¶m_value_size_ret); + ¶mValueSizeRet); EXPECT_EQ(CL_SUCCESS, result); - EXPECT_EQ(sizeof(cl_context), param_value_size_ret); + EXPECT_EQ(sizeof(cl_context), paramValueSizeRet); cl_context referenceContext = static_cast(pContext); EXPECT_EQ(referenceContext, paramValue); @@ -296,7 +296,7 @@ TEST_F(IntelAcceleratorGetInfoTest, GivenShortForDescriptorSizeWhenGettingAccele CL_ACCELERATOR_CONTEXT_INTEL, sizeof(cl_context) - 1, ¶mValue, - ¶m_value_size_ret); + ¶mValueSizeRet); EXPECT_EQ(CL_INVALID_VALUE, result); } @@ -307,9 +307,9 @@ TEST_F(IntelAcceleratorGetInfoTest, GivenZeroForDescriptorSizeGivenLongForDescri CL_ACCELERATOR_CONTEXT_INTEL, 0, nullptr, - ¶m_value_size_ret); + ¶mValueSizeRet); EXPECT_EQ(CL_SUCCESS, result); - EXPECT_EQ(sizeof(cl_context), param_value_size_ret); + EXPECT_EQ(sizeof(cl_context), paramValueSizeRet); } } // namespace ULT diff --git a/opencl/test/unit_test/api/cl_intel_motion_estimation.cpp b/opencl/test/unit_test/api/cl_intel_motion_estimation.cpp index bc804dce1c..9430713cc9 100644 --- a/opencl/test/unit_test/api/cl_intel_motion_estimation.cpp +++ b/opencl/test/unit_test/api/cl_intel_motion_estimation.cpp @@ -207,8 +207,8 @@ TEST_F(IntelMotionEstimationTest, GivenValidAcceleratorWhenRetainingAndReleasing struct IntelMotionEstimationGetInfoTest : public IntelMotionEstimationTest { public: - IntelMotionEstimationGetInfoTest() : type_returned(static_cast(-1)), - param_value_size_ret(static_cast(-1)) {} + IntelMotionEstimationGetInfoTest() : typeReturned(static_cast(-1)), + paramValueSizeRet(static_cast(-1)) {} void SetUp() override { IntelMotionEstimationTest::SetUp(); @@ -238,8 +238,8 @@ struct IntelMotionEstimationGetInfoTest : public IntelMotionEstimationTest { protected: cl_motion_estimation_desc_intel descReturn; - cl_accelerator_type_intel type_returned; - size_t param_value_size_ret; + cl_accelerator_type_intel typeReturned; + size_t paramValueSizeRet; }; TEST_F(IntelMotionEstimationGetInfoTest, GivenValidParamsWhenGettingAcceleratorInfoThenDescriptorContainsCorrectInformation) { @@ -248,10 +248,10 @@ TEST_F(IntelMotionEstimationGetInfoTest, GivenValidParamsWhenGettingAcceleratorI CL_ACCELERATOR_DESCRIPTOR_INTEL, sizeof(cl_motion_estimation_desc_intel), // exact &descReturn, - ¶m_value_size_ret); + ¶mValueSizeRet); EXPECT_EQ(CL_SUCCESS, result); - EXPECT_EQ(sizeof(cl_motion_estimation_desc_intel), param_value_size_ret); + EXPECT_EQ(sizeof(cl_motion_estimation_desc_intel), paramValueSizeRet); EXPECT_EQ(static_cast(CL_ME_MB_TYPE_16x16_INTEL), descReturn.mb_block_type); EXPECT_EQ(static_cast(CL_ME_SUBPIXEL_MODE_QPEL_INTEL), descReturn.subpixel_mode); @@ -265,7 +265,7 @@ TEST_F(IntelMotionEstimationGetInfoTest, GivenTooShortDescriptorLengthWhenGettin CL_ACCELERATOR_DESCRIPTOR_INTEL, sizeof(cl_motion_estimation_desc_intel) - 1, // short &descReturn, - ¶m_value_size_ret); + ¶mValueSizeRet); EXPECT_EQ(CL_INVALID_VALUE, result); } @@ -276,23 +276,23 @@ TEST_F(IntelMotionEstimationGetInfoTest, GivenDescriptorLengthZeroWhenGettingAcc CL_ACCELERATOR_DESCRIPTOR_INTEL, 0, &descReturn, - ¶m_value_size_ret); + ¶mValueSizeRet); EXPECT_EQ(CL_INVALID_VALUE, result); } TEST_F(IntelMotionEstimationGetInfoTest, GivenInvalidParametersWhenGettingAcceleratorInfoThenValueSizeRetIsNotUpdated) { - param_value_size_ret = 0x1234; + paramValueSizeRet = 0x1234; result = clGetAcceleratorInfoINTEL( accelerator, CL_ACCELERATOR_DESCRIPTOR_INTEL, 0, &descReturn, - ¶m_value_size_ret); + ¶mValueSizeRet); EXPECT_EQ(CL_INVALID_VALUE, result); - EXPECT_EQ(0x1234u, param_value_size_ret); + EXPECT_EQ(0x1234u, paramValueSizeRet); } TEST_F(IntelMotionEstimationGetInfoTest, GivenLongerDescriptorLengthWhenGettingAcceleratorInfoThenCorrectDescriptorLengthIsReturned) { @@ -301,10 +301,10 @@ TEST_F(IntelMotionEstimationGetInfoTest, GivenLongerDescriptorLengthWhenGettingA CL_ACCELERATOR_DESCRIPTOR_INTEL, sizeof(cl_motion_estimation_desc_intel) + 1, // long &descReturn, - ¶m_value_size_ret); + ¶mValueSizeRet); EXPECT_EQ(CL_SUCCESS, result); - EXPECT_EQ(sizeof(cl_motion_estimation_desc_intel), param_value_size_ret); + EXPECT_EQ(sizeof(cl_motion_estimation_desc_intel), paramValueSizeRet); } TEST_F(IntelMotionEstimationGetInfoTest, GivenDescriptorLengthZeroAndDescriptorNullWhenGettingAcceleratorInfoThenCorrectDescriptorLengthIsReturned) { @@ -313,10 +313,10 @@ TEST_F(IntelMotionEstimationGetInfoTest, GivenDescriptorLengthZeroAndDescriptorN CL_ACCELERATOR_DESCRIPTOR_INTEL, 0, // query required size w/nullptr return nullptr, - ¶m_value_size_ret); + ¶mValueSizeRet); EXPECT_EQ(CL_SUCCESS, result); - EXPECT_EQ(sizeof(cl_motion_estimation_desc_intel), param_value_size_ret); + EXPECT_EQ(sizeof(cl_motion_estimation_desc_intel), paramValueSizeRet); } TEST_F(IntelMotionEstimationGetInfoTest, GivenAcceleratorTypeWhenGettingAcceleratorInfoThenAcceleratorTypeMotionEstimationIntelIsReturned) { @@ -326,13 +326,13 @@ TEST_F(IntelMotionEstimationGetInfoTest, GivenAcceleratorTypeWhenGettingAccelera accelerator, CL_ACCELERATOR_TYPE_INTEL, sizeof(cl_uint), - &type_returned, - ¶m_value_size_ret); + &typeReturned, + ¶mValueSizeRet); EXPECT_EQ(CL_SUCCESS, result); - EXPECT_EQ(sizeof(cl_accelerator_type_intel), param_value_size_ret); + EXPECT_EQ(sizeof(cl_accelerator_type_intel), paramValueSizeRet); - EXPECT_EQ(static_cast(CL_ACCELERATOR_TYPE_MOTION_ESTIMATION_INTEL), type_returned); + EXPECT_EQ(static_cast(CL_ACCELERATOR_TYPE_MOTION_ESTIMATION_INTEL), typeReturned); } TEST_F(IntelMotionEstimationGetInfoTest, GivenAcceleratorTypeIntelWhenGettingAcceleratorInfoThenClAcceleratorTypeMotionEstimationIntelIsReturned) { @@ -340,13 +340,13 @@ TEST_F(IntelMotionEstimationGetInfoTest, GivenAcceleratorTypeIntelWhenGettingAcc accelerator, CL_ACCELERATOR_TYPE_INTEL, sizeof(cl_uint), // exact - &type_returned, - ¶m_value_size_ret); + &typeReturned, + ¶mValueSizeRet); EXPECT_EQ(CL_SUCCESS, result); - EXPECT_EQ(sizeof(cl_accelerator_type_intel), param_value_size_ret); + EXPECT_EQ(sizeof(cl_accelerator_type_intel), paramValueSizeRet); - EXPECT_EQ(static_cast(CL_ACCELERATOR_TYPE_MOTION_ESTIMATION_INTEL), type_returned); + EXPECT_EQ(static_cast(CL_ACCELERATOR_TYPE_MOTION_ESTIMATION_INTEL), typeReturned); } TEST_F(IntelMotionEstimationGetInfoTest, GivenAcceleratorTypeIntelAndTooShortTypeLengthWhenGettingAcceleratorInfoThenClInvalidValueIsReturned) { @@ -354,8 +354,8 @@ TEST_F(IntelMotionEstimationGetInfoTest, GivenAcceleratorTypeIntelAndTooShortTyp accelerator, CL_ACCELERATOR_TYPE_INTEL, sizeof(cl_uint) - 1, // short - &type_returned, - ¶m_value_size_ret); + &typeReturned, + ¶mValueSizeRet); EXPECT_EQ(CL_INVALID_VALUE, result); } @@ -365,8 +365,8 @@ TEST_F(IntelMotionEstimationGetInfoTest, GivenAcceleratorTypeIntelAndTypeLengthZ accelerator, CL_ACCELERATOR_TYPE_INTEL, 0, // very short - &type_returned, - ¶m_value_size_ret); + &typeReturned, + ¶mValueSizeRet); EXPECT_EQ(CL_INVALID_VALUE, result); } @@ -376,11 +376,11 @@ TEST_F(IntelMotionEstimationGetInfoTest, GivenAcceleratorTypeIntelAndTooLongType accelerator, CL_ACCELERATOR_TYPE_INTEL, sizeof(cl_uint) + 1, // long - &type_returned, - ¶m_value_size_ret); + &typeReturned, + ¶mValueSizeRet); EXPECT_EQ(CL_SUCCESS, result); - EXPECT_EQ(sizeof(cl_accelerator_type_intel), param_value_size_ret); + EXPECT_EQ(sizeof(cl_accelerator_type_intel), paramValueSizeRet); } TEST_F(IntelMotionEstimationGetInfoTest, GivenAcceleratorTypeIntelAndNullTypeWhenGettingAcceleratorInfoThenCorrectLengthIsReturned) { @@ -389,10 +389,10 @@ TEST_F(IntelMotionEstimationGetInfoTest, GivenAcceleratorTypeIntelAndNullTypeWhe CL_ACCELERATOR_TYPE_INTEL, 0, nullptr, - ¶m_value_size_ret); + ¶mValueSizeRet); EXPECT_EQ(CL_SUCCESS, result); - EXPECT_EQ(sizeof(cl_accelerator_type_intel), param_value_size_ret); + EXPECT_EQ(sizeof(cl_accelerator_type_intel), paramValueSizeRet); } TEST_F(IntelMotionEstimationTest, GivenDescriptor8x8IntegerNone2x2WhenCreatingAcceleratorThenSuccessIsReturned) { diff --git a/opencl/test/unit_test/command_queue/dispatch_walker_tests.cpp b/opencl/test/unit_test/command_queue/dispatch_walker_tests.cpp index a6f8044892..646d1b861c 100644 --- a/opencl/test/unit_test/command_queue/dispatch_walker_tests.cpp +++ b/opencl/test/unit_test/command_queue/dispatch_walker_tests.cpp @@ -1342,7 +1342,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, ProfilingCommandsTest, givenKernelWhenProfilingComma ASSERT_NE(nullptr, storeReg); uint64_t gpuAddress = storeReg->getMemoryAddress(); - auto contextTimestampFieldOffset = offsetof(HwTimeStamps, ContextStartTS); + auto contextTimestampFieldOffset = offsetof(HwTimeStamps, contextStartTS); uint64_t expectedAddress = hwTimeStamp1->getGpuAddress() + contextTimestampFieldOffset; EXPECT_EQ(expectedAddress, gpuAddress); @@ -1368,7 +1368,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, ProfilingCommandsTest, givenKernelWhenProfilingComma ASSERT_NE(nullptr, pipeControl); gpuAddress = NEO::UnitTestHelper::getPipeControlPostSyncAddress(*pipeControl); - expectedAddress = hwTimeStamp1->getGpuAddress() + offsetof(HwTimeStamps, GlobalStartTS); + expectedAddress = hwTimeStamp1->getGpuAddress() + offsetof(HwTimeStamps, globalStartTS); EXPECT_EQ(expectedAddress, gpuAddress); itorPipeCtrl++; @@ -1384,7 +1384,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, ProfilingCommandsTest, givenKernelWhenProfilingComma ASSERT_NE(nullptr, pipeControl); gpuAddress = NEO::UnitTestHelper::getPipeControlPostSyncAddress(*pipeControl); - expectedAddress = hwTimeStamp2->getGpuAddress() + offsetof(HwTimeStamps, GlobalStartTS); + expectedAddress = hwTimeStamp2->getGpuAddress() + offsetof(HwTimeStamps, globalStartTS); EXPECT_EQ(expectedAddress, gpuAddress); } @@ -1413,7 +1413,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, ProfilingCommandsTest, givenKernelWhenProfilingComma ASSERT_NE(nullptr, storeReg); uint64_t gpuAddress = storeReg->getMemoryAddress(); - auto contextTimestampFieldOffset = offsetof(HwTimeStamps, ContextEndTS); + auto contextTimestampFieldOffset = offsetof(HwTimeStamps, contextEndTS); uint64_t expectedAddress = hwTimeStamp1->getGpuAddress() + contextTimestampFieldOffset; EXPECT_EQ(expectedAddress, gpuAddress); diff --git a/opencl/test/unit_test/event/event_tests.cpp b/opencl/test/unit_test/event/event_tests.cpp index 9f4fb54aba..0d319caa38 100644 --- a/opencl/test/unit_test/event/event_tests.cpp +++ b/opencl/test/unit_test/event/event_tests.cpp @@ -822,7 +822,7 @@ TEST_F(InternalsEventTest, givenDeviceTimestampBaseNotEnabledWhenCalculateStartT MockEvent event(&cmdQ, CL_COMPLETE, 0, 0); HwTimeStamps timestamp{}; - timestamp.GlobalStartTS = 2; + timestamp.globalStartTS = 2; event.queueTimeStamp.GPUTimeStamp = 1; event.queueTimeStamp.CPUTimeinNS = 100; TagNode timestampNode{}; @@ -835,7 +835,7 @@ TEST_F(InternalsEventTest, givenDeviceTimestampBaseNotEnabledWhenCalculateStartT auto resolution = pClDevice->getDevice().getDeviceInfo().profilingTimerResolution; auto &gfxCoreHelper = pClDevice->getGfxCoreHelper(); auto c0 = event.queueTimeStamp.CPUTimeinNS - gfxCoreHelper.getGpuTimeStampInNS(event.queueTimeStamp.GPUTimeStamp, resolution); - EXPECT_EQ(start, static_cast(timestamp.GlobalStartTS * resolution) + c0); + EXPECT_EQ(start, static_cast(timestamp.globalStartTS * resolution) + c0); event.timeStampNode = nullptr; } @@ -862,7 +862,7 @@ TEST_F(InternalsEventTest, givenDeviceTimestampBaseEnabledWhenCalculateStartTime MockEvent event(&cmdQ, CL_COMPLETE, 0, 0); HwTimeStamps timestamp{}; - timestamp.GlobalStartTS = 2; + timestamp.globalStartTS = 2; event.queueTimeStamp.GPUTimeStamp = 1; TagNode timestampNode{}; timestampNode.tagForCpuAccess = ×tamp; @@ -872,7 +872,7 @@ TEST_F(InternalsEventTest, givenDeviceTimestampBaseEnabledWhenCalculateStartTime event.getEventProfilingInfo(CL_PROFILING_COMMAND_START, sizeof(cl_ulong), &start, nullptr); auto resolution = pClDevice->getDevice().getDeviceInfo().profilingTimerResolution; - EXPECT_EQ(start, static_cast(timestamp.GlobalStartTS * resolution)); + EXPECT_EQ(start, static_cast(timestamp.globalStartTS * resolution)); event.timeStampNode = nullptr; } @@ -883,7 +883,7 @@ TEST_F(InternalsEventTest, givenDeviceTimestampBaseEnabledAndGlobalStartTSSmalle MockEvent event(&cmdQ, CL_COMPLETE, 0, 0); HwTimeStamps timestamp{}; - timestamp.GlobalStartTS = 1; + timestamp.globalStartTS = 1; event.queueTimeStamp.GPUTimeStamp = 2; TagNode timestampNode{}; timestampNode.tagForCpuAccess = ×tamp; @@ -894,7 +894,7 @@ TEST_F(InternalsEventTest, givenDeviceTimestampBaseEnabledAndGlobalStartTSSmalle auto &gfxCoreHelper = pClDevice->getGfxCoreHelper(); auto resolution = pClDevice->getDevice().getDeviceInfo().profilingTimerResolution; - auto refStartTime = static_cast(timestamp.GlobalStartTS * resolution + (1ULL << gfxCoreHelper.getGlobalTimeStampBits()) * resolution); + auto refStartTime = static_cast(timestamp.globalStartTS * resolution + (1ULL << gfxCoreHelper.getGlobalTimeStampBits()) * resolution); EXPECT_EQ(start, refStartTime); event.timeStampNode = nullptr; @@ -1369,12 +1369,12 @@ HWTEST_F(EventTest, WhenGettingHwTimeStampsThenValidPointerIsReturned) { ASSERT_NE(nullptr, timeStamps); // this should not cause any heap corruptions - ASSERT_EQ(0ULL, timeStamps->GlobalStartTS); - ASSERT_EQ(0ULL, timeStamps->ContextStartTS); - ASSERT_EQ(0ULL, timeStamps->GlobalEndTS); - ASSERT_EQ(0ULL, timeStamps->ContextEndTS); - ASSERT_EQ(0ULL, timeStamps->GlobalCompleteTS); - ASSERT_EQ(0ULL, timeStamps->ContextCompleteTS); + ASSERT_EQ(0ULL, timeStamps->globalStartTS); + ASSERT_EQ(0ULL, timeStamps->contextStartTS); + ASSERT_EQ(0ULL, timeStamps->globalEndTS); + ASSERT_EQ(0ULL, timeStamps->contextEndTS); + ASSERT_EQ(0ULL, timeStamps->globalCompleteTS); + ASSERT_EQ(0ULL, timeStamps->contextCompleteTS); HwTimeStamps *timeStamps2 = static_cast *>(event->getHwTimeStampNode())->tagForCpuAccess; ASSERT_EQ(timeStamps, timeStamps2); diff --git a/opencl/test/unit_test/event/event_tracker_tests.cpp b/opencl/test/unit_test/event/event_tracker_tests.cpp index 53e77aa797..b69ba66666 100644 --- a/opencl/test/unit_test/event/event_tracker_tests.cpp +++ b/opencl/test/unit_test/event/event_tracker_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2022 Intel Corporation + * Copyright (C) 2018-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -660,7 +660,7 @@ TEST(EventsTracker, givenEventsFromDifferentThreadsThenDumpingProperly) { auto trackedEventsMock = std::shared_ptr>{new IFList}; return trackedEventsMock->detachNodes(); } - std::shared_ptr> *TrackedEventsMock; + std::shared_ptr> *trackedEventsMock; }; auto evTrackerMockMT = std::shared_ptr{new EventsTrackerMockMT()}; diff --git a/opencl/test/unit_test/gen12lp/profiling_tests_gen12lp.inl b/opencl/test/unit_test/gen12lp/profiling_tests_gen12lp.inl index 1d1468c280..ded8a7ed42 100644 --- a/opencl/test/unit_test/gen12lp/profiling_tests_gen12lp.inl +++ b/opencl/test/unit_test/gen12lp/profiling_tests_gen12lp.inl @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2022 Intel Corporation + * Copyright (C) 2019-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -137,12 +137,12 @@ GEN12LPTEST_F(ProfilingTestsGen12LP, givenRawTimestampsDebugModeWhenDataIsQuerie cmdQ.device = device.get(); HwTimeStamps timestamp; - timestamp.GlobalStartTS = 10; - timestamp.ContextStartTS = 20; - timestamp.GlobalEndTS = 80; - timestamp.ContextEndTS = 56; - timestamp.GlobalCompleteTS = 0; - timestamp.ContextCompleteTS = 70; + timestamp.globalStartTS = 10; + timestamp.contextStartTS = 20; + timestamp.globalEndTS = 80; + timestamp.contextEndTS = 56; + timestamp.globalCompleteTS = 0; + timestamp.contextCompleteTS = 70; MockTagNode timestampNode; timestampNode.tagForCpuAccess = ×tamp; @@ -168,9 +168,9 @@ GEN12LPTEST_F(ProfilingTestsGen12LP, givenRawTimestampsDebugModeWhenDataIsQuerie clGetEventProfilingInfo(clEvent, CL_PROFILING_COMMAND_END, sizeof(cl_ulong), &end, nullptr); clGetEventProfilingInfo(clEvent, CL_PROFILING_COMMAND_COMPLETE, sizeof(cl_ulong), &complete, nullptr); - EXPECT_EQ(timestamp.GlobalEndTS, complete); - EXPECT_EQ(timestamp.GlobalEndTS, end); - EXPECT_EQ(timestamp.GlobalStartTS, start); + EXPECT_EQ(timestamp.globalEndTS, complete); + EXPECT_EQ(timestamp.globalEndTS, end); + EXPECT_EQ(timestamp.globalStartTS, start); EXPECT_EQ(event.submitTimeStamp.GPUTimeStamp, submited); EXPECT_EQ(event.queueTimeStamp.GPUTimeStamp, queued); event.timeStampNode = nullptr; diff --git a/opencl/test/unit_test/gmm_helper/gmm_helper_tests.cpp b/opencl/test/unit_test/gmm_helper/gmm_helper_tests.cpp index 92bebc7944..880cfa9c70 100644 --- a/opencl/test/unit_test/gmm_helper/gmm_helper_tests.cpp +++ b/opencl/test/unit_test/gmm_helper/gmm_helper_tests.cpp @@ -638,9 +638,9 @@ TEST_P(GmmImgTest, WhenUpdatingImgInfoAndDescThenInformationIsCorrect) { TEST_F(GmmImgTest, givenImgInfoWhenUpdatingOffsetsThenGmmIsCalledToGetOffsets) { struct GmmGetOffsetOutput { - uint32_t Offset; - uint32_t XOffset; - uint32_t YOffset; + uint32_t offset; + uint32_t xOffset; + uint32_t yOffset; }; struct MyMockGmmResourceInfo : MockGmmResourceInfo { @@ -651,9 +651,9 @@ TEST_F(GmmImgTest, givenImgInfoWhenUpdatingOffsetsThenGmmIsCalledToGetOffsets) { EXPECT_EQ(expectedArrayIndex, reqOffsetInfo.ArrayIndex); EXPECT_EQ(expectedGmmPlane, reqOffsetInfo.Plane); - reqOffsetInfo.Render.Offset = gmmGetOffsetOutput.Offset; - reqOffsetInfo.Render.XOffset = gmmGetOffsetOutput.XOffset; - reqOffsetInfo.Render.YOffset = gmmGetOffsetOutput.YOffset; + reqOffsetInfo.Render.Offset = gmmGetOffsetOutput.offset; + reqOffsetInfo.Render.XOffset = gmmGetOffsetOutput.xOffset; + reqOffsetInfo.Render.YOffset = gmmGetOffsetOutput.yOffset; return GMM_SUCCESS; } @@ -684,10 +684,10 @@ TEST_F(GmmImgTest, givenImgInfoWhenUpdatingOffsetsThenGmmIsCalledToGetOffsets) { mockGmmResourceInfo->gmmGetOffsetOutput = {10, 111, 120}; mockGmmResourceInfo->gmmGetBitsPerPixelOutput = 24; gmm->updateOffsetsInImgInfo(imgInfo, mockGmmResourceInfo->expectedArrayIndex); - EXPECT_EQ(mockGmmResourceInfo->gmmGetOffsetOutput.Offset, imgInfo.offset); - const auto expectedXOffset = mockGmmResourceInfo->gmmGetOffsetOutput.XOffset / (mockGmmResourceInfo->gmmGetBitsPerPixelOutput / 8); + EXPECT_EQ(mockGmmResourceInfo->gmmGetOffsetOutput.offset, imgInfo.offset); + const auto expectedXOffset = mockGmmResourceInfo->gmmGetOffsetOutput.xOffset / (mockGmmResourceInfo->gmmGetBitsPerPixelOutput / 8); EXPECT_EQ(expectedXOffset, imgInfo.xOffset); - EXPECT_EQ(mockGmmResourceInfo->gmmGetOffsetOutput.YOffset, imgInfo.yOffset); + EXPECT_EQ(mockGmmResourceInfo->gmmGetOffsetOutput.yOffset, imgInfo.yOffset); } TEST_F(GmmTests, GivenPlaneWhenCopyingResourceBltThenResourceIsCopiedCorrectly) { diff --git a/opencl/test/unit_test/mem_obj/buffer_pin_tests.cpp b/opencl/test/unit_test/mem_obj/buffer_pin_tests.cpp index 87b477f18e..bec2373665 100644 --- a/opencl/test/unit_test/mem_obj/buffer_pin_tests.cpp +++ b/opencl/test/unit_test/mem_obj/buffer_pin_tests.cpp @@ -36,26 +36,26 @@ class TestedMemoryManager : public OsAgnosticMemoryManager { return nullptr; }; GraphicsAllocation *allocateGraphicsMemoryWithHostPtr(const AllocationData &properties) override { - EXPECT_NE(0u, HPExpectedSize); - if (HPExpectedSize == properties.size) { + EXPECT_NE(0u, hpExpectedSize); + if (hpExpectedSize == properties.size) { EXPECT_TRUE(properties.flags.forcePin); - HPAllocCount++; + hpAllocCount++; } return OsAgnosticMemoryManager::allocateGraphicsMemoryWithHostPtr(properties); } GraphicsAllocation *allocateGraphicsMemoryForNonSvmHostPtr(const AllocationData &properties) override { - EXPECT_NE(0u, HPExpectedSize); - if (HPExpectedSize == properties.size) { + EXPECT_NE(0u, hpExpectedSize); + if (hpExpectedSize == properties.size) { EXPECT_TRUE(properties.flags.forcePin); - HPAllocCount++; + hpAllocCount++; } return OsAgnosticMemoryManager::allocateGraphicsMemoryForNonSvmHostPtr(properties); } size_t expectedSize = 0; uint32_t allocCount = 0; - size_t HPExpectedSize = 0; - uint32_t HPAllocCount = 0; + size_t hpExpectedSize = 0; + uint32_t hpAllocCount = 0; }; TEST(BufferTests, WhenBufferIsCreatedThenPinIsSet) { @@ -69,7 +69,7 @@ TEST(BufferTests, WhenBufferIsCreatedThenPinIsSet) { auto size = MemoryConstants::pageSize * 32; auto retVal = CL_INVALID_OPERATION; mm->expectedSize = size; - mm->HPExpectedSize = 0u; + mm->hpExpectedSize = 0u; context.memoryManager = mm.get(); auto buffer = Buffer::create( @@ -96,7 +96,7 @@ TEST(BufferTests, GivenHostPtrWhenBufferIsCreatedThenPinIsSet) { auto retVal = CL_INVALID_OPERATION; auto size = MemoryConstants::pageSize * 32; mm->expectedSize = 0u; - mm->HPExpectedSize = size; + mm->hpExpectedSize = size; context.memoryManager = mm.get(); // memory must be aligned to use zero-copy @@ -109,7 +109,7 @@ TEST(BufferTests, GivenHostPtrWhenBufferIsCreatedThenPinIsSet) { bff, retVal); EXPECT_EQ(CL_SUCCESS, retVal); - EXPECT_EQ(1u, mm->HPAllocCount); + EXPECT_EQ(1u, mm->hpAllocCount); delete buffer; alignedFree(bff); diff --git a/opencl/test/unit_test/mem_obj/image_redescribe_tests.cpp b/opencl/test/unit_test/mem_obj/image_redescribe_tests.cpp index 78a9a12581..0cb34035ed 100644 --- a/opencl/test/unit_test/mem_obj/image_redescribe_tests.cpp +++ b/opencl/test/unit_test/mem_obj/image_redescribe_tests.cpp @@ -30,16 +30,16 @@ class ImageRedescribeTest : public testing::TestWithParamGetParam(); + std::tie(indexImageFormat, imageType) = this->GetParam(); ArrayRef readWriteSurfaceFormats = SurfaceFormats::readWrite(); auto &surfaceFormatInfo = readWriteSurfaceFormats[indexImageFormat]; imageFormat = surfaceFormatInfo.OCLImageFormat; - auto imageHeight = ImageType == CL_MEM_OBJECT_IMAGE1D_ARRAY ? 0 : 32; - auto imageArrays = ImageType == CL_MEM_OBJECT_IMAGE1D_ARRAY || ImageType == CL_MEM_OBJECT_IMAGE2D_ARRAY ? 7 : 1; + auto imageHeight = imageType == CL_MEM_OBJECT_IMAGE1D_ARRAY ? 0 : 32; + auto imageArrays = imageType == CL_MEM_OBJECT_IMAGE1D_ARRAY || imageType == CL_MEM_OBJECT_IMAGE2D_ARRAY ? 7 : 1; - imageDesc.image_type = ImageType; + imageDesc.image_type = imageType; imageDesc.image_width = 32; imageDesc.image_height = imageHeight; imageDesc.image_depth = 1; @@ -70,7 +70,7 @@ class ImageRedescribeTest : public testing::TestWithParam image; size_t indexImageFormat = 0; - uint32_t ImageType; + uint32_t imageType; }; TEST_P(ImageRedescribeTest, givenImageWhenItIsRedescribedThenItContainsProperFormatFlagsAddressAndSameElementSizeInBytes) { @@ -159,11 +159,11 @@ TEST_P(ImageRedescribeTest, givenImageWithMaxSizesWhenItIsRedescribedThenNewImag auto imageWidth = 1; auto imageHeight = 1; - auto imageArrays = ImageType == CL_MEM_OBJECT_IMAGE1D_ARRAY || ImageType == CL_MEM_OBJECT_IMAGE2D_ARRAY ? 7 : 1; + auto imageArrays = imageType == CL_MEM_OBJECT_IMAGE1D_ARRAY || imageType == CL_MEM_OBJECT_IMAGE2D_ARRAY ? 7 : 1; size_t maxImageWidth = 0; size_t maxImageHeight = 0; - switch (ImageType) { + switch (imageType) { case CL_MEM_OBJECT_IMAGE1D: case CL_MEM_OBJECT_IMAGE1D_ARRAY: imageWidth = 16384; @@ -183,7 +183,7 @@ TEST_P(ImageRedescribeTest, givenImageWithMaxSizesWhenItIsRedescribedThenNewImag break; } - imageDesc.image_type = ImageType; + imageDesc.image_type = imageType; imageDesc.image_width = imageWidth; imageDesc.image_height = imageHeight; imageDesc.image_depth = 1; diff --git a/opencl/test/unit_test/mem_obj/zero_copy_tests.cpp b/opencl/test/unit_test/mem_obj/zero_copy_tests.cpp index 3a277d6be4..3597834f80 100644 --- a/opencl/test/unit_test/mem_obj/zero_copy_tests.cpp +++ b/opencl/test/unit_test/mem_obj/zero_copy_tests.cpp @@ -29,26 +29,26 @@ class ZeroCopyBufferTest : public ClDeviceFixture, void SetUp() override { size_t sizeToAlloc; size_t alignment; - host_ptr = nullptr; - std::tie(flags, sizeToAlloc, alignment, size, ShouldBeZeroCopy, MisalignPointer) = GetParam(); + hostPtr = nullptr; + std::tie(flags, sizeToAlloc, alignment, size, shouldBeZeroCopy, misalignPointer) = GetParam(); if (sizeToAlloc > 0) { - host_ptr = (void *)alignedMalloc(sizeToAlloc, alignment); + hostPtr = (void *)alignedMalloc(sizeToAlloc, alignment); } ClDeviceFixture::setUp(); } void TearDown() override { ClDeviceFixture::tearDown(); - alignedFree(host_ptr); + alignedFree(hostPtr); } cl_int retVal = CL_SUCCESS; MockContext context; cl_mem_flags flags = 0; - void *host_ptr; - bool ShouldBeZeroCopy; + void *hostPtr; + bool shouldBeZeroCopy; cl_int size; - bool MisalignPointer; + bool misalignPointer; }; static const int Multiplier = 1000; @@ -57,7 +57,7 @@ static const int CacheLinedMisAlignedSize = CacheLinedAlignedSize - 1; static const int PageAlignSize = MemoryConstants::preferredAlignment * Multiplier; // clang-format off -//flags, size to alloc, alignment, size, ZeroCopy, MisalignPointer +//flags, size to alloc, alignment, size, ZeroCopy, misalignPointer std::tuple Inputs[] = {std::make_tuple((cl_mem_flags)CL_MEM_USE_HOST_PTR, CacheLinedMisAlignedSize, MemoryConstants::preferredAlignment, CacheLinedMisAlignedSize, false, true), std::make_tuple((cl_mem_flags)CL_MEM_USE_HOST_PTR, CacheLinedAlignedSize, MemoryConstants::preferredAlignment, CacheLinedAlignedSize, false, true), std::make_tuple((cl_mem_flags)CL_MEM_USE_HOST_PTR, CacheLinedAlignedSize, MemoryConstants::preferredAlignment, CacheLinedAlignedSize, true, false), @@ -72,9 +72,9 @@ std::tuple Inputs[] = {std::make_tup TEST_P(ZeroCopyBufferTest, GivenCacheAlignedPointerWhenCreatingBufferThenZeroCopy) { - char *passedPtr = (char *)host_ptr; + char *passedPtr = (char *)hostPtr; // misalign the pointer - if (MisalignPointer && passedPtr) { + if (misalignPointer && passedPtr) { passedPtr += 1; } @@ -85,9 +85,9 @@ TEST_P(ZeroCopyBufferTest, GivenCacheAlignedPointerWhenCreatingBufferThenZeroCop passedPtr, retVal); EXPECT_EQ(CL_SUCCESS, retVal); - EXPECT_EQ(ShouldBeZeroCopy, buffer->isMemObjZeroCopy()) << "Zero Copy not handled properly"; - if (!ShouldBeZeroCopy && flags & CL_MEM_USE_HOST_PTR) { - EXPECT_NE(buffer->getCpuAddress(), host_ptr); + EXPECT_EQ(shouldBeZeroCopy, buffer->isMemObjZeroCopy()) << "Zero Copy not handled properly"; + if (!shouldBeZeroCopy && flags & CL_MEM_USE_HOST_PTR) { + EXPECT_NE(buffer->getCpuAddress(), hostPtr); } EXPECT_NE(nullptr, buffer->getCpuAddress()); diff --git a/opencl/test/unit_test/mocks/gl/linux/mock_gl_sharing_linux.h b/opencl/test/unit_test/mocks/gl/linux/mock_gl_sharing_linux.h index 0facfc8e9a..ad494fc629 100644 --- a/opencl/test/unit_test/mocks/gl/linux/mock_gl_sharing_linux.h +++ b/opencl/test/unit_test/mocks/gl/linux/mock_gl_sharing_linux.h @@ -86,32 +86,32 @@ class MockGlSharing { MockGlSharing() {} MockGlSharing(GLType glHDCType, GLContext glHGLRCHandle, GLContext glHGLRCHandleBkpCtx, GLDisplay glHDCHandle); void uploadDataToBufferInfo() { - dllParam->loadBuffer(m_bufferInfoOutput); + dllParam->loadBuffer(bufferInfoOutput); } void uploadDataToBufferInfo(unsigned int sharedHandle, int bufferOffset, GMM_RESOURCE_INFO *gmmResInfo) { - m_bufferInfoOutput.globalShareHandle = sharedHandle; - m_bufferInfoOutput.bufferOffset = bufferOffset; - m_bufferInfoOutput.pGmmResInfo = gmmResInfo; - dllParam->loadBuffer(m_bufferInfoOutput); + bufferInfoOutput.globalShareHandle = sharedHandle; + bufferInfoOutput.bufferOffset = bufferOffset; + bufferInfoOutput.pGmmResInfo = gmmResInfo; + dllParam->loadBuffer(bufferInfoOutput); } void uploadDataToTextureInfo() { - dllParam->loadTexture(m_textureInfoOutput); + dllParam->loadTexture(textureInfoOutput); } void uploadDataToTextureInfo(unsigned int sharedHandle) { - m_textureInfoOutput.globalShareHandle = sharedHandle; - dllParam->loadTexture(m_textureInfoOutput); + textureInfoOutput.globalShareHandle = sharedHandle; + dllParam->loadTexture(textureInfoOutput); } void uploadTextureBufferOffsetToTextureInfo(int texBufOffset) { - m_textureInfoOutput.textureBufferOffset = texBufOffset; - dllParam->loadTexture(m_textureInfoOutput); + textureInfoOutput.textureBufferOffset = texBufOffset; + dllParam->loadTexture(textureInfoOutput); } std::unique_ptr sharingFunctions = std::make_unique(); std::unique_ptr dllParam = std::make_unique(); - CL_GL_RESOURCE_INFO m_clGlResourceInfo = {0}; - GL_CL_RESOURCE_INFO m_glClResourceInfo = {0}; - CL_GL_BUFFER_INFO m_bufferInfoOutput = {0}; - CL_GL_RESOURCE_INFO m_textureInfoOutput = {0}; + CL_GL_RESOURCE_INFO clGlResourceInfo = {0}; + GL_CL_RESOURCE_INFO glClResourceInfo = {0}; + CL_GL_BUFFER_INFO bufferInfoOutput = {0}; + CL_GL_RESOURCE_INFO textureInfoOutput = {0}; }; class MockGLSharingFunctions : public GLSharingFunctionsLinux { diff --git a/opencl/test/unit_test/mocks/gl/windows/mock_gl_sharing_windows.h b/opencl/test/unit_test/mocks/gl/windows/mock_gl_sharing_windows.h index 419e1d7737..1a3be2810f 100644 --- a/opencl/test/unit_test/mocks/gl/windows/mock_gl_sharing_windows.h +++ b/opencl/test/unit_test/mocks/gl/windows/mock_gl_sharing_windows.h @@ -138,24 +138,24 @@ class MockGlSharing { MockGlSharing() {} MockGlSharing(GLType GLHDCType, GLContext GLHGLRCHandle, GLContext GLHGLRCHandleBkpCtx, GLDisplay GLHDCHandle); void uploadDataToBufferInfo() { - dllParam->loadBuffer(m_bufferInfoOutput); + dllParam->loadBuffer(bufferInfoOutput); } void uploadDataToBufferInfo(unsigned int sharedHandle, int bufferOffset, GMM_RESOURCE_INFO *gmmResInfo) { - m_bufferInfoOutput.globalShareHandle = sharedHandle; - m_bufferInfoOutput.bufferOffset = bufferOffset; - m_bufferInfoOutput.pGmmResInfo = gmmResInfo; - dllParam->loadBuffer(m_bufferInfoOutput); + bufferInfoOutput.globalShareHandle = sharedHandle; + bufferInfoOutput.bufferOffset = bufferOffset; + bufferInfoOutput.pGmmResInfo = gmmResInfo; + dllParam->loadBuffer(bufferInfoOutput); } void uploadDataToTextureInfo() { - dllParam->loadTexture(m_textureInfoOutput); + dllParam->loadTexture(textureInfoOutput); } void uploadDataToTextureInfo(unsigned int sharedHandle) { - m_textureInfoOutput.globalShareHandle = sharedHandle; - dllParam->loadTexture(m_textureInfoOutput); + textureInfoOutput.globalShareHandle = sharedHandle; + dllParam->loadTexture(textureInfoOutput); } void uploadTextureBufferOffsetToTextureInfo(int texBufOffset) { - m_textureInfoOutput.textureBufferOffset = texBufOffset; - dllParam->loadTexture(m_textureInfoOutput); + textureInfoOutput.textureBufferOffset = texBufOffset; + dllParam->loadTexture(textureInfoOutput); } void overrideGetCurrentValues(GLContext ctx, GLDisplay display, bool forceMakeCurrentFail = false, int numberOfFails = 0) { glMockReturnedValues.currentContext = ctx; @@ -172,10 +172,10 @@ class MockGlSharing { std::unique_ptr sharingFunctions = std::make_unique(); std::unique_ptr dllParam = std::make_unique(); - CL_GL_RESOURCE_INFO m_clGlResourceInfo = {0}; - GL_CL_RESOURCE_INFO m_glClResourceInfo = {0}; - CL_GL_BUFFER_INFO m_bufferInfoOutput = {0}; - CL_GL_RESOURCE_INFO m_textureInfoOutput = {0}; + CL_GL_RESOURCE_INFO clGlResourceInfo = {0}; + GL_CL_RESOURCE_INFO glClResourceInfo = {0}; + CL_GL_BUFFER_INFO bufferInfoOutput = {0}; + CL_GL_RESOURCE_INFO textureInfoOutput = {0}; GLMockReturnedValues glMockReturnedValues = {0}; }; diff --git a/opencl/test/unit_test/os_interface/linux/cl_drm_memory_manager_tests.cpp b/opencl/test/unit_test/os_interface/linux/cl_drm_memory_manager_tests.cpp index a503d95ee6..0ea4fa1385 100644 --- a/opencl/test/unit_test/os_interface/linux/cl_drm_memory_manager_tests.cpp +++ b/opencl/test/unit_test/os_interface/linux/cl_drm_memory_manager_tests.cpp @@ -67,9 +67,9 @@ struct ClDrmMemoryManagerTest : public DrmMemoryManagerTest { TEST_F(ClDrmMemoryManagerTest, Given32bitAllocatorWhenAskedForBufferAllocationThen32BitBufferIsReturned) { DebugManagerStateRestore dbgRestorer; - mock->ioctl_expected.gemUserptr = 1; - mock->ioctl_expected.gemWait = 1; - mock->ioctl_expected.gemClose = 1; + mock->ioctlExpected.gemUserptr = 1; + mock->ioctlExpected.gemWait = 1; + mock->ioctlExpected.gemClose = 1; DebugManager.flags.Force32bitAddressing.set(true); MockContext context(pClDevice); @@ -97,9 +97,9 @@ TEST_F(ClDrmMemoryManagerTest, Given32bitAllocatorWhenAskedForBufferAllocationTh TEST_F(ClDrmMemoryManagerTest, Given32bitAllocatorWhenAskedForBufferCreatedFromHostPtrThen32BitBufferIsReturned) { DebugManagerStateRestore dbgRestorer; - mock->ioctl_expected.gemUserptr = 1; - mock->ioctl_expected.gemWait = 1; - mock->ioctl_expected.gemClose = 1; + mock->ioctlExpected.gemUserptr = 1; + mock->ioctlExpected.gemWait = 1; + mock->ioctlExpected.gemClose = 1; DebugManager.flags.Force32bitAddressing.set(true); MockContext context(pClDevice); @@ -155,11 +155,11 @@ TEST_F(ClDrmMemoryManagerTest, Given32bitAllocatorWhenAskedForBufferCreatedFrom6 DebugManagerStateRestore dbgRestorer; { if (is32bit) { - mock->ioctl_expected.total = -1; + mock->ioctlExpected.total = -1; } else { - mock->ioctl_expected.gemUserptr = 1; - mock->ioctl_expected.gemWait = 1; - mock->ioctl_expected.gemClose = 1; + mock->ioctlExpected.gemUserptr = 1; + mock->ioctlExpected.gemWait = 1; + mock->ioctlExpected.gemClose = 1; DebugManager.flags.Force32bitAddressing.set(true); MockContext context(pClDevice); @@ -206,7 +206,7 @@ TEST_F(ClDrmMemoryManagerTest, Given32bitAllocatorWhenAskedForBufferCreatedFrom6 TEST_F(ClDrmMemoryManagerTest, GivenSizeAbove2GBWhenUseHostPtrAndAllocHostPtrAreCreatedThenFirstSucceedsAndSecondFails) { DebugManagerStateRestore dbgRestorer; - mock->ioctl_expected.total = -1; + mock->ioctlExpected.total = -1; DebugManager.flags.Force32bitAddressing.set(true); MockContext context(pClDevice); memoryManager->setForce32BitAllocations(true); @@ -247,7 +247,7 @@ TEST_F(ClDrmMemoryManagerTest, GivenSizeAbove2GBWhenUseHostPtrAndAllocHostPtrAre TEST_F(ClDrmMemoryManagerTest, GivenSizeAbove2GBWhenAllocHostPtrAndUseHostPtrAreCreatedThenFirstSucceedsAndSecondFails) { DebugManagerStateRestore dbgRestorer; - mock->ioctl_expected.total = -1; + mock->ioctlExpected.total = -1; DebugManager.flags.Force32bitAddressing.set(true); MockContext context(pClDevice); memoryManager->setForce32BitAllocations(true); @@ -287,7 +287,7 @@ TEST_F(ClDrmMemoryManagerTest, GivenSizeAbove2GBWhenAllocHostPtrAndUseHostPtrAre } TEST_F(ClDrmMemoryManagerTest, givenDrmBufferWhenItIsQueriedForInternalAllocationThenBoIsReturned) { - mock->ioctl_expected.total = -1; + mock->ioctlExpected.total = -1; mock->outputFd = 1337; MockContext context(pClDevice); @@ -315,10 +315,10 @@ HWTEST_F(ClDrmMemoryManagerTest, givenDrmMemoryManagerWhenTiledImageWithMipCount if (!defaultHwInfo->capabilityTable.supportsImages) { GTEST_SKIP(); } - mock->ioctl_expected.gemCreate = 1; - mock->ioctl_expected.gemSetTiling = 1; - mock->ioctl_expected.gemWait = 1; - mock->ioctl_expected.gemClose = 1; + mock->ioctlExpected.gemCreate = 1; + mock->ioctlExpected.gemSetTiling = 1; + mock->ioctlExpected.gemWait = 1; + mock->ioctlExpected.gemClose = 1; MockContext context(pClDevice); @@ -363,10 +363,10 @@ HWTEST_F(ClDrmMemoryManagerTest, givenDrmMemoryManagerWhenTiledImageWithMipCount if (!defaultHwInfo->capabilityTable.supportsImages) { GTEST_SKIP(); } - mock->ioctl_expected.gemCreate = 1; - mock->ioctl_expected.gemSetTiling = 1; - mock->ioctl_expected.gemWait = 1; - mock->ioctl_expected.gemClose = 1; + mock->ioctlExpected.gemCreate = 1; + mock->ioctlExpected.gemSetTiling = 1; + mock->ioctlExpected.gemWait = 1; + mock->ioctlExpected.gemClose = 1; MockContext context(pClDevice); @@ -451,34 +451,34 @@ HWTEST_F(ClDrmMemoryManagerTest, givenDrmMemoryManagerWhenTiledImageIsBeingCreat auto csr = static_cast *>(device->getDefaultEngine().commandStreamReceiver); csr->flushInternalCallBase = false; - mock->ioctl_expected.gemCreate = 1; - mock->ioctl_expected.gemSetTiling = 1; - mock->ioctl_expected.gemWait = 2; - mock->ioctl_expected.gemClose = 2; - mock->ioctl_expected.gemUserptr = 1; - mock->ioctl_expected.execbuffer2 = 0; + mock->ioctlExpected.gemCreate = 1; + mock->ioctlExpected.gemSetTiling = 1; + mock->ioctlExpected.gemWait = 2; + mock->ioctlExpected.gemClose = 2; + mock->ioctlExpected.gemUserptr = 1; + mock->ioctlExpected.execbuffer2 = 0; // builtins kernels - mock->ioctl_expected.gemUserptr += 5; + mock->ioctlExpected.gemUserptr += 5; // command buffers - mock->ioctl_expected.gemUserptr += 2; + mock->ioctlExpected.gemUserptr += 2; additionalDestroyDeviceIoctls.gemClose += 2; additionalDestroyDeviceIoctls.gemWait += 2; // indirect heaps - mock->ioctl_expected.gemUserptr += 3; + mock->ioctlExpected.gemUserptr += 3; additionalDestroyDeviceIoctls.gemClose += 3; additionalDestroyDeviceIoctls.gemWait += 3; if (device->getDefaultEngine().commandStreamReceiver->peekTimestampPacketWriteEnabled()) { - mock->ioctl_expected.gemUserptr++; + mock->ioctlExpected.gemUserptr++; additionalDestroyDeviceIoctls.gemClose++; additionalDestroyDeviceIoctls.gemWait++; } if (device->getDefaultEngine().commandStreamReceiver->getClearColorAllocation() != nullptr) { - mock->ioctl_expected.gemUserptr++; + mock->ioctlExpected.gemUserptr++; additionalDestroyDeviceIoctls.gemClose++; additionalDestroyDeviceIoctls.gemWait++; } @@ -530,9 +530,9 @@ HWTEST_F(ClDrmMemoryManagerTest, givenDrmMemoryManagerWhenTiledImageIsBeingCreat } TEST_F(ClDrmMemoryManagerTest, givenDrmMemoryManagerWhenMemoryAllocatedForImageThenUnmapSizeCorrectlySetWhenLimitedRangeAllocationUsedOrNotUsed) { - mock->ioctl_expected.gemUserptr = 2; - mock->ioctl_expected.gemWait = 2; - mock->ioctl_expected.gemClose = 2; + mock->ioctlExpected.gemUserptr = 2; + mock->ioctlExpected.gemWait = 2; + mock->ioctlExpected.gemClose = 2; MockContext context(pClDevice); @@ -563,9 +563,9 @@ TEST_F(ClDrmMemoryManagerTest, givenDrmMemoryManagerWhenMemoryAllocatedForImageT } TEST_F(ClDrmMemoryManagerTest, givenDrmMemoryManagerWhenNonTiledImgWithMipCountZeroisBeingCreatedThenAllocateGraphicsMemoryIsUsed) { - mock->ioctl_expected.gemUserptr = 2; - mock->ioctl_expected.gemWait = 2; - mock->ioctl_expected.gemClose = 2; + mock->ioctlExpected.gemUserptr = 2; + mock->ioctlExpected.gemWait = 2; + mock->ioctlExpected.gemClose = 2; MockContext context(pClDevice); @@ -610,9 +610,9 @@ TEST_F(ClDrmMemoryManagerTest, givenDrmMemoryManagerWhenNonTiledImgWithMipCountZ } TEST_F(ClDrmMemoryManagerTest, givenDrmMemoryManagerWhenNonTiledImgWithMipCountNonZeroisBeingCreatedThenAllocateGraphicsMemoryIsUsed) { - mock->ioctl_expected.gemUserptr = 1; - mock->ioctl_expected.gemWait = 1; - mock->ioctl_expected.gemClose = 1; + mock->ioctlExpected.gemUserptr = 1; + mock->ioctlExpected.gemWait = 1; + mock->ioctlExpected.gemClose = 1; MockContext context(pClDevice); @@ -660,9 +660,9 @@ TEST_F(ClDrmMemoryManagerTest, givenDrmMemoryManagerWhenNonTiledImgWithMipCountN } TEST_F(ClDrmMemoryManagerTest, givenDrmMemoryManagerWhen1DarrayImageIsBeingCreatedFromHostPtrThenTilingIsNotCalled) { - mock->ioctl_expected.gemUserptr = 2; - mock->ioctl_expected.gemWait = 2; - mock->ioctl_expected.gemClose = 2; + mock->ioctlExpected.gemUserptr = 2; + mock->ioctlExpected.gemWait = 2; + mock->ioctlExpected.gemClose = 2; MockContext context(pClDevice); @@ -703,9 +703,9 @@ TEST_F(ClDrmMemoryManagerTest, givenDrmMemoryManagerWhen1DarrayImageIsBeingCreat } TEST_F(ClDrmMemoryManagerTest, givenHostPointerNotRequiringCopyWhenAllocateGraphicsMemoryForImageIsCalledThenGraphicsAllocationIsReturned) { - mock->ioctl_expected.gemUserptr = 1; - mock->ioctl_expected.gemWait = 1; - mock->ioctl_expected.gemClose = 1; + mock->ioctlExpected.gemUserptr = 1; + mock->ioctlExpected.gemWait = 1; + mock->ioctlExpected.gemClose = 1; ImageDescriptor imgDesc = {}; imgDesc.imageType = ImageType::Image1D; @@ -744,10 +744,10 @@ TEST_F(ClDrmMemoryManagerTest, givenHostPointerNotRequiringCopyWhenAllocateGraph } TEST_F(ClDrmMemoryManagerTest, givenOsHandleWithNonTiledObjectWhenCreateFromSharedHandleIsCalledThenNonTiledGmmIsCreatedAndSetInAllocation) { - mock->ioctl_expected.primeFdToHandle = 1; - mock->ioctl_expected.gemWait = 1; - mock->ioctl_expected.gemClose = 1; - mock->ioctl_expected.gemGetTiling = 1; + mock->ioctlExpected.primeFdToHandle = 1; + mock->ioctlExpected.gemWait = 1; + mock->ioctlExpected.gemClose = 1; + mock->ioctlExpected.gemGetTiling = 1; auto ioctlHelper = this->mock->getIoctlHelper(); mock->getTilingModeOut = ioctlHelper->getDrmParamValue(DrmParam::TilingNone); @@ -787,10 +787,10 @@ TEST_F(ClDrmMemoryManagerTest, givenOsHandleWithNonTiledObjectWhenCreateFromShar } TEST_F(ClDrmMemoryManagerTest, givenOsHandleWithTileYObjectWhenCreateFromSharedHandleIsCalledThenTileYGmmIsCreatedAndSetInAllocation) { - mock->ioctl_expected.primeFdToHandle = 1; - mock->ioctl_expected.gemWait = 1; - mock->ioctl_expected.gemClose = 1; - mock->ioctl_expected.gemGetTiling = 1; + mock->ioctlExpected.primeFdToHandle = 1; + mock->ioctlExpected.gemWait = 1; + mock->ioctlExpected.gemClose = 1; + mock->ioctlExpected.gemGetTiling = 1; auto ioctlHelper = this->mock->getIoctlHelper(); mock->getTilingModeOut = ioctlHelper->getDrmParamValue(DrmParam::TilingY); @@ -829,12 +829,12 @@ TEST_F(ClDrmMemoryManagerTest, givenOsHandleWithTileYObjectWhenCreateFromSharedH } TEST_F(ClDrmMemoryManagerTest, givenDrmMemoryManagerWhenCreateFromSharedHandleFailsToCallGetTilingThenNonLinearStorageIsAssumed) { - mock->ioctl_expected.primeFdToHandle = 1; - mock->ioctl_expected.gemGetTiling = 1; - mock->ioctl_expected.gemWait = 1; - mock->ioctl_expected.gemClose = 1; - this->ioctlResExt = {mock->ioctl_cnt.total + 1, -1}; - mock->ioctl_res_ext = &ioctlResExt; + mock->ioctlExpected.primeFdToHandle = 1; + mock->ioctlExpected.gemGetTiling = 1; + mock->ioctlExpected.gemWait = 1; + mock->ioctlExpected.gemClose = 1; + this->ioctlResExt = {mock->ioctlCnt.total + 1, -1}; + mock->ioctlResExt = &ioctlResExt; osHandle handle = 1u; uint32_t boHandle = 2u; diff --git a/opencl/test/unit_test/os_interface/linux/drm_va_sharing_tests.cpp b/opencl/test/unit_test/os_interface/linux/drm_va_sharing_tests.cpp index b72665ae9e..8e39f593ea 100644 --- a/opencl/test/unit_test/os_interface/linux/drm_va_sharing_tests.cpp +++ b/opencl/test/unit_test/os_interface/linux/drm_va_sharing_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2022 Intel Corporation + * Copyright (C) 2020-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -20,7 +20,7 @@ namespace NEO { using DrmVaSharingTest = Test; TEST_F(DrmVaSharingTest, givenDrmMemoryManagerWhenSharedVaSurfaceIsImportedWithDrmPrimeFdToHandleThenDrmPrimeFdCanBeClosed) { - mock->ioctl_expected.total = -1; + mock->ioctlExpected.total = -1; device->incRefInternal(); MockClDevice clDevice{device}; MockContext context(&clDevice); diff --git a/opencl/test/unit_test/profiling/profiling_tests.cpp b/opencl/test/unit_test/profiling/profiling_tests.cpp index 0daeed1cb3..8fd4e3654b 100644 --- a/opencl/test/unit_test/profiling/profiling_tests.cpp +++ b/opencl/test/unit_test/profiling/profiling_tests.cpp @@ -549,12 +549,12 @@ HWCMDTEST_F(IGFX_GEN8_CORE, EventProfilingTest, givenEventWhenCompleteIsZeroThen cmdQ.device = device.get(); HwTimeStamps timestamp; - timestamp.GlobalStartTS = 10; - timestamp.ContextStartTS = 20; - timestamp.GlobalEndTS = 80; - timestamp.ContextEndTS = 56; - timestamp.GlobalCompleteTS = 0; - timestamp.ContextCompleteTS = 0; + timestamp.globalStartTS = 10; + timestamp.contextStartTS = 20; + timestamp.globalEndTS = 80; + timestamp.contextEndTS = 56; + timestamp.globalCompleteTS = 0; + timestamp.contextCompleteTS = 0; MockTagNode timestampNode; timestampNode.tagForCpuAccess = ×tamp; @@ -565,7 +565,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, EventProfilingTest, givenEventWhenCompleteIsZeroThen event.timeStampNode = ×tampNode; event.calcProfilingData(); - EXPECT_EQ(timestamp.ContextEndTS, timestamp.ContextCompleteTS); + EXPECT_EQ(timestamp.contextEndTS, timestamp.contextCompleteTS); cmdQ.device = nullptr; event.timeStampNode = nullptr; } @@ -586,12 +586,12 @@ HWCMDTEST_F(IGFX_GEN8_CORE, EventProfilingTests, givenRawTimestampsDebugModeWhen cmdQ.device = device.get(); HwTimeStamps timestamp; - timestamp.GlobalStartTS = 10; - timestamp.ContextStartTS = 20; - timestamp.GlobalEndTS = 80; - timestamp.ContextEndTS = 56; - timestamp.GlobalCompleteTS = 0; - timestamp.ContextCompleteTS = 70; + timestamp.globalStartTS = 10; + timestamp.contextStartTS = 20; + timestamp.globalEndTS = 80; + timestamp.contextEndTS = 56; + timestamp.globalCompleteTS = 0; + timestamp.contextCompleteTS = 70; MockTagNode timestampNode; timestampNode.tagForCpuAccess = ×tamp; @@ -617,9 +617,9 @@ HWCMDTEST_F(IGFX_GEN8_CORE, EventProfilingTests, givenRawTimestampsDebugModeWhen clGetEventProfilingInfo(clEvent, CL_PROFILING_COMMAND_END, sizeof(cl_ulong), &end, nullptr); clGetEventProfilingInfo(clEvent, CL_PROFILING_COMMAND_COMPLETE, sizeof(cl_ulong), &complete, nullptr); - EXPECT_EQ(timestamp.ContextCompleteTS, complete); - EXPECT_EQ(timestamp.ContextEndTS, end); - EXPECT_EQ(timestamp.ContextStartTS, start); + EXPECT_EQ(timestamp.contextCompleteTS, complete); + EXPECT_EQ(timestamp.contextEndTS, end); + EXPECT_EQ(timestamp.contextStartTS, start); EXPECT_EQ(event.submitTimeStamp.GPUTimeStamp, submited); EXPECT_EQ(event.queueTimeStamp.GPUTimeStamp, queued); event.timeStampNode = nullptr; @@ -638,12 +638,12 @@ HWCMDTEST_F(IGFX_GEN8_CORE, EventProfilingTest, givenRawTimestampsDebugModeWhenS cmdQ.device = device.get(); HwTimeStamps timestamp; - timestamp.GlobalStartTS = 0; - timestamp.ContextStartTS = 20; - timestamp.GlobalEndTS = 80; - timestamp.ContextEndTS = 56; - timestamp.GlobalCompleteTS = 0; - timestamp.ContextCompleteTS = 70; + timestamp.globalStartTS = 0; + timestamp.contextStartTS = 20; + timestamp.globalEndTS = 80; + timestamp.contextEndTS = 56; + timestamp.globalCompleteTS = 0; + timestamp.contextCompleteTS = 70; MockTagNode timestampNode; timestampNode.tagForCpuAccess = ×tamp; @@ -1001,10 +1001,10 @@ HWCMDTEST_F(IGFX_GEN8_CORE, ProfilingWithPerfCountersTests, GivenCommandQueueWit auto &cmdList = parse.cmdList; parse.parseCommands(*pCmdQ); - auto itor = expectStoreRegister(cmdList, cmdList.begin(), timeStampGpuAddress + offsetof(HwTimeStamps, ContextStartTS), GP_THREAD_TIME_REG_ADDRESS_OFFSET_LOW); + auto itor = expectStoreRegister(cmdList, cmdList.begin(), timeStampGpuAddress + offsetof(HwTimeStamps, contextStartTS), GP_THREAD_TIME_REG_ADDRESS_OFFSET_LOW); // after WALKER: - itor = expectStoreRegister(cmdList, itor, timeStampGpuAddress + offsetof(HwTimeStamps, ContextEndTS), GP_THREAD_TIME_REG_ADDRESS_OFFSET_LOW); + itor = expectStoreRegister(cmdList, itor, timeStampGpuAddress + offsetof(HwTimeStamps, contextEndTS), GP_THREAD_TIME_REG_ADDRESS_OFFSET_LOW); EXPECT_TRUE(pEvent->calcProfilingData()); @@ -1207,9 +1207,9 @@ TEST_F(ProfilingTimestampPacketsTest, givenTimestampsPacketContainerWithOneEleme addTimestampNode(10, 11, 12, 13); HwTimeStamps hwTimestamps; - hwTimestamps.ContextStartTS = 100; - hwTimestamps.ContextEndTS = 110; - hwTimestamps.GlobalStartTS = 120; + hwTimestamps.contextStartTS = 100; + hwTimestamps.contextEndTS = 110; + hwTimestamps.globalStartTS = 120; MockTagNode hwTimestampsNode; hwTimestampsNode.tagForCpuAccess = &hwTimestamps; diff --git a/opencl/test/unit_test/sharings/gl/linux/gl_create_from_texture_tests.cpp b/opencl/test/unit_test/sharings/gl/linux/gl_create_from_texture_tests.cpp index 0ec0c0263d..a94b2c553b 100644 --- a/opencl/test/unit_test/sharings/gl/linux/gl_create_from_texture_tests.cpp +++ b/opencl/test/unit_test/sharings/gl/linux/gl_create_from_texture_tests.cpp @@ -69,7 +69,7 @@ class CreateFromGlTexture : public ::testing::Test { tempMM.forceAllocationSize = imgInfo.size; tempMM.forceGmm = gmm.get(); - if (glSharing->m_textureInfoOutput.globalShareHandleMCS != 0) { + if (glSharing->textureInfoOutput.globalShareHandleMCS != 0) { ImageDescriptor mcsImgDesc = {}; mcsImgDesc.imageHeight = 128; mcsImgDesc.imageRowPitch = 256; @@ -125,15 +125,15 @@ TEST_P(CreateFromGlTextureTestsWithParams, givenAllTextureSpecificParamsWhenCrea if (target == GL_TEXTURE_BUFFER) { // size and width for texture buffer are queried from textureInfo - not from gmm - glSharing->m_textureInfoOutput.textureBufferWidth = 64; - glSharing->m_textureInfoOutput.textureBufferSize = 1024; + glSharing->textureInfoOutput.textureBufferWidth = 64; + glSharing->textureInfoOutput.textureBufferSize = 1024; glSharing->uploadDataToTextureInfo(); } if (target == GL_TEXTURE_2D_MULTISAMPLE || target == GL_TEXTURE_2D_MULTISAMPLE_ARRAY) { imgDesc.numSamples = 16; - glSharing->m_textureInfoOutput.numberOfSamples = 16; - glSharing->m_textureInfoOutput.globalShareHandleMCS = CreateFromGlTexture::mcsHandle; + glSharing->textureInfoOutput.numberOfSamples = 16; + glSharing->textureInfoOutput.globalShareHandleMCS = CreateFromGlTexture::mcsHandle; glSharing->uploadDataToTextureInfo(); } diff --git a/opencl/test/unit_test/sharings/gl/linux/gl_sharing_tests.cpp b/opencl/test/unit_test/sharings/gl/linux/gl_sharing_tests.cpp index 9c0a6cc0cb..5bf72cdc5a 100644 --- a/opencl/test/unit_test/sharings/gl/linux/gl_sharing_tests.cpp +++ b/opencl/test/unit_test/sharings/gl/linux/gl_sharing_tests.cpp @@ -47,8 +47,8 @@ class GlSharingTests : public ::testing::Test { mockGlSharingFunctions = mockGlSharing->sharingFunctions.release(); context.setSharingFunctions(mockGlSharingFunctions); - mockGlSharing->m_bufferInfoOutput.globalShareHandle = bufferId; - mockGlSharing->m_bufferInfoOutput.bufferSize = 4096u; + mockGlSharing->bufferInfoOutput.globalShareHandle = bufferId; + mockGlSharing->bufferInfoOutput.bufferSize = 4096u; mockGlSharing->uploadDataToBufferInfo(); } diff --git a/opencl/test/unit_test/sharings/gl/linux/gl_texture_tests.cpp b/opencl/test/unit_test/sharings/gl/linux/gl_texture_tests.cpp index cf3ec5c378..33c5f2f4f2 100644 --- a/opencl/test/unit_test/sharings/gl/linux/gl_texture_tests.cpp +++ b/opencl/test/unit_test/sharings/gl/linux/gl_texture_tests.cpp @@ -174,10 +174,10 @@ TEST_F(GlSharingTextureTests, givenMockGlWhenGlTextureIsCreatedFromIncorrectForm TEST_F(GlSharingTextureTests, givenGmmResourceAsInputWhenTextureIsCreatedThenItHasGmmSet) { cl_int retVal = CL_INVALID_VALUE; - glSharing->m_textureInfoOutput.globalShareHandle = textureId; - glSharing->m_textureInfoOutput.pGmmResInfo = this->tempMM->forceGmm->gmmResourceInfo->peekGmmResourceInfo(); + glSharing->textureInfoOutput.globalShareHandle = textureId; + glSharing->textureInfoOutput.pGmmResInfo = this->tempMM->forceGmm->gmmResourceInfo->peekGmmResourceInfo(); this->tempMM->useForcedGmm = false; - glSharing->m_textureInfoOutput.pGmmResInfo = this->tempMM->forceGmm->gmmResourceInfo->peekGmmResourceInfo(); + glSharing->textureInfoOutput.pGmmResInfo = this->tempMM->forceGmm->gmmResourceInfo->peekGmmResourceInfo(); glSharing->uploadDataToTextureInfo(); diff --git a/opencl/test/unit_test/sharings/gl/windows/gl_create_from_texture_tests.cpp b/opencl/test/unit_test/sharings/gl/windows/gl_create_from_texture_tests.cpp index c6930aeca5..fe63124116 100644 --- a/opencl/test/unit_test/sharings/gl/windows/gl_create_from_texture_tests.cpp +++ b/opencl/test/unit_test/sharings/gl/windows/gl_create_from_texture_tests.cpp @@ -65,7 +65,7 @@ class CreateFromGlTexture : public ::testing::Test { tempMM.forceAllocationSize = imgInfo.size; tempMM.forceGmm = gmm.get(); - if (glSharing->m_textureInfoOutput.globalShareHandleMCS != 0) { + if (glSharing->textureInfoOutput.globalShareHandleMCS != 0) { ImageDescriptor mcsImgDesc = {}; mcsImgDesc.imageHeight = 128; mcsImgDesc.imageRowPitch = 256; @@ -121,15 +121,15 @@ TEST_P(CreateFromGlTextureTestsWithParams, givenAllTextureSpecificParamsWhenCrea if (target == GL_TEXTURE_BUFFER) { // size and width for texture buffer are queried from textureInfo - not from gmm - glSharing->m_textureInfoOutput.textureBufferWidth = 64; - glSharing->m_textureInfoOutput.textureBufferSize = 1024; + glSharing->textureInfoOutput.textureBufferWidth = 64; + glSharing->textureInfoOutput.textureBufferSize = 1024; glSharing->uploadDataToTextureInfo(); } if (target == GL_TEXTURE_2D_MULTISAMPLE || target == GL_TEXTURE_2D_MULTISAMPLE_ARRAY) { imgDesc.numSamples = 16; - glSharing->m_textureInfoOutput.numberOfSamples = 16; - glSharing->m_textureInfoOutput.globalShareHandleMCS = CreateFromGlTexture::mcsHandle; + glSharing->textureInfoOutput.numberOfSamples = 16; + glSharing->textureInfoOutput.globalShareHandleMCS = CreateFromGlTexture::mcsHandle; glSharing->uploadDataToTextureInfo(); } diff --git a/opencl/test/unit_test/sharings/gl/windows/gl_sharing_tests.cpp b/opencl/test/unit_test/sharings/gl/windows/gl_sharing_tests.cpp index 0a6911ff1e..29a08ec662 100644 --- a/opencl/test/unit_test/sharings/gl/windows/gl_sharing_tests.cpp +++ b/opencl/test/unit_test/sharings/gl/windows/gl_sharing_tests.cpp @@ -48,8 +48,8 @@ class glSharingTests : public ::testing::Test { mockGlSharingFunctions = mockGlSharing->sharingFunctions.release(); context.setSharingFunctions(mockGlSharingFunctions); - mockGlSharing->m_bufferInfoOutput.globalShareHandle = bufferId; - mockGlSharing->m_bufferInfoOutput.bufferSize = 4096u; + mockGlSharing->bufferInfoOutput.globalShareHandle = bufferId; + mockGlSharing->bufferInfoOutput.bufferSize = 4096u; mockGlSharing->uploadDataToBufferInfo(); } @@ -62,8 +62,8 @@ class glSharingTests : public ::testing::Test { TEST_F(glSharingTests, givenGlMockWhenItIsCreatedThenNonZeroObjectIsReturned) { EXPECT_NE(nullptr, &mockGlSharing); - EXPECT_NE(nullptr, &mockGlSharing->m_clGlResourceInfo); - EXPECT_NE(nullptr, &mockGlSharing->m_glClResourceInfo); + EXPECT_NE(nullptr, &mockGlSharing->clGlResourceInfo); + EXPECT_NE(nullptr, &mockGlSharing->glClResourceInfo); } TEST_F(glSharingTests, givenGLSharingFunctionsWhenAskedForIdThenClGlSharingIdIsReturned) { @@ -256,7 +256,7 @@ TEST_F(glSharingTests, givenClGLBufferWhenItIsCreatedAndGmmIsAvailableThenItIsUs auto rootDeviceIndex = context.getDevice(0)->getRootDeviceIndex(); auto gmm = new Gmm(context.getDevice(0)->getGmmHelper(), ptr, 4096u, 0, GMM_RESOURCE_USAGE_OCL_BUFFER, false, {}, true); - mockGlSharing->m_bufferInfoOutput.pGmmResInfo = gmm->gmmResourceInfo->peekGmmResourceInfo(); + mockGlSharing->bufferInfoOutput.pGmmResInfo = gmm->gmmResourceInfo->peekGmmResourceInfo(); mockGlSharing->uploadDataToBufferInfo(); auto retVal = CL_SUCCESS; @@ -314,14 +314,14 @@ TEST_F(glSharingTests, givenClGLBufferWhenItIsAcquiredWithDifferentOffsetThenGra auto graphicsAddress = memObject->getGraphicsAllocation(rootDeviceIndex)->getGpuAddress(); - mockGlSharing->m_bufferInfoOutput.bufferOffset = 50u; + mockGlSharing->bufferInfoOutput.bufferOffset = 50u; mockGlSharing->uploadDataToBufferInfo(); memObject->peekSharingHandler()->acquire(memObject, rootDeviceIndex); auto offsetedGraphicsAddress = memObject->getGraphicsAllocation(rootDeviceIndex)->getGpuAddress(); - EXPECT_EQ(offsetedGraphicsAddress, graphicsAddress + mockGlSharing->m_bufferInfoOutput.bufferOffset); + EXPECT_EQ(offsetedGraphicsAddress, graphicsAddress + mockGlSharing->bufferInfoOutput.bufferOffset); retVal = clReleaseMemObject(glBuffer); EXPECT_EQ(CL_SUCCESS, retVal); @@ -609,7 +609,7 @@ HWTEST_F(glSharingTests, givenCommandQueueWhenReleaseGlObjectIsCalledThenFinishI } TEST_F(glSharingTests, givenMockGLWhenFunctionsAreCalledThenCallsAreReceived) { - auto ptrToStruct = &mockGlSharing->m_clGlResourceInfo; + auto ptrToStruct = &mockGlSharing->clGlResourceInfo; auto glDisplay = (GLDisplay)1; auto glContext = (GLContext)1; mockGlSharing->overrideGetCurrentValues(glContext, glDisplay); diff --git a/opencl/test/unit_test/sharings/gl/windows/gl_texture_tests.cpp b/opencl/test/unit_test/sharings/gl/windows/gl_texture_tests.cpp index 7f0d6542cb..defdd89469 100644 --- a/opencl/test/unit_test/sharings/gl/windows/gl_texture_tests.cpp +++ b/opencl/test/unit_test/sharings/gl/windows/gl_texture_tests.cpp @@ -192,10 +192,10 @@ TEST_F(GlSharingTextureTests, givenMockGlWhenRenderBufferTextureIsCreatedThenMem TEST_F(GlSharingTextureTests, givenGmmResourceAsInputWhenTextureIsCreatedThenItHasGmmSet) { cl_int retVal = CL_INVALID_VALUE; - glSharing->m_textureInfoOutput.globalShareHandle = textureId; - glSharing->m_textureInfoOutput.pGmmResInfo = this->tempMM->forceGmm->gmmResourceInfo->peekGmmResourceInfo(); + glSharing->textureInfoOutput.globalShareHandle = textureId; + glSharing->textureInfoOutput.pGmmResInfo = this->tempMM->forceGmm->gmmResourceInfo->peekGmmResourceInfo(); this->tempMM->useForcedGmm = false; - glSharing->m_textureInfoOutput.pGmmResInfo = this->tempMM->forceGmm->gmmResourceInfo->peekGmmResourceInfo(); + glSharing->textureInfoOutput.pGmmResInfo = this->tempMM->forceGmm->gmmResourceInfo->peekGmmResourceInfo(); glSharing->uploadDataToTextureInfo(); @@ -220,8 +220,8 @@ TEST_F(GlSharingTextureTests, givenDifferentHwFormatWhenSurfaceFormatInfoIsSetTh EXPECT_TRUE(format->surfaceFormat.GenxSurfaceFormat != newHwFormat); - glSharing->m_textureInfoOutput.glHWFormat = newHwFormat; - glSharing->m_textureInfoOutput.glInternalFormat = GL_DEPTH32F_STENCIL8; + glSharing->textureInfoOutput.glHWFormat = newHwFormat; + glSharing->textureInfoOutput.glInternalFormat = GL_DEPTH32F_STENCIL8; glSharing->uploadDataToTextureInfo(); @@ -234,8 +234,8 @@ TEST_F(GlSharingTextureTests, givenDifferentHwFormatWhenSurfaceFormatInfoIsSetTh TEST_F(GlSharingTextureTests, givenGLRGB10FormatWhenSharedGlTextureIsCreatedThenItHasCorrectGenxSurfaceFormatAssigned) { cl_int retVal = CL_INVALID_VALUE; - glSharing->m_textureInfoOutput.glInternalFormat = GL_RGB10; - glSharing->m_textureInfoOutput.glHWFormat = GFX3DSTATE_SURFACEFORMAT_R16G16B16X16_UNORM; + glSharing->textureInfoOutput.glInternalFormat = GL_RGB10; + glSharing->textureInfoOutput.glHWFormat = GFX3DSTATE_SURFACEFORMAT_R16G16B16X16_UNORM; glSharing->uploadDataToTextureInfo(); std::unique_ptr glTexture(GlTexture::createSharedGlTexture(clContext.get(), CL_MEM_READ_ONLY, GL_TEXTURE_2D, 0, textureId, &retVal)); @@ -479,7 +479,7 @@ TEST_F(GlSharingTextureTests, givenSharedRenderBufferWhenItIsAcquireCountIsDecre TEST_F(GlSharingTextureTests, givenMultisampleTextureWithMoreThanOneSampleWhenAskedForNumSamplesThenReturnCorrectValue) { GLsizei expectedNumSamples = 2; - glSharing->m_textureInfoOutput.numberOfSamples = expectedNumSamples; + glSharing->textureInfoOutput.numberOfSamples = expectedNumSamples; glSharing->uploadDataToTextureInfo(); std::unique_ptr image(GlTexture::createSharedGlTexture(clContext.get(), CL_MEM_READ_WRITE, GL_TEXTURE_2D_MULTISAMPLE, 0, textureId, nullptr)); @@ -493,7 +493,7 @@ TEST_F(GlSharingTextureTests, givenMultisampleTextureWithMoreThanOneSampleWhenAs } TEST_F(GlSharingTextureTests, givenTextureWithOneSampleWhenAskedForNumSamplesThenReturnZero) { - glSharing->m_textureInfoOutput.numberOfSamples = 1; + glSharing->textureInfoOutput.numberOfSamples = 1; glSharing->uploadDataToTextureInfo(); std::unique_ptr image(GlTexture::createSharedGlTexture(clContext.get(), CL_MEM_READ_WRITE, GL_TEXTURE_2D_MULTISAMPLE, 0, textureId, nullptr)); @@ -507,7 +507,7 @@ TEST_F(GlSharingTextureTests, givenTextureWithOneSampleWhenAskedForNumSamplesThe } TEST_F(GlSharingTextureTests, givenTextureWithZeroSamplesWhenAskedForNumSamplesThenReturnZero) { - glSharing->m_textureInfoOutput.numberOfSamples = 0; + glSharing->textureInfoOutput.numberOfSamples = 0; glSharing->uploadDataToTextureInfo(); std::unique_ptr image(GlTexture::createSharedGlTexture(clContext.get(), CL_MEM_READ_WRITE, GL_TEXTURE_2D_MULTISAMPLE, 0, textureId, nullptr)); diff --git a/shared/offline_compiler/source/decoder/iga_wrapper.cpp b/shared/offline_compiler/source/decoder/iga_wrapper.cpp index 3d79c76a4e..449686ed17 100644 --- a/shared/offline_compiler/source/decoder/iga_wrapper.cpp +++ b/shared/offline_compiler/source/decoder/iga_wrapper.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2022 Intel Corporation + * Copyright (C) 2019-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -25,7 +25,7 @@ struct IgaLibrary { pIGAContextRelease contextRelease = nullptr; pIGADisassemble disassemble = nullptr; pIGAStatusToString statusToString = nullptr; - iga_context_options_t OptsContext = {}; + iga_context_options_t optsContext = {}; std::unique_ptr library; @@ -40,8 +40,8 @@ struct IgaWrapper::Impl { void loadIga() { IgaLibrary iga; - iga.OptsContext.cb = sizeof(igaLib.OptsContext); - iga.OptsContext.gen = igaGen; + iga.optsContext.cb = sizeof(igaLib.optsContext); + iga.optsContext.gen = igaGen; iga.library.reset(NEO::OsLibrary::load(Os::igaDllName)); if (iga.library == nullptr) { @@ -106,7 +106,7 @@ bool IgaWrapper::tryDisassembleGenISA(const void *kernelPtr, uint32_t kernelSize iga_disassemble_options_t disassembleOptions = IGA_DISASSEMBLE_OPTIONS_INIT(); iga_status_t stat; - stat = pimpl->igaLib.contextCreate(&pimpl->igaLib.OptsContext, &context); + stat = pimpl->igaLib.contextCreate(&pimpl->igaLib.optsContext, &context); if (stat != 0) { messagePrinter->printf("Error while creating IGA Context! Error msg: %s", pimpl->igaLib.statusToString(stat)); return false; @@ -141,7 +141,7 @@ bool IgaWrapper::tryAssembleGenISA(const std::string &inAsm, std::string &outBin iga_status_t stat; iga_assemble_options_t assembleOptions = IGA_ASSEMBLE_OPTIONS_INIT(); - stat = pimpl->igaLib.contextCreate(&pimpl->igaLib.OptsContext, &context); + stat = pimpl->igaLib.contextCreate(&pimpl->igaLib.optsContext, &context); if (stat != 0) { messagePrinter->printf("Error while creating IGA Context! Error msg: %s", pimpl->igaLib.statusToString(stat)); return false; diff --git a/shared/source/device/device.cpp b/shared/source/device/device.cpp index 74450472a7..ea5ffadb88 100644 --- a/shared/source/device/device.cpp +++ b/shared/source/device/device.cpp @@ -798,26 +798,26 @@ bool Device::generateUuidFromPciBusInfo(const PhysicalDevicePciBusInfo &pciBusIn */ struct DeviceUUID { - uint16_t vendor_id; - uint16_t device_id; - uint16_t revision_id; - uint16_t pci_domain; - uint8_t pci_bus; - uint8_t pci_dev; - uint8_t pci_func; + uint16_t vendorID; + uint16_t deviceID; + uint16_t revisionID; + uint16_t pciDomain; + uint8_t pciBus; + uint8_t pciDev; + uint8_t pciFunc; uint8_t reserved[4]; - uint8_t sub_device_id; + uint8_t subDeviceID; }; DeviceUUID deviceUUID = {}; - deviceUUID.vendor_id = 0x8086; // Intel - deviceUUID.device_id = getHardwareInfo().platform.usDeviceID; - deviceUUID.revision_id = getHardwareInfo().platform.usRevId; - deviceUUID.pci_domain = static_cast(pciBusInfo.pciDomain); - deviceUUID.pci_bus = static_cast(pciBusInfo.pciBus); - deviceUUID.pci_dev = static_cast(pciBusInfo.pciDevice); - deviceUUID.pci_func = static_cast(pciBusInfo.pciFunction); - deviceUUID.sub_device_id = isSubDevice() ? static_cast(this)->getSubDeviceIndex() + 1 : 0; + deviceUUID.vendorID = 0x8086; // Intel + deviceUUID.deviceID = getHardwareInfo().platform.usDeviceID; + deviceUUID.revisionID = getHardwareInfo().platform.usRevId; + deviceUUID.pciDomain = static_cast(pciBusInfo.pciDomain); + deviceUUID.pciBus = static_cast(pciBusInfo.pciBus); + deviceUUID.pciDev = static_cast(pciBusInfo.pciDevice); + deviceUUID.pciFunc = static_cast(pciBusInfo.pciFunction); + deviceUUID.subDeviceID = isSubDevice() ? static_cast(this)->getSubDeviceIndex() + 1 : 0; static_assert(sizeof(DeviceUUID) == ProductHelper::uuidSize); diff --git a/shared/source/os_interface/linux/drm_neo.h b/shared/source/os_interface/linux/drm_neo.h index a4a9c67166..2207867c04 100644 --- a/shared/source/os_interface/linux/drm_neo.h +++ b/shared/source/os_interface/linux/drm_neo.h @@ -280,29 +280,29 @@ class Drm : public DriverModel { #pragma pack(1) struct PCIConfig { - uint16_t VendorID; - uint16_t DeviceID; - uint16_t Command; - uint16_t Status; - uint8_t Revision; - uint8_t ProgIF; - uint8_t Subclass; - uint8_t ClassCode; + uint16_t vendorID; + uint16_t deviceID; + uint16_t command; + uint16_t status; + uint8_t revision; + uint8_t progIF; + uint8_t subclass; + uint8_t classCode; uint8_t cacheLineSize; - uint8_t LatencyTimer; - uint8_t HeaderType; - uint8_t BIST; - uint32_t BAR0[6]; - uint32_t CardbusCISPointer; - uint16_t SubsystemVendorID; - uint16_t SubsystemDeviceID; - uint32_t ROM; - uint8_t Capabilities; - uint8_t Reserved[7]; - uint8_t InterruptLine; - uint8_t InterruptPIN; - uint8_t MinGrant; - uint8_t MaxLatency; + uint8_t latencyTimer; + uint8_t headerType; + uint8_t bist; + uint32_t bar0[6]; + uint32_t cardbusCISPointer; + uint16_t subsystemVendorID; + uint16_t subsystemDeviceID; + uint32_t rom; + uint8_t capabilities; + uint8_t reserved[7]; + uint8_t interruptLine; + uint8_t interruptPIN; + uint8_t minGrant; + uint8_t maxLatency; }; #pragma pack() diff --git a/shared/source/os_interface/linux/xe/ioctl_helper_xe.h b/shared/source/os_interface/linux/xe/ioctl_helper_xe.h index 661b01f3fd..196cf4f160 100644 --- a/shared/source/os_interface/linux/xe/ioctl_helper_xe.h +++ b/shared/source/os_interface/linux/xe/ioctl_helper_xe.h @@ -125,7 +125,7 @@ class IoctlHelperXe : public IoctlHelper { uint32_t addressWidth = 48; int numberHwEngines = 0; std::unique_ptr hwEngines; - int xe_fileHandle = 0; + int xeFileHandle = 0; std::mutex xeLock; std::vector bindInfo; int instance = 0; diff --git a/shared/source/tbx/tbx_proto.h b/shared/source/tbx/tbx_proto.h index 54b8224fbf..10a5d5590a 100644 --- a/shared/source/tbx/tbx_proto.h +++ b/shared/source/tbx/tbx_proto.h @@ -49,10 +49,10 @@ enum HAS_MSG_TYPE { struct HasHdr { union { - uint32_t msg_type; + uint32_t msgType; HAS_MSG_TYPE type; }; - uint32_t trans_id; + uint32_t transID; uint32_t size; }; @@ -65,8 +65,8 @@ enum { struct HasMmioReq { uint32_t write : 1; uint32_t size : 3; - uint32_t dev_idx : 2; - uint32_t msg_type : 3; + uint32_t devIdx : 2; + uint32_t msgType : 3; uint32_t reserved : 7; uint32_t delay : 16; @@ -79,7 +79,7 @@ struct HasMmioReq { }; struct HasMmioExtReq { - struct HasMmioReq mmio_req; + struct HasMmioReq mmioReq; uint32_t sourceid : 8; uint32_t reserved1 : 24; enum { @@ -121,7 +121,7 @@ struct HasGtt64Req { uint32_t offset; uint32_t data; - uint32_t data_h; + uint32_t dataH; enum { HAS_MSG_TYPE = HAS_GTT_REQ_TYPE @@ -130,7 +130,7 @@ struct HasGtt64Req { struct HasGtt64Res { uint32_t data; - uint32_t data_h; + uint32_t dataH; enum { HAS_MSG_TYPE = HAS_GTT_RES_TYPE @@ -138,15 +138,15 @@ struct HasGtt64Res { }; struct HasWriteDataReq { - uint32_t addr_type : 1; - uint32_t mask_exist : 1; + uint32_t addrType : 1; + uint32_t maskExist : 1; uint32_t frontdoor : 1; - uint32_t take_ownership : 1; - uint32_t model_owned : 1; - uint32_t cacheline_disable : 1; - uint32_t memory_type : 2; + uint32_t takeOwnership : 1; + uint32_t modelOwned : 1; + uint32_t cachelineDisable : 1; + uint32_t memoryType : 2; uint32_t reserved : 16; - uint32_t address_h : 8; + uint32_t addressH : 8; uint32_t address; uint32_t size; @@ -156,13 +156,13 @@ struct HasWriteDataReq { }; struct HasReadDataReq { - uint32_t addr_type : 1; + uint32_t addrType : 1; uint32_t frontdoor : 1; - uint32_t ownership_req : 1; - uint32_t model_owned : 1; - uint32_t cacheline_disable : 1; + uint32_t ownershipReq : 1; + uint32_t modelOwned : 1; + uint32_t cachelineDisable : 1; uint32_t reserved : 19; - uint32_t address_h : 8; + uint32_t addressH : 8; uint32_t address; uint32_t size; @@ -172,12 +172,12 @@ struct HasReadDataReq { }; struct HasReadDataRes { - uint32_t addr_type : 1; - uint32_t mask_exist : 1; - uint32_t last_page : 1; - uint32_t ownership_res : 1; + uint32_t addrType : 1; + uint32_t maskExist : 1; + uint32_t lastPage : 1; + uint32_t ownershipRes : 1; uint32_t reserved : 20; - uint32_t address_h : 8; + uint32_t addressH : 8; uint32_t address; uint32_t size; @@ -187,35 +187,35 @@ struct HasReadDataRes { }; struct HasControlReq { - uint32_t reset : 1; // [0:0] - uint32_t has : 1; // [1:1] - uint32_t rd_on_demand : 1; // [2:2] - uint32_t write_mask : 1; // [3:3] - uint32_t time_adv : 1; // [4:4] - uint32_t async_msg : 1; // [5:5] - uint32_t quit : 1; // [6:6] - uint32_t cncry_enb : 1; // [7:7] - uint32_t stime_enb : 1; // [8:8] - uint32_t full_reset : 1; // [9:9] - uint32_t auto_ownership : 1; // [10:10] - uint32_t backdoor_model : 1; // [11:11] - uint32_t flush : 1; // [12:12] - uint32_t reserved : 3; // [15:13] + uint32_t reset : 1; // [0:0] + uint32_t has : 1; // [1:1] + uint32_t rdOnDemand : 1; // [2:2] + uint32_t writeMask : 1; // [3:3] + uint32_t timeAdv : 1; // [4:4] + uint32_t asyncMsg : 1; // [5:5] + uint32_t quit : 1; // [6:6] + uint32_t cncryEnb : 1; // [7:7] + uint32_t stimeEnb : 1; // [8:8] + uint32_t fullReset : 1; // [9:9] + uint32_t autoOwnership : 1; // [10:10] + uint32_t backdoorModel : 1; // [11:11] + uint32_t flush : 1; // [12:12] + uint32_t reserved : 3; // [15:13] - uint32_t reset_mask : 1; // [16:16] - uint32_t has_mask : 1; // [17:17] - uint32_t rd_on_demand_mask : 1; // [18:18] - uint32_t write_mask_mask : 1; // [19:19] - uint32_t time_adv_mask : 1; // [20:20] - uint32_t async_msg_mask : 1; // [21:21] - uint32_t quit_mask : 1; // [22:22] - uint32_t cncry_enb_mask : 1; // [23:23] - uint32_t stime_enb_mask : 1; // [24:24] - uint32_t full_reset_mask : 1; // [25:25] - uint32_t auto_ownership_mask : 1; // [26:26] - uint32_t backdoor_model_mask : 1; // [27:27] - uint32_t flush_mask : 1; // [28:28] - uint32_t reserved_mask : 3; // [31:29] + uint32_t resetMask : 1; // [16:16] + uint32_t hasMask : 1; // [17:17] + uint32_t rdOnDemandMask : 1; // [18:18] + uint32_t writeMaskMask : 1; // [19:19] + uint32_t timeAdvMask : 1; // [20:20] + uint32_t asyncMsgMask : 1; // [21:21] + uint32_t quitMask : 1; // [22:22] + uint32_t cncryEnbMask : 1; // [23:23] + uint32_t stimeEnbMask : 1; // [24:24] + uint32_t fullResetMask : 1; // [25:25] + uint32_t autoOwnershipMask : 1; // [26:26] + uint32_t backdoorModelMask : 1; // [27:27] + uint32_t flushMask : 1; // [28:28] + uint32_t reservedMask : 3; // [31:29] enum { HAS_MSG_TYPE = HAS_CONTROL_REQ_TYPE @@ -260,7 +260,7 @@ struct HasPcicfgRes { struct HasGttParamsReq { uint32_t base; - uint32_t base_h : 8; + uint32_t baseH : 8; uint32_t size : 24; enum { @@ -280,7 +280,7 @@ struct HasEventObsoleteReq { struct HasEventReq { uint32_t offset; uint32_t data; - uint32_t dev_idx : 2; + uint32_t devIdx : 2; uint32_t reserved : 30; enum { @@ -290,7 +290,7 @@ struct HasEventReq { struct HasInnerVarReq { uint32_t write : 1; - uint32_t non_dword : 16; + uint32_t nonDword : 16; uint32_t reserved : 15; uint32_t id; uint32_t data; @@ -320,7 +320,7 @@ struct HasInternalVarListEntryRes { uint32_t id; uint32_t min; uint32_t max; - uint32_t desc_size; + uint32_t descSize; }; struct HasFunnyIoReq { @@ -345,7 +345,7 @@ struct HasFunnyIoRes { struct HasIoReq { uint32_t write : 1; - uint32_t dev_idx : 2; + uint32_t devIdx : 2; uint32_t reserved : 26; uint32_t size : 3; uint32_t offset; @@ -384,7 +384,7 @@ struct HasRpcRes { struct HasClFlushReq { uint32_t reserved : 23; uint32_t ignore : 1; - uint32_t address_h : 8; + uint32_t addressH : 8; uint32_t address; uint32_t size; uint32_t delay; @@ -403,8 +403,8 @@ struct HasClFlushRes { }; struct HasSimtimeRes { - uint32_t data_l; - uint32_t data_h; + uint32_t dataL; + uint32_t dataH; enum { HAS_MSG_TYPE = HAS_SIMTIME_RES_TYPE @@ -421,35 +421,35 @@ struct HasGd2Message { }; union HasMsgBody { - struct HasMmioReq mmio_req; - struct HasMmioExtReq mmio_req_ext; - struct HasMmioRes mmio_res; - struct HasGtt32Req gtt32_req; - struct HasGtt32Res gtt32_res; - struct HasGtt64Req gtt64_req; - struct HasGtt64Res gtt64_res; - struct HasWriteDataReq write_req; - struct HasReadDataReq read_req; - struct HasReadDataRes read_res; - struct HasControlReq control_req; - struct HasReportRendEndReq render_req; - struct HasReportRendEndRes render_res; - struct HasPcicfgReq pcicfg_req; - struct HasPcicfgRes pcicfg_res; - struct HasGttParamsReq gtt_params_req; - struct HasEventReq event_req; - struct HasEventObsoleteReq event_obsolete_req; - struct HasInnerVarReq inner_var_req; - struct HasInnerVarRes inner_var_res; - struct HasInnerVarListRes inner_var_list_res; - struct HasIoReq io_req; - struct HasIoRes io_res; - struct HasRpcReq rpc_req; - struct HasRpcRes rpc_res; - struct HasClFlushReq flush_req; - struct HasClFlushRes flush_res; - struct HasSimtimeRes stime_res; - struct HasGd2Message gd2_message_req; + struct HasMmioReq mmioReq; + struct HasMmioExtReq mmioReqExt; + struct HasMmioRes mmioRes; + struct HasGtt32Req gtt32Req; + struct HasGtt32Res gtt32Res; + struct HasGtt64Req gtt64Req; + struct HasGtt64Res gtt64Res; + struct HasWriteDataReq writeReq; + struct HasReadDataReq readReq; + struct HasReadDataRes readRes; + struct HasControlReq controlReq; + struct HasReportRendEndReq renderReq; + struct HasReportRendEndRes renderRes; + struct HasPcicfgReq pcicfgReq; + struct HasPcicfgRes pcicfgRes; + struct HasGttParamsReq gttParamsReq; + struct HasEventReq eventReq; + struct HasEventObsoleteReq eventObsoleteReq; + struct HasInnerVarReq innerVarReq; + struct HasInnerVarRes innerVarRes; + struct HasInnerVarListRes innerVarListRes; + struct HasIoReq ioReq; + struct HasIoRes ioRes; + struct HasRpcReq rpcReq; + struct HasRpcRes rpcRes; + struct HasClFlushReq flushReq; + struct HasClFlushRes flushRes; + struct HasSimtimeRes stimeRes; + struct HasGd2Message gd2MessageReq; }; struct HasMsg { diff --git a/shared/source/tbx/tbx_sockets_imp.cpp b/shared/source/tbx/tbx_sockets_imp.cpp index 1f84df011f..bfee075a0a 100644 --- a/shared/source/tbx/tbx_sockets_imp.cpp +++ b/shared/source/tbx/tbx_sockets_imp.cpp @@ -37,17 +37,17 @@ TbxSocketsImp::TbxSocketsImp(std::ostream &err) } void TbxSocketsImp::close() { - if (0 != m_socket) { + if (0 != socket) { #ifdef WIN32 - ::shutdown(m_socket, 0x02 /*SD_BOTH*/); + ::shutdown(socket, 0x02 /*SD_BOTH*/); - ::closesocket(m_socket); + ::closesocket(socket); ::WSACleanup(); #else - ::shutdown(m_socket, SHUT_RDWR); - ::close(m_socket); + ::shutdown(socket, SHUT_RDWR); + ::close(socket); #endif - m_socket = 0; + socket = 0; } } @@ -71,8 +71,8 @@ bool TbxSocketsImp::init(const std::string &hostNameOrIp, uint16_t port) { } #endif - m_socket = ::socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); - if (m_socket == INVALID_SOCKET) { + socket = ::socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); + if (socket == INVALID_SOCKET) { logErrorInfo("Error at socket(): "); break; } @@ -83,23 +83,23 @@ bool TbxSocketsImp::init(const std::string &hostNameOrIp, uint16_t port) { HasMsg cmd; memset(&cmd, 0, sizeof(cmd)); - cmd.hdr.msg_type = HAS_CONTROL_REQ_TYPE; + cmd.hdr.msgType = HAS_CONTROL_REQ_TYPE; cmd.hdr.size = sizeof(HasControlReq); - cmd.hdr.trans_id = transID++; + cmd.hdr.transID = transID++; - cmd.u.control_req.time_adv_mask = 1; - cmd.u.control_req.time_adv = 0; + cmd.u.controlReq.timeAdvMask = 1; + cmd.u.controlReq.timeAdv = 0; - cmd.u.control_req.async_msg_mask = 1; - cmd.u.control_req.async_msg = 0; + cmd.u.controlReq.asyncMsgMask = 1; + cmd.u.controlReq.asyncMsg = 0; - cmd.u.control_req.has_mask = 1; - cmd.u.control_req.has = 1; + cmd.u.controlReq.hasMask = 1; + cmd.u.controlReq.has = 1; sendWriteData(&cmd, sizeof(HasHdr) + cmd.hdr.size); } while (false); - return m_socket != INVALID_SOCKET; + return socket != INVALID_SOCKET; } bool TbxSocketsImp::connectToServer(const std::string &hostNameOrIp, uint16_t port) { @@ -120,7 +120,7 @@ bool TbxSocketsImp::connectToServer(const std::string &hostNameOrIp, uint16_t po clientService.sin_family = AF_INET; clientService.sin_port = htons(port); - if (::connect(m_socket, (SOCKADDR *)&clientService, sizeof(clientService)) == SOCKET_ERROR) { + if (::connect(socket, (SOCKADDR *)&clientService, sizeof(clientService)) == SOCKET_ERROR) { logErrorInfo("Failed to connect: "); cerrStream << "Is TBX server process running on host system [ " << hostNameOrIp.c_str() << ", port " << port << "]?" << std::endl; @@ -128,7 +128,7 @@ bool TbxSocketsImp::connectToServer(const std::string &hostNameOrIp, uint16_t po } } while (false); - return !!m_socket; + return !!socket; } bool TbxSocketsImp::readMMIO(uint32_t offset, uint32_t *data) { @@ -136,15 +136,15 @@ bool TbxSocketsImp::readMMIO(uint32_t offset, uint32_t *data) { do { HasMsg cmd; memset(&cmd, 0, sizeof(cmd)); - cmd.hdr.msg_type = HAS_MMIO_REQ_TYPE; + cmd.hdr.msgType = HAS_MMIO_REQ_TYPE; cmd.hdr.size = sizeof(HasMmioReq); - cmd.hdr.trans_id = transID++; - cmd.u.mmio_req.offset = offset; - cmd.u.mmio_req.data = 0; - cmd.u.mmio_req.write = 0; - cmd.u.mmio_req.delay = 0; - cmd.u.mmio_req.msg_type = MSG_TYPE_MMIO; - cmd.u.mmio_req.size = sizeof(uint32_t); + cmd.hdr.transID = transID++; + cmd.u.mmioReq.offset = offset; + cmd.u.mmioReq.data = 0; + cmd.u.mmioReq.write = 0; + cmd.u.mmioReq.delay = 0; + cmd.u.mmioReq.msgType = MSG_TYPE_MMIO; + cmd.u.mmioReq.size = sizeof(uint32_t); success = sendWriteData(&cmd, sizeof(HasHdr) + cmd.hdr.size); if (!success) { @@ -157,13 +157,13 @@ bool TbxSocketsImp::readMMIO(uint32_t offset, uint32_t *data) { break; } - if (resp.hdr.msg_type != HAS_MMIO_RES_TYPE || cmd.hdr.trans_id != resp.hdr.trans_id) { + if (resp.hdr.msgType != HAS_MMIO_RES_TYPE || cmd.hdr.transID != resp.hdr.transID) { *data = 0xdeadbeef; success = false; break; } - *data = resp.u.mmio_res.data; + *data = resp.u.mmioRes.data; success = true; } while (false); @@ -174,14 +174,14 @@ bool TbxSocketsImp::readMMIO(uint32_t offset, uint32_t *data) { bool TbxSocketsImp::writeMMIO(uint32_t offset, uint32_t value) { HasMsg cmd; memset(&cmd, 0, sizeof(cmd)); - cmd.hdr.msg_type = HAS_MMIO_REQ_TYPE; + cmd.hdr.msgType = HAS_MMIO_REQ_TYPE; cmd.hdr.size = sizeof(HasMmioReq); - cmd.hdr.trans_id = transID++; - cmd.u.mmio_req.msg_type = MSG_TYPE_MMIO; - cmd.u.mmio_req.offset = offset; - cmd.u.mmio_req.data = value; - cmd.u.mmio_req.write = 1; - cmd.u.mmio_req.size = sizeof(uint32_t); + cmd.hdr.transID = transID++; + cmd.u.mmioReq.msgType = MSG_TYPE_MMIO; + cmd.u.mmioReq.offset = offset; + cmd.u.mmioReq.data = value; + cmd.u.mmioReq.write = 1; + cmd.u.mmioReq.size = sizeof(uint32_t); return sendWriteData(&cmd, sizeof(HasHdr) + cmd.hdr.size); } @@ -189,16 +189,16 @@ bool TbxSocketsImp::writeMMIO(uint32_t offset, uint32_t value) { bool TbxSocketsImp::readMemory(uint64_t addrOffset, void *data, size_t size) { HasMsg cmd; memset(&cmd, 0, sizeof(cmd)); - cmd.hdr.msg_type = HAS_READ_DATA_REQ_TYPE; - cmd.hdr.trans_id = transID++; + cmd.hdr.msgType = HAS_READ_DATA_REQ_TYPE; + cmd.hdr.transID = transID++; cmd.hdr.size = sizeof(HasReadDataReq); - cmd.u.read_req.address = static_cast(addrOffset); - cmd.u.read_req.address_h = static_cast(addrOffset >> 32); - cmd.u.read_req.addr_type = 0; - cmd.u.read_req.size = static_cast(size); - cmd.u.read_req.ownership_req = 0; - cmd.u.read_req.frontdoor = 0; - cmd.u.read_req.cacheline_disable = cmd.u.read_req.frontdoor; + cmd.u.readReq.address = static_cast(addrOffset); + cmd.u.readReq.addressH = static_cast(addrOffset >> 32); + cmd.u.readReq.addrType = 0; + cmd.u.readReq.size = static_cast(size); + cmd.u.readReq.ownershipReq = 0; + cmd.u.readReq.frontdoor = 0; + cmd.u.readReq.cachelineDisable = cmd.u.readReq.frontdoor; bool success; do { @@ -213,7 +213,7 @@ bool TbxSocketsImp::readMemory(uint64_t addrOffset, void *data, size_t size) { break; } - if (resp.hdr.msg_type != HAS_READ_DATA_RES_TYPE || resp.hdr.trans_id != cmd.hdr.trans_id) { + if (resp.hdr.msgType != HAS_READ_DATA_RES_TYPE || resp.hdr.transID != cmd.hdr.transID) { cerrStream << "Out of sequence read data packet?" << std::endl; success = false; break; @@ -229,18 +229,18 @@ bool TbxSocketsImp::readMemory(uint64_t addrOffset, void *data, size_t size) { bool TbxSocketsImp::writeMemory(uint64_t physAddr, const void *data, size_t size, uint32_t type) { HasMsg cmd; memset(&cmd, 0, sizeof(cmd)); - cmd.hdr.msg_type = HAS_WRITE_DATA_REQ_TYPE; - cmd.hdr.trans_id = transID++; + cmd.hdr.msgType = HAS_WRITE_DATA_REQ_TYPE; + cmd.hdr.transID = transID++; cmd.hdr.size = sizeof(HasWriteDataReq); - cmd.u.write_req.address = static_cast(physAddr); - cmd.u.write_req.address_h = static_cast(physAddr >> 32); - cmd.u.write_req.addr_type = 0; - cmd.u.write_req.size = static_cast(size); - cmd.u.write_req.take_ownership = 0; - cmd.u.write_req.frontdoor = 0; - cmd.u.write_req.cacheline_disable = cmd.u.write_req.frontdoor; - cmd.u.write_req.memory_type = type; + cmd.u.writeReq.address = static_cast(physAddr); + cmd.u.writeReq.addressH = static_cast(physAddr >> 32); + cmd.u.writeReq.addrType = 0; + cmd.u.writeReq.size = static_cast(size); + cmd.u.writeReq.takeOwnership = 0; + cmd.u.writeReq.frontdoor = 0; + cmd.u.writeReq.cachelineDisable = cmd.u.writeReq.frontdoor; + cmd.u.writeReq.memoryType = type; bool success; do { @@ -263,13 +263,13 @@ bool TbxSocketsImp::writeMemory(uint64_t physAddr, const void *data, size_t size bool TbxSocketsImp::writeGTT(uint32_t offset, uint64_t entry) { HasMsg cmd; memset(&cmd, 0, sizeof(cmd)); - cmd.hdr.msg_type = HAS_GTT_REQ_TYPE; + cmd.hdr.msgType = HAS_GTT_REQ_TYPE; cmd.hdr.size = sizeof(HasGtt64Req); - cmd.hdr.trans_id = transID++; - cmd.u.gtt64_req.write = 1; - cmd.u.gtt64_req.offset = offset / sizeof(uint64_t); // the TBX server expects GTT index here, not offset - cmd.u.gtt64_req.data = static_cast(entry & 0xffffffff); - cmd.u.gtt64_req.data_h = static_cast(entry >> 32); + cmd.hdr.transID = transID++; + cmd.u.gtt64Req.write = 1; + cmd.u.gtt64Req.offset = offset / sizeof(uint64_t); // the TBX server expects GTT index here, not offset + cmd.u.gtt64Req.data = static_cast(entry & 0xffffffff); + cmd.u.gtt64Req.dataH = static_cast(entry >> 32); return sendWriteData(&cmd, sizeof(HasHdr) + cmd.hdr.size); } @@ -279,7 +279,7 @@ bool TbxSocketsImp::sendWriteData(const void *buffer, size_t sizeInBytes) { auto dataBuffer = reinterpret_cast(buffer); do { - auto bytesSent = ::send(m_socket, &dataBuffer[totalSent], static_cast(sizeInBytes - totalSent), 0); + auto bytesSent = ::send(socket, &dataBuffer[totalSent], static_cast(sizeInBytes - totalSent), 0); if (bytesSent == 0 || bytesSent == WSAECONNRESET) { logErrorInfo("Connection Closed."); return false; @@ -300,7 +300,7 @@ bool TbxSocketsImp::getResponseData(void *buffer, size_t sizeInBytes) { auto dataBuffer = static_cast(buffer); do { - auto bytesRecv = ::recv(m_socket, &dataBuffer[totalRecv], static_cast(sizeInBytes - totalRecv), 0); + auto bytesRecv = ::recv(socket, &dataBuffer[totalRecv], static_cast(sizeInBytes - totalRecv), 0); if (bytesRecv == 0 || bytesRecv == WSAECONNRESET) { logErrorInfo("Connection Closed."); return false; diff --git a/shared/source/tbx/tbx_sockets_imp.h b/shared/source/tbx/tbx_sockets_imp.h index c8e2ac6f0f..e55c084879 100644 --- a/shared/source/tbx/tbx_sockets_imp.h +++ b/shared/source/tbx/tbx_sockets_imp.h @@ -33,7 +33,7 @@ class TbxSocketsImp : public TbxSockets { protected: std::ostream &cerrStream; - SOCKET m_socket = 0; + SOCKET socket = 0; bool connectToServer(const std::string &hostNameOrIp, uint16_t port); bool sendWriteData(const void *buffer, size_t sizeInBytes); diff --git a/shared/source/utilities/hw_timestamps.h b/shared/source/utilities/hw_timestamps.h index d8b241d3f2..48b5b68363 100644 --- a/shared/source/utilities/hw_timestamps.h +++ b/shared/source/utilities/hw_timestamps.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2022 Intel Corporation + * Copyright (C) 2018-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -15,12 +15,12 @@ namespace NEO { class HwTimeStamps : public TagTypeBase { public: void initialize() { - GlobalStartTS = 0; - ContextStartTS = 0; - GlobalEndTS = 0; - ContextEndTS = 0; - GlobalCompleteTS = 0; - ContextCompleteTS = 0; + globalStartTS = 0; + contextStartTS = 0; + globalEndTS = 0; + contextEndTS = 0; + globalCompleteTS = 0; + contextCompleteTS = 0; } static constexpr AllocationType getAllocationType() { @@ -29,17 +29,17 @@ class HwTimeStamps : public TagTypeBase { static constexpr TagNodeType getTagNodeType() { return TagNodeType::HwTimeStamps; } - uint64_t getContextStartValue(uint32_t) const { return ContextStartTS; } - uint64_t getGlobalStartValue(uint32_t) const { return GlobalStartTS; } - uint64_t getContextEndValue(uint32_t) const { return ContextEndTS; } - uint64_t getGlobalEndValue(uint32_t) const { return GlobalEndTS; } + uint64_t getContextStartValue(uint32_t) const { return contextStartTS; } + uint64_t getGlobalStartValue(uint32_t) const { return globalStartTS; } + uint64_t getContextEndValue(uint32_t) const { return contextEndTS; } + uint64_t getGlobalEndValue(uint32_t) const { return globalEndTS; } - uint64_t GlobalStartTS; - uint64_t ContextStartTS; - uint64_t GlobalEndTS; - uint64_t ContextEndTS; - uint64_t GlobalCompleteTS; - uint64_t ContextCompleteTS; + uint64_t globalStartTS; + uint64_t contextStartTS; + uint64_t globalEndTS; + uint64_t contextEndTS; + uint64_t globalCompleteTS; + uint64_t contextCompleteTS; }; static_assert((6 * sizeof(uint64_t)) == sizeof(HwTimeStamps), diff --git a/shared/source/utilities/linux/timer_util.cpp b/shared/source/utilities/linux/timer_util.cpp index 21881e7994..80b53b25d7 100644 --- a/shared/source/utilities/linux/timer_util.cpp +++ b/shared/source/utilities/linux/timer_util.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -21,32 +21,32 @@ class Timer::TimerImpl { } void start() { - *((std::chrono::high_resolution_clock::time_point *)&m_startTime) = std::chrono::high_resolution_clock::now(); + *((std::chrono::high_resolution_clock::time_point *)&startTime) = std::chrono::high_resolution_clock::now(); } void end() { - *((std::chrono::high_resolution_clock::time_point *)&m_endTime) = std::chrono::high_resolution_clock::now(); + *((std::chrono::high_resolution_clock::time_point *)&endTime) = std::chrono::high_resolution_clock::now(); } long long int get() { long long int nanosecondTime = 0; - std::chrono::duration diffTime = std::chrono::duration_cast>(*(reinterpret_cast(&m_endTime)) - *(reinterpret_cast(&m_startTime))); + std::chrono::duration diffTime = std::chrono::duration_cast>(*(reinterpret_cast(&endTime)) - *(reinterpret_cast(&startTime))); nanosecondTime = (long long int)(diffTime.count() * (double)1000000000.0); return nanosecondTime; } long long getStart() { - long long ret = (long long)(reinterpret_cast(&m_startTime)->time_since_epoch().count()); + long long ret = (long long)(reinterpret_cast(&startTime)->time_since_epoch().count()); return ret; } long long getEnd() { - long long ret = (long long)(reinterpret_cast(&m_endTime)->time_since_epoch().count()); + long long ret = (long long)(reinterpret_cast(&endTime)->time_since_epoch().count()); return ret; } TimerImpl &operator=(const TimerImpl &t) { - m_startTime = t.m_startTime; + startTime = t.startTime; return *this; } @@ -54,8 +54,8 @@ class Timer::TimerImpl { } private: - std::chrono::high_resolution_clock::time_point m_startTime; - std::chrono::high_resolution_clock::time_point m_endTime; + std::chrono::high_resolution_clock::time_point startTime; + std::chrono::high_resolution_clock::time_point endTime; }; Timer::Timer() { diff --git a/shared/source/utilities/tag_allocator.inl b/shared/source/utilities/tag_allocator.inl index 2f7c5ea766..d5bba3bf1c 100644 --- a/shared/source/utilities/tag_allocator.inl +++ b/shared/source/utilities/tag_allocator.inl @@ -213,7 +213,7 @@ void const *TagNode::getContextEndAddress([[maybe_unused]] uint32_t pac template uint64_t &TagNode::getContextCompleteRef() const { if constexpr (TagType::getTagNodeType() == TagNodeType::HwTimeStamps) { - return tagForCpuAccess->ContextCompleteTS; + return tagForCpuAccess->contextCompleteTS; } else { UNRECOVERABLE_IF(true); } @@ -222,7 +222,7 @@ uint64_t &TagNode::getContextCompleteRef() const { template uint64_t &TagNode::getGlobalEndRef() const { if constexpr (TagType::getTagNodeType() == TagNodeType::HwTimeStamps) { - return tagForCpuAccess->GlobalEndTS; + return tagForCpuAccess->globalEndTS; } else { UNRECOVERABLE_IF(true); } diff --git a/shared/source/utilities/windows/timer_util.cpp b/shared/source/utilities/windows/timer_util.cpp index 4c82b96c4e..34403cdf8e 100644 --- a/shared/source/utilities/windows/timer_util.cpp +++ b/shared/source/utilities/windows/timer_util.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -15,45 +15,45 @@ namespace NEO { class Timer::TimerImpl { public: TimerImpl() { - memset(&m_startTime, 0, sizeof(LARGE_INTEGER)); - memset(&m_endTime, 0, sizeof(LARGE_INTEGER)); + memset(&startTime, 0, sizeof(LARGE_INTEGER)); + memset(&endTime, 0, sizeof(LARGE_INTEGER)); } ~TimerImpl() { } LARGE_INTEGER start() { - QueryPerformanceCounter((LARGE_INTEGER *)&m_startTime); - return m_startTime; + QueryPerformanceCounter((LARGE_INTEGER *)&startTime); + return startTime; } LARGE_INTEGER end() { - QueryPerformanceCounter((LARGE_INTEGER *)&m_endTime); - return m_endTime; + QueryPerformanceCounter((LARGE_INTEGER *)&endTime); + return endTime; } long long int get() { - auto timeDelta = (double)(m_endTime.QuadPart - m_startTime.QuadPart); + auto timeDelta = (double)(endTime.QuadPart - startTime.QuadPart); timeDelta /= (double)mFrequency.QuadPart; timeDelta *= 1000000000.0; - if (m_endTime.QuadPart < m_startTime.QuadPart) { + if (endTime.QuadPart < startTime.QuadPart) { DEBUG_BREAK_IF(true); } return (long long)timeDelta; } long long getStart() { - return (long long)(((LARGE_INTEGER *)&m_startTime)->QuadPart); + return (long long)(((LARGE_INTEGER *)&startTime)->QuadPart); } long long getEnd() { - return (long long)(((LARGE_INTEGER *)&m_endTime)->QuadPart); + return (long long)(((LARGE_INTEGER *)&endTime)->QuadPart); } TimerImpl &operator=(const TimerImpl &t) { - m_startTime = t.m_startTime; + startTime = t.startTime; return *this; } @@ -65,8 +65,8 @@ class Timer::TimerImpl { static LARGE_INTEGER mFrequency; private: - LARGE_INTEGER m_startTime; - LARGE_INTEGER m_endTime; + LARGE_INTEGER startTime; + LARGE_INTEGER endTime; }; LARGE_INTEGER Timer::TimerImpl::mFrequency = { diff --git a/shared/test/common/libult/linux/drm_mock.h b/shared/test/common/libult/linux/drm_mock.h index 51f545de21..73ae5cb9a5 100644 --- a/shared/test/common/libult/linux/drm_mock.h +++ b/shared/test/common/libult/linux/drm_mock.h @@ -71,7 +71,7 @@ class DrmMock : public Drm { std::ofstream tempfile(name, std::ios::binary); if (tempfile.is_open()) { PCIConfig config; - config.DeviceID = deviceID; + config.deviceID = deviceID; tempfile.write(reinterpret_cast(&config), sizeof(config)); tempfile.close(); } diff --git a/shared/test/common/os_interface/linux/device_command_stream_fixture.cpp b/shared/test/common/os_interface/linux/device_command_stream_fixture.cpp index 0d5710d4bc..cdbf8ecb4f 100644 --- a/shared/test/common/os_interface/linux/device_command_stream_fixture.cpp +++ b/shared/test/common/os_interface/linux/device_command_stream_fixture.cpp @@ -43,12 +43,12 @@ void Ioctls::reset() { } void DrmMockCustom::testIoctls() { - if (this->ioctl_expected.total == -1) + if (this->ioctlExpected.total == -1) return; -#define NEO_IOCTL_EXPECT_EQ(PARAM) \ - if (this->ioctl_expected.PARAM >= 0) { \ - EXPECT_EQ(this->ioctl_expected.PARAM, this->ioctl_cnt.PARAM); \ +#define NEO_IOCTL_EXPECT_EQ(PARAM) \ + if (this->ioctlExpected.PARAM >= 0) { \ + EXPECT_EQ(this->ioctlExpected.PARAM, this->ioctlCnt.PARAM); \ } NEO_IOCTL_EXPECT_EQ(execbuffer2); NEO_IOCTL_EXPECT_EQ(gemUserptr); @@ -71,7 +71,7 @@ void DrmMockCustom::testIoctls() { } int DrmMockCustom::ioctl(DrmIoctl request, void *arg) { - auto ext = ioctl_res_ext.load(); + auto ext = ioctlResExt.load(); // store flags switch (request) { @@ -80,7 +80,7 @@ int DrmMockCustom::ioctl(DrmIoctl request, void *arg) { this->execBuffer = *execbuf; this->execBufferBufferObjects = *reinterpret_cast(this->execBuffer.getBuffersPtr()); - ioctl_cnt.execbuffer2++; + ioctlCnt.execbuffer2++; execBufferExtensions(execbuf); } break; @@ -88,34 +88,34 @@ int DrmMockCustom::ioctl(DrmIoctl request, void *arg) { auto *userPtrParams = static_cast(arg); userPtrParams->handle = returnHandle; returnHandle++; - ioctl_cnt.gemUserptr++; + ioctlCnt.gemUserptr++; } break; case DrmIoctl::GemCreate: { auto *createParams = static_cast(arg); this->createParamsSize = createParams->size; this->createParamsHandle = createParams->handle = 1u; - ioctl_cnt.gemCreate++; + ioctlCnt.gemCreate++; } break; case DrmIoctl::GemSetTiling: { auto *setTilingParams = static_cast(arg); setTilingMode = setTilingParams->tilingMode; setTilingHandle = setTilingParams->handle; setTilingStride = setTilingParams->stride; - ioctl_cnt.gemSetTiling++; + ioctlCnt.gemSetTiling++; } break; case DrmIoctl::GemGetTiling: { auto *getTilingParams = static_cast(arg); getTilingParams->tilingMode = getTilingModeOut; getTilingHandleIn = getTilingParams->handle; - ioctl_cnt.gemGetTiling++; + ioctlCnt.gemGetTiling++; } break; case DrmIoctl::PrimeFdToHandle: { auto *primeToHandleParams = static_cast(arg); // return BO primeToHandleParams->handle = outputHandle; inputFd = primeToHandleParams->fileDescriptor; - ioctl_cnt.primeFdToHandle++; + ioctlCnt.primeFdToHandle++; if (failOnPrimeFdToHandle == true) { return -1; } @@ -129,32 +129,32 @@ int DrmMockCustom::ioctl(DrmIoctl request, void *arg) { if (incrementOutputFdAfterCall) { outputFd++; } - ioctl_cnt.handleToPrimeFd++; + ioctlCnt.handleToPrimeFd++; } break; case DrmIoctl::GemSetDomain: { auto setDomainParams = static_cast(arg); setDomainHandle = setDomainParams->handle; setDomainReadDomains = setDomainParams->readDomains; setDomainWriteDomain = setDomainParams->writeDomain; - ioctl_cnt.gemSetDomain++; + ioctlCnt.gemSetDomain++; } break; case DrmIoctl::GemWait: { auto gemWaitParams = static_cast(arg); gemWaitTimeout = gemWaitParams->timeoutNs; - ioctl_cnt.gemWait++; + ioctlCnt.gemWait++; } break; case DrmIoctl::GemClose: - ioctl_cnt.gemClose++; + ioctlCnt.gemClose++; break; case DrmIoctl::RegRead: - ioctl_cnt.regRead++; + ioctlCnt.regRead++; break; case DrmIoctl::Getparam: { - ioctl_cnt.contextGetParam++; + ioctlCnt.contextGetParam++; auto getParam = static_cast(arg); recordedGetParam = *getParam; *getParam->value = getParamRetValue; @@ -164,7 +164,7 @@ int DrmMockCustom::ioctl(DrmIoctl request, void *arg) { } break; case DrmIoctl::GemContextGetparam: { - ioctl_cnt.contextGetParam++; + ioctlCnt.contextGetParam++; auto getContextParam = static_cast(arg); recordedGetContextParam = *getContextParam; getContextParam->value = getContextParamRetValue; @@ -172,17 +172,17 @@ int DrmMockCustom::ioctl(DrmIoctl request, void *arg) { case DrmIoctl::GemContextCreateExt: { auto contextCreateParam = static_cast(arg); - contextCreateParam->contextId = ++ioctl_cnt.contextCreate; + contextCreateParam->contextId = ++ioctlCnt.contextCreate; } break; case DrmIoctl::GemContextDestroy: { - ioctl_cnt.contextDestroy++; + ioctlCnt.contextDestroy++; } break; case DrmIoctl::GemMmapOffset: { auto mmapOffsetParams = reinterpret_cast(arg); mmapOffsetHandle = mmapOffsetParams->handle; mmapOffsetParams->offset = mmapOffsetExpected; mmapOffsetFlags = mmapOffsetParams->flags; - ioctl_cnt.gemMmapOffset++; + ioctlCnt.gemMmapOffset++; if (failOnMmapOffset == true) { return -1; } @@ -192,7 +192,7 @@ int DrmMockCustom::ioctl(DrmIoctl request, void *arg) { createExtSize = createExtParams->size; createExtHandle = createExtParams->handle; createExtExtensions = createExtParams->extensions; - ioctl_cnt.gemCreateExt++; + ioctlCnt.gemCreateExt++; } break; case DrmIoctl::GemVmBind: { } break; @@ -210,20 +210,20 @@ int DrmMockCustom::ioctl(DrmIoctl request, void *arg) { } } - if (!ext->no.empty() && std::find(ext->no.begin(), ext->no.end(), ioctl_cnt.total.load()) != ext->no.end()) { - ioctl_cnt.total.fetch_add(1); + if (!ext->no.empty() && std::find(ext->no.begin(), ext->no.end(), ioctlCnt.total.load()) != ext->no.end()) { + ioctlCnt.total.fetch_add(1); return ext->res; } - ioctl_cnt.total.fetch_add(1); - return ioctl_res.load(); + ioctlCnt.total.fetch_add(1); + return ioctlRes.load(); } DrmMockCustom::DrmMockCustom(RootDeviceEnvironment &rootDeviceEnvironment) : Drm(std::make_unique(mockFd, mockPciPath), rootDeviceEnvironment) { reset(); auto &gfxCoreHelper = rootDeviceEnvironment.getHelper(); - ioctl_expected.contextCreate = static_cast(gfxCoreHelper.getGpgpuEngineInstances(rootDeviceEnvironment).size()); - ioctl_expected.contextDestroy = ioctl_expected.contextCreate.load(); + ioctlExpected.contextCreate = static_cast(gfxCoreHelper.getGpgpuEngineInstances(rootDeviceEnvironment).size()); + ioctlExpected.contextDestroy = ioctlExpected.contextCreate.load(); setupIoctlHelper(rootDeviceEnvironment.getHardwareInfo()->platform.eProductFamily); createVirtualMemoryAddressSpace(NEO::GfxCoreHelper::getSubDevicesCount(rootDeviceEnvironment.getHardwareInfo())); isVmBindAvailable(); // NOLINT(clang-analyzer-optin.cplusplus.VirtualCall) diff --git a/shared/test/common/os_interface/linux/device_command_stream_fixture.h b/shared/test/common/os_interface/linux/device_command_stream_fixture.h index 46308e0c1b..be1441a07d 100644 --- a/shared/test/common/os_interface/linux/device_command_stream_fixture.h +++ b/shared/test/common/os_interface/linux/device_command_stream_fixture.h @@ -146,26 +146,26 @@ class DrmMockCustom : public Drm { } void reset() { - ioctl_res = 0; - ioctl_cnt.reset(); - ioctl_expected.reset(); - ioctl_res_ext = &NONE; + ioctlRes = 0; + ioctlCnt.reset(); + ioctlExpected.reset(); + ioctlResExt = &none; } virtual void execBufferExtensions(void *execbuf) { } - Ioctls ioctl_cnt{}; - Ioctls ioctl_expected{}; + Ioctls ioctlCnt{}; + Ioctls ioctlExpected{}; - IoctlResExt NONE = {-1, 0}; + IoctlResExt none = {-1, 0}; WaitUserFenceCall waitUserFenceCall{}; IsVmBindAvailableCall getSetPairAvailableCall{}; IsVmBindAvailableCall isVmBindAvailableCall{}; - std::atomic ioctl_res; - std::atomic ioctl_res_ext; + std::atomic ioctlRes; + std::atomic ioctlResExt; // DRM_IOCTL_I915_GEM_EXECBUFFER2 NEO::MockExecBuffer execBuffer{}; diff --git a/shared/test/common/os_interface/linux/drm_buffer_object_fixture.h b/shared/test/common/os_interface/linux/drm_buffer_object_fixture.h index bd26929427..43e9745300 100644 --- a/shared/test/common/os_interface/linux/drm_buffer_object_fixture.h +++ b/shared/test/common/os_interface/linux/drm_buffer_object_fixture.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2022 Intel Corporation + * Copyright (C) 2022-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -86,8 +86,8 @@ class DrmBufferObjectFixture { void tearDown() { delete bo; - if (this->mock->ioctl_expected.total >= 0) { - EXPECT_EQ(this->mock->ioctl_expected.total, this->mock->ioctl_cnt.total); + if (this->mock->ioctlExpected.total >= 0) { + EXPECT_EQ(this->mock->ioctlExpected.total, this->mock->ioctlCnt.total); } mock->reset(); osContext.reset(nullptr); diff --git a/shared/test/common/os_interface/linux/drm_memory_manager_fixture.cpp b/shared/test/common/os_interface/linux/drm_memory_manager_fixture.cpp index a45609e868..0129b889e8 100644 --- a/shared/test/common/os_interface/linux/drm_memory_manager_fixture.cpp +++ b/shared/test/common/os_interface/linux/drm_memory_manager_fixture.cpp @@ -76,25 +76,25 @@ void DrmMemoryManagerFixture::tearDown() { int enginesCount = static_cast(device->getMemoryManager()->getRegisteredEnginesCount()); - mock->ioctl_expected.contextDestroy = enginesCount; - mock->ioctl_expected.gemClose = enginesCount; - mock->ioctl_expected.gemWait = enginesCount; + mock->ioctlExpected.contextDestroy = enginesCount; + mock->ioctlExpected.gemClose = enginesCount; + mock->ioctlExpected.gemWait = enginesCount; auto csr = static_cast *>(device->getDefaultEngine().commandStreamReceiver); if (csr->globalFenceAllocation) { - mock->ioctl_expected.gemClose += enginesCount; - mock->ioctl_expected.gemWait += enginesCount; + mock->ioctlExpected.gemClose += enginesCount; + mock->ioctlExpected.gemWait += enginesCount; } if (csr->getPreemptionAllocation()) { - mock->ioctl_expected.gemClose += enginesCount; - mock->ioctl_expected.gemWait += enginesCount; + mock->ioctlExpected.gemClose += enginesCount; + mock->ioctlExpected.gemWait += enginesCount; } if (csr->getKernelArgsBufferAllocation()) { - mock->ioctl_expected.gemClose += enginesCount; - mock->ioctl_expected.gemWait += enginesCount; + mock->ioctlExpected.gemClose += enginesCount; + mock->ioctlExpected.gemWait += enginesCount; } - mock->ioctl_expected.gemWait += additionalDestroyDeviceIoctls.gemWait.load(); - mock->ioctl_expected.gemClose += additionalDestroyDeviceIoctls.gemClose.load(); + mock->ioctlExpected.gemWait += additionalDestroyDeviceIoctls.gemWait.load(); + mock->ioctlExpected.gemClose += additionalDestroyDeviceIoctls.gemClose.load(); delete device; if (dontTestIoctlInTearDown) { mock->reset(); diff --git a/shared/test/unit_test/helpers/basic_math_tests.cpp b/shared/test/unit_test/helpers/basic_math_tests.cpp index 58611d80fc..b60b9d4c6d 100644 --- a/shared/test/unit_test/helpers/basic_math_tests.cpp +++ b/shared/test/unit_test/helpers/basic_math_tests.cpp @@ -126,16 +126,16 @@ INSTANTIATE_TEST_CASE_P(Float2Half, struct L3Config { union { - unsigned int RawValue; + unsigned int rawValue; struct { - unsigned int SlmModeEnable : 1; - unsigned int UrbAllocation : 7; - unsigned int GpGpuCreditEnable : 1; - unsigned int ErrorDetectionBehaviour : 1; - unsigned int Reserved : 1; - unsigned int ReadOnlyClientPool : 7; - unsigned int DCWayAssignement : 7; - unsigned int AllL3WayAssignement : 7; + unsigned int slmModeEnable : 1; + unsigned int urbAllocation : 7; + unsigned int gpGpuCreditEnable : 1; + unsigned int errorDetectionBehaviour : 1; + unsigned int reserved : 1; + unsigned int readOnlyClientPool : 7; + unsigned int dcWayAssignement : 7; + unsigned int allL3WayAssignement : 7; } bits; }; }; @@ -152,12 +152,12 @@ TEST(l3configsGenerator, givenInputValuesWhenPassedToL3ConfigThenRawValueIsProdu 0, // DC-Way Assignment 0x30}; - EXPECT_EQ(config.RawValue, 0x60000160u); + EXPECT_EQ(config.rawValue, 0x60000160u); L3Config config2; - config2.RawValue = 0x80000140u; - EXPECT_EQ(0x40u, config2.bits.AllL3WayAssignement); - EXPECT_EQ(0x20u, config2.bits.UrbAllocation); + config2.rawValue = 0x80000140u; + EXPECT_EQ(0x40u, config2.bits.allL3WayAssignement); + EXPECT_EQ(0x20u, config2.bits.urbAllocation); } struct ElementCountsTestData { diff --git a/shared/test/unit_test/os_interface/linux/drm_buffer_object_tests.cpp b/shared/test/unit_test/os_interface/linux/drm_buffer_object_tests.cpp index 4e0593889f..44fb134004 100644 --- a/shared/test/unit_test/os_interface/linux/drm_buffer_object_tests.cpp +++ b/shared/test/unit_test/os_interface/linux/drm_buffer_object_tests.cpp @@ -26,26 +26,26 @@ using DrmMockBufferObjectFixture = DrmBufferObjectFixture; using DrmBufferObjectTest = Test; TEST_F(DrmBufferObjectTest, WhenCallingExecThenReturnIsCorrect) { - mock->ioctl_expected.total = 1; - mock->ioctl_res = 0; + mock->ioctlExpected.total = 1; + mock->ioctlRes = 0; ExecObject execObjectsStorage = {}; auto ret = bo->exec(0, 0, 0, false, osContext.get(), 0, 1, nullptr, 0u, &execObjectsStorage, 0, 0); - EXPECT_EQ(mock->ioctl_res, ret); + EXPECT_EQ(mock->ioctlRes, ret); EXPECT_EQ(0u, mock->execBuffer.getFlags()); } TEST_F(DrmBufferObjectTest, GivenInvalidParamsWhenCallingExecThenEfaultIsReturned) { - mock->ioctl_expected.total = 3; - mock->ioctl_res = -1; + mock->ioctlExpected.total = 3; + mock->ioctlRes = -1; mock->errnoValue = EFAULT; ExecObject execObjectsStorage = {}; EXPECT_EQ(EFAULT, bo->exec(0, 0, 0, false, osContext.get(), 0, 1, nullptr, 0u, &execObjectsStorage, 0, 0)); } TEST_F(DrmBufferObjectTest, GivenDetectedGpuHangDuringEvictUnusedAllocationsWhenCallingExecGpuHangErrorCodeIsRetrurned) { - mock->ioctl_expected.total = 2; - mock->ioctl_res = -1; + mock->ioctlExpected.total = 2; + mock->ioctlRes = -1; mock->errnoValue = EFAULT; bo->callBaseEvictUnusedAllocations = false; @@ -57,14 +57,14 @@ TEST_F(DrmBufferObjectTest, GivenDetectedGpuHangDuringEvictUnusedAllocationsWhen } TEST_F(DrmBufferObjectTest, WhenSettingTilingThenCallSucceeds) { - mock->ioctl_expected.total = 1; // set_tiling + mock->ioctlExpected.total = 1; // set_tiling auto tilingY = mock->getIoctlHelper()->getDrmParamValue(DrmParam::TilingY); auto ret = bo->setTiling(tilingY, 0); EXPECT_TRUE(ret); } TEST_F(DrmBufferObjectTest, WhenSettingSameTilingThenCallSucceeds) { - mock->ioctl_expected.total = 0; // set_tiling + mock->ioctlExpected.total = 0; // set_tiling auto tilingY = mock->getIoctlHelper()->getDrmParamValue(DrmParam::TilingY); bo->tilingMode = tilingY; auto ret = bo->setTiling(tilingY, 0); @@ -72,16 +72,16 @@ TEST_F(DrmBufferObjectTest, WhenSettingSameTilingThenCallSucceeds) { } TEST_F(DrmBufferObjectTest, GivenInvalidTilingWhenSettingTilingThenCallFails) { - mock->ioctl_expected.total = 1; // set_tiling + mock->ioctlExpected.total = 1; // set_tiling auto tilingY = mock->getIoctlHelper()->getDrmParamValue(DrmParam::TilingY); - mock->ioctl_res = -1; + mock->ioctlRes = -1; auto ret = bo->setTiling(tilingY, 0); EXPECT_FALSE(ret); } TEST_F(DrmBufferObjectTest, givenBindAvailableWhenCallWaitThenNoIoctlIsCalled) { mock->bindAvailable = true; - mock->ioctl_expected.total = 0; + mock->ioctlExpected.total = 0; auto ret = bo->wait(-1); EXPECT_FALSE(ret); } @@ -111,8 +111,8 @@ TEST_F(DrmBufferObjectTest, givenAddressThatWhenSizeIsAddedWithin32BitBoundaryWh TEST_F(DrmBufferObjectTest, whenExecFailsThenPinFails) { std::unique_ptr buff(new uint32_t[1024]); - mock->ioctl_expected.total = 3; - mock->ioctl_res = -1; + mock->ioctlExpected.total = 3; + mock->ioctlRes = -1; this->mock->errnoValue = EINVAL; std::unique_ptr boToPin(new TestedBufferObject(this->mock.get())); @@ -127,8 +127,8 @@ TEST_F(DrmBufferObjectTest, whenExecFailsThenPinFails) { TEST_F(DrmBufferObjectTest, whenExecFailsThenValidateHostPtrFails) { std::unique_ptr buff(new uint32_t[1024]); - mock->ioctl_expected.total = 3; - mock->ioctl_res = -1; + mock->ioctlExpected.total = 3; + mock->ioctlRes = -1; this->mock->errnoValue = EINVAL; std::unique_ptr boToPin(new TestedBufferObject(this->mock.get())); @@ -141,7 +141,7 @@ TEST_F(DrmBufferObjectTest, whenExecFailsThenValidateHostPtrFails) { } TEST_F(DrmBufferObjectTest, givenResidentBOWhenPrintExecutionBufferIsSetToTrueThenDebugInformationAboutBOIsPrinted) { - mock->ioctl_expected.total = 1; + mock->ioctlExpected.total = 1; DebugManagerStateRestore restore; DebugManager.flags.PrintExecutionBuffer.set(true); @@ -168,7 +168,7 @@ TEST_F(DrmBufferObjectTest, givenResidentBOWhenPrintExecutionBufferIsSetToTrueTh } TEST_F(DrmBufferObjectTest, whenPrintBOCreateDestroyResultFlagIsSetAndCloseIsCalledOnBOThenDebugInfromationIsPrinted) { - mock->ioctl_expected.total = 1; + mock->ioctlExpected.total = 1; DebugManagerStateRestore stateRestore; DebugManager.flags.PrintBOCreateDestroyResult.set(true); @@ -183,7 +183,7 @@ TEST_F(DrmBufferObjectTest, whenPrintBOCreateDestroyResultFlagIsSetAndCloseIsCal } TEST_F(DrmBufferObjectTest, whenPrintBOCreateDestroyResultFlagIsSetAndCloseIsCalledButHandleIsSharedThenDebugInfromationIsPrintedThatCloseIsSkipped) { - mock->ioctl_expected.total = 1; + mock->ioctlExpected.total = 1; DebugManagerStateRestore stateRestore; DebugManager.flags.PrintBOCreateDestroyResult.set(true); @@ -212,7 +212,7 @@ TEST_F(DrmBufferObjectTest, whenPrintBOCreateDestroyResultFlagIsSetAndCloseIsCal } TEST_F(DrmBufferObjectTest, whenPrintExecutionBufferIsSetToTrueThenMessageFoundInStdStream) { - mock->ioctl_expected.total = 1; + mock->ioctlExpected.total = 1; DebugManagerStateRestore restore; DebugManager.flags.PrintExecutionBuffer.set(true); ExecObject execObjectsStorage = {}; @@ -238,7 +238,7 @@ TEST(DrmBufferObjectSimpleTest, givenInvalidBoWhenValidateHostptrIsCalledThenErr ASSERT_NE(nullptr, bo.get()); // fail DRM_IOCTL_I915_GEM_EXECBUFFER2 in pin - mock->ioctl_res = -1; + mock->ioctlRes = -1; std::unique_ptr boToPin(new TestedBufferObject(mock.get())); ASSERT_NE(nullptr, boToPin.get()); @@ -249,7 +249,7 @@ TEST(DrmBufferObjectSimpleTest, givenInvalidBoWhenValidateHostptrIsCalledThenErr BufferObject *boArray[1] = {boToPin.get()}; auto ret = bo->pin(boArray, 1, &osContext, 0, 1); EXPECT_EQ(EFAULT, ret); - mock->ioctl_res = 0; + mock->ioctlRes = 0; } TEST(DrmBufferObjectSimpleTest, givenInvalidBoWhenPinIsCalledThenErrorIsReturned) { @@ -263,7 +263,7 @@ TEST(DrmBufferObjectSimpleTest, givenInvalidBoWhenPinIsCalledThenErrorIsReturned ASSERT_NE(nullptr, bo.get()); // fail DRM_IOCTL_I915_GEM_EXECBUFFER2 in pin - mock->ioctl_res = -1; + mock->ioctlRes = -1; std::unique_ptr boToPin(new TestedBufferObject(mock.get())); ASSERT_NE(nullptr, boToPin.get()); @@ -274,7 +274,7 @@ TEST(DrmBufferObjectSimpleTest, givenInvalidBoWhenPinIsCalledThenErrorIsReturned BufferObject *boArray[1] = {boToPin.get()}; auto ret = bo->validateHostPtr(boArray, 1, &osContext, 0, 1); EXPECT_EQ(EFAULT, ret); - mock->ioctl_res = 0; + mock->ioctlRes = 0; } TEST(DrmBufferObjectSimpleTest, givenBufferObjectWhenConstructedWithASizeThenTheSizeIsInitialized) { @@ -294,7 +294,7 @@ TEST(DrmBufferObjectSimpleTest, givenArrayOfBosWhenPinnedThenAllBosArePinned) { std::unique_ptr bo(new TestedBufferObject(mock.get())); ASSERT_NE(nullptr, bo.get()); - mock->ioctl_res = 0; + mock->ioctlRes = 0; std::unique_ptr boToPin(new TestedBufferObject(mock.get())); std::unique_ptr boToPin2(new TestedBufferObject(mock.get())); @@ -308,7 +308,7 @@ TEST(DrmBufferObjectSimpleTest, givenArrayOfBosWhenPinnedThenAllBosArePinned) { bo->setAddress(reinterpret_cast(buff.get())); auto ret = bo->pin(array, 3, &osContext, 0, 1); - EXPECT_EQ(mock->ioctl_res, ret); + EXPECT_EQ(mock->ioctlRes, ret); EXPECT_LT(0u, mock->execBuffer.getBatchLen()); EXPECT_EQ(4u, mock->execBuffer.getBufferCount()); // 3 bos to pin plus 1 exec bo @@ -328,7 +328,7 @@ TEST(DrmBufferObjectSimpleTest, givenArrayOfBosWhenValidatedThenAllBosArePinned) std::unique_ptr bo(new TestedBufferObject(mock.get())); ASSERT_NE(nullptr, bo.get()); - mock->ioctl_res = 0; + mock->ioctlRes = 0; std::unique_ptr boToPin(new TestedBufferObject(mock.get())); std::unique_ptr boToPin2(new TestedBufferObject(mock.get())); @@ -342,7 +342,7 @@ TEST(DrmBufferObjectSimpleTest, givenArrayOfBosWhenValidatedThenAllBosArePinned) bo->setAddress(reinterpret_cast(buff.get())); auto ret = bo->validateHostPtr(array, 3, &osContext, 0, 1); - EXPECT_EQ(mock->ioctl_res, ret); + EXPECT_EQ(mock->ioctlRes, ret); EXPECT_LT(0u, mock->execBuffer.getBatchLen()); EXPECT_EQ(4u, mock->execBuffer.getBufferCount()); // 3 bos to pin plus 1 exec bo @@ -354,16 +354,16 @@ TEST(DrmBufferObjectSimpleTest, givenArrayOfBosWhenValidatedThenAllBosArePinned) } TEST_F(DrmBufferObjectTest, givenDeleterWhenBufferObjectIsCreatedAndDeletedThenCloseIsCalled) { - mock->ioctl_cnt.reset(); - mock->ioctl_expected.reset(); + mock->ioctlCnt.reset(); + mock->ioctlExpected.reset(); { std::unique_ptr bo(new BufferObject(mock.get(), 3, 1, 0x1000, 1)); } - EXPECT_EQ(1, mock->ioctl_cnt.gemClose); - mock->ioctl_cnt.reset(); - mock->ioctl_expected.reset(); + EXPECT_EQ(1, mock->ioctlCnt.gemClose); + mock->ioctlCnt.reset(); + mock->ioctlExpected.reset(); } TEST(DrmBufferObject, givenOfflineDebuggingModeWhenQueryingIsPerContextVMRequiredThenPerContextVMIsDisabled) { diff --git a/shared/test/unit_test/os_interface/linux/drm_buffer_object_tests_prelim.cpp b/shared/test/unit_test/os_interface/linux/drm_buffer_object_tests_prelim.cpp index a9998abb39..14be72c4fd 100644 --- a/shared/test/unit_test/os_interface/linux/drm_buffer_object_tests_prelim.cpp +++ b/shared/test/unit_test/os_interface/linux/drm_buffer_object_tests_prelim.cpp @@ -15,8 +15,8 @@ using DrmBufferObjectPrelimFixture = DrmBufferObjectFixture using DrmBufferObjectPrelimTest = Test; TEST_F(DrmBufferObjectPrelimTest, GivenCompletionAddressWhenCallingExecThenReturnIsCorrect) { - mock->ioctl_expected.total = 1; - mock->ioctl_res = 0; + mock->ioctlExpected.total = 1; + mock->ioctlRes = 0; constexpr uint64_t completionAddress = 0x1230; constexpr uint32_t completionValue = 33; diff --git a/shared/test/unit_test/os_interface/linux/drm_command_stream_tests.cpp b/shared/test/unit_test/os_interface/linux/drm_command_stream_tests.cpp index 34b0f7423b..f380b581fe 100644 --- a/shared/test/unit_test/os_interface/linux/drm_command_stream_tests.cpp +++ b/shared/test/unit_test/os_interface/linux/drm_command_stream_tests.cpp @@ -379,7 +379,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, GivenFragmentStorageWhenMakingR } HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenFragmentedAllocationsWithResuedFragmentsWhenTheyAreMadeResidentThenFragmentsDoNotDuplicate) { - mock->ioctl_expected.total = 9; + mock->ioctlExpected.total = 9; // 3 fragments auto ptr = (void *)0x1001; auto size = MemoryConstants::pageSize * 10; @@ -1064,12 +1064,12 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenWaitUserFenceFlagNotSetWhe EXPECT_FALSE(testedCsr->isUsedNotifyEnableForPostSync()); EXPECT_FALSE(testedCsr->useContextForUserFenceWait); device->resetCommandStreamReceiver(testedCsr); - mock->ioctl_cnt.gemWait = 0; + mock->ioctlCnt.gemWait = 0; FlushStamp handleToWait = 123; testedCsr->waitForFlushStamp(handleToWait); - EXPECT_EQ(1, mock->ioctl_cnt.gemWait); + EXPECT_EQ(1, mock->ioctlCnt.gemWait); EXPECT_EQ(-1, mock->gemWaitTimeout); EXPECT_EQ(0u, testedCsr->waitUserFenceResult.called); } @@ -1087,12 +1087,12 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenGemWaitUsedWhenKmdTimeoutU EXPECT_FALSE(testedCsr->isUsedNotifyEnableForPostSync()); EXPECT_FALSE(testedCsr->useContextForUserFenceWait); device->resetCommandStreamReceiver(testedCsr); - mock->ioctl_cnt.gemWait = 0; + mock->ioctlCnt.gemWait = 0; FlushStamp handleToWait = 123; testedCsr->waitForFlushStamp(handleToWait); - EXPECT_EQ(1, mock->ioctl_cnt.gemWait); + EXPECT_EQ(1, mock->ioctlCnt.gemWait); EXPECT_EQ(1000, mock->gemWaitTimeout); EXPECT_EQ(0u, testedCsr->waitUserFenceResult.called); } @@ -1114,7 +1114,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, EXPECT_TRUE(testedCsr->isUsedNotifyEnableForPostSync()); EXPECT_TRUE(testedCsr->useContextForUserFenceWait); device->resetCommandStreamReceiver(testedCsr); - mock->ioctl_cnt.gemWait = 0; + mock->ioctlCnt.gemWait = 0; mock->isVmBindAvailableCall.called = 0u; auto osContextLinux = static_cast(device->getDefaultEngine().osContext); @@ -1127,7 +1127,7 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, FlushStamp handleToWait = 123; testedCsr->waitForFlushStamp(handleToWait); - EXPECT_EQ(0, mock->ioctl_cnt.gemWait); + EXPECT_EQ(0, mock->ioctlCnt.gemWait); EXPECT_EQ(1u, testedCsr->waitUserFenceResult.called); EXPECT_EQ(123u, testedCsr->waitUserFenceResult.waitValue); @@ -1155,13 +1155,13 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, EXPECT_TRUE(testedCsr->isUsedNotifyEnableForPostSync()); EXPECT_FALSE(testedCsr->useContextForUserFenceWait); device->resetCommandStreamReceiver(testedCsr); - mock->ioctl_cnt.gemWait = 0; + mock->ioctlCnt.gemWait = 0; mock->isVmBindAvailableCall.called = 0u; FlushStamp handleToWait = 123; testedCsr->waitForFlushStamp(handleToWait); - EXPECT_EQ(1, mock->ioctl_cnt.gemWait); + EXPECT_EQ(1, mock->ioctlCnt.gemWait); EXPECT_EQ(0u, testedCsr->waitUserFenceResult.called); EXPECT_EQ(2u, mock->isVmBindAvailableCall.called); @@ -1184,13 +1184,13 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, EXPECT_FALSE(testedCsr->isUsedNotifyEnableForPostSync()); EXPECT_FALSE(testedCsr->useContextForUserFenceWait); device->resetCommandStreamReceiver(testedCsr); - mock->ioctl_cnt.gemWait = 0; + mock->ioctlCnt.gemWait = 0; mock->isVmBindAvailableCall.called = 0u; FlushStamp handleToWait = 123; EXPECT_ANY_THROW(testedCsr->waitForFlushStamp(handleToWait)); - EXPECT_EQ(0, mock->ioctl_cnt.gemWait); + EXPECT_EQ(0, mock->ioctlCnt.gemWait); EXPECT_EQ(0u, testedCsr->waitUserFenceResult.called); EXPECT_EQ(2u, mock->isVmBindAvailableCall.called); @@ -1215,13 +1215,13 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, EXPECT_TRUE(testedCsr->isUsedNotifyEnableForPostSync()); EXPECT_FALSE(testedCsr->useContextForUserFenceWait); device->resetCommandStreamReceiver(testedCsr); - mock->ioctl_cnt.gemWait = 0; + mock->ioctlCnt.gemWait = 0; mock->isVmBindAvailableCall.called = 0u; FlushStamp handleToWait = 123; testedCsr->waitForFlushStamp(handleToWait); - EXPECT_EQ(0, mock->ioctl_cnt.gemWait); + EXPECT_EQ(0, mock->ioctlCnt.gemWait); EXPECT_EQ(1u, testedCsr->waitUserFenceResult.called); EXPECT_EQ(123u, testedCsr->waitUserFenceResult.waitValue); diff --git a/shared/test/unit_test/os_interface/linux/drm_command_stream_tests_1.cpp b/shared/test/unit_test/os_interface/linux/drm_command_stream_tests_1.cpp index f02bc1be24..4cadc10fd5 100644 --- a/shared/test/unit_test/os_interface/linux/drm_command_stream_tests_1.cpp +++ b/shared/test/unit_test/os_interface/linux/drm_command_stream_tests_1.cpp @@ -519,9 +519,9 @@ HWTEST_TEMPLATED_F(DrmCommandStreamBatchingTests, givenCsrWhenFlushIsCalledThenP auto engineFlag = static_cast(csr->getOsContext()).getEngineFlag(); - EXPECT_EQ(ioctlExecCnt + ioctlUserPtrCnt, this->mock->ioctl_cnt.total); - EXPECT_EQ(ioctlExecCnt, this->mock->ioctl_cnt.execbuffer2); - EXPECT_EQ(ioctlUserPtrCnt, this->mock->ioctl_cnt.gemUserptr); + EXPECT_EQ(ioctlExecCnt + ioctlUserPtrCnt, this->mock->ioctlCnt.total); + EXPECT_EQ(ioctlExecCnt, this->mock->ioctlCnt.execbuffer2); + EXPECT_EQ(ioctlUserPtrCnt, this->mock->ioctlCnt.gemUserptr); uint64_t flags = engineFlag | I915_EXEC_NO_RELOC; EXPECT_EQ(flags, this->mock->execBuffer.getFlags()); @@ -586,8 +586,8 @@ HWTEST_TEMPLATED_F(DrmCommandStreamBatchingTests, givenCsrWhenDispatchPolicyIsSe int ioctlUserPtrCnt = (device->getPreemptionMode() == PreemptionMode::MidThread) ? 4 : 3; ioctlUserPtrCnt += testedCsr->clearColorAllocation ? 1 : 0; - EXPECT_EQ(ioctlUserPtrCnt, this->mock->ioctl_cnt.total); - EXPECT_EQ(ioctlUserPtrCnt, this->mock->ioctl_cnt.gemUserptr); + EXPECT_EQ(ioctlUserPtrCnt, this->mock->ioctlCnt.total); + EXPECT_EQ(ioctlUserPtrCnt, this->mock->ioctlCnt.gemUserptr); EXPECT_EQ(0u, this->mock->execBuffer.getFlags()); @@ -666,9 +666,9 @@ HWTEST_TEMPLATED_F(DrmCommandStreamBatchingTests, givenRecordedCommandBufferWhen int ioctlExecCnt = 1; int ioctlUserPtrCnt = (device->getPreemptionMode() == PreemptionMode::MidThread) ? 3 : 2; ioctlUserPtrCnt += testedCsr->clearColorAllocation ? 1 : 0; - EXPECT_EQ(ioctlExecCnt, this->mock->ioctl_cnt.execbuffer2); - EXPECT_EQ(ioctlUserPtrCnt, this->mock->ioctl_cnt.gemUserptr); - EXPECT_EQ(ioctlExecCnt + ioctlUserPtrCnt, this->mock->ioctl_cnt.total); + EXPECT_EQ(ioctlExecCnt, this->mock->ioctlCnt.execbuffer2); + EXPECT_EQ(ioctlUserPtrCnt, this->mock->ioctlCnt.gemUserptr); + EXPECT_EQ(ioctlExecCnt + ioctlUserPtrCnt, this->mock->ioctlCnt.total); mm->freeGraphicsMemory(commandBuffer); } diff --git a/shared/test/unit_test/os_interface/linux/drm_gem_close_worker_tests.cpp b/shared/test/unit_test/os_interface/linux/drm_gem_close_worker_tests.cpp index a905c53cc8..d80b144b0b 100644 --- a/shared/test/unit_test/os_interface/linux/drm_gem_close_worker_tests.cpp +++ b/shared/test/unit_test/os_interface/linux/drm_gem_close_worker_tests.cpp @@ -33,16 +33,16 @@ class DrmMockForWorker : public Drm { public: using Drm::setupIoctlHelper; std::mutex mutex; - std::atomic gem_close_cnt; - std::atomic gem_close_expected; - std::atomic ioctl_caller_thread_id; + std::atomic gemCloseCnt; + std::atomic gemCloseExpected; + std::atomic ioctlCallerThreadId; DrmMockForWorker(RootDeviceEnvironment &rootDeviceEnvironment) : Drm(std::make_unique(mockFd, mockPciPath), rootDeviceEnvironment) { } int ioctl(DrmIoctl request, void *arg) override { if (request == DrmIoctl::GemClose) - gem_close_cnt++; + gemCloseCnt++; - ioctl_caller_thread_id = std::this_thread::get_id(); + ioctlCallerThreadId = std::this_thread::get_id(); return 0; }; @@ -73,13 +73,13 @@ class DrmGemCloseWorkerFixture { false, executionEnvironment); - this->drmMock->gem_close_cnt = 0; - this->drmMock->gem_close_expected = 0; + this->drmMock->gemCloseCnt = 0; + this->drmMock->gemCloseExpected = 0; } void tearDown() { - if (this->drmMock->gem_close_expected >= 0) { - EXPECT_EQ(this->drmMock->gem_close_expected, this->drmMock->gem_close_cnt); + if (this->drmMock->gemCloseExpected >= 0) { + EXPECT_EQ(this->drmMock->gemCloseExpected, this->drmMock->gemCloseCnt); } delete this->mm; @@ -98,7 +98,7 @@ class DrmGemCloseWorkerFixture { typedef Test DrmGemCloseWorkerTests; TEST_F(DrmGemCloseWorkerTests, WhenClosingGemThenSucceeds) { - this->drmMock->gem_close_expected = 1; + this->drmMock->gemCloseExpected = 1; auto worker = new DrmGemCloseWorker(*mm); auto bo = new BufferObject(this->drmMock, 3, 1, 0, 1); @@ -109,7 +109,7 @@ TEST_F(DrmGemCloseWorkerTests, WhenClosingGemThenSucceeds) { } TEST_F(DrmGemCloseWorkerTests, GivenMultipleThreadsWhenClosingGemThenSucceeds) { - this->drmMock->gem_close_expected = -1; + this->drmMock->gemCloseExpected = -1; auto worker = new DrmGemCloseWorker(*mm); auto bo = new BufferObject(this->drmMock, 3, 1, 0, 1); @@ -123,13 +123,13 @@ TEST_F(DrmGemCloseWorkerTests, GivenMultipleThreadsWhenClosingGemThenSucceeds) { worker->close(false); // and check if GEM was closed - EXPECT_EQ(1, this->drmMock->gem_close_cnt.load()); + EXPECT_EQ(1, this->drmMock->gemCloseCnt.load()); delete worker; } TEST_F(DrmGemCloseWorkerTests, GivenMultipleThreadsAndCloseFalseWhenClosingGemThenSucceeds) { - this->drmMock->gem_close_expected = -1; + this->drmMock->gemCloseExpected = -1; auto worker = new DrmGemCloseWorker(*mm); auto bo = new BufferObject(this->drmMock, 3, 1, 0, 1); @@ -142,12 +142,12 @@ TEST_F(DrmGemCloseWorkerTests, GivenMultipleThreadsAndCloseFalseWhenClosingGemTh sched_yield(); // yield to another threads // and check if GEM was closed - EXPECT_EQ(1, this->drmMock->gem_close_cnt.load()); + EXPECT_EQ(1, this->drmMock->gemCloseCnt.load()); delete worker; } TEST_F(DrmGemCloseWorkerTests, givenAllocationWhenAskedForUnreferenceWithForceFlagSetThenAllocationIsReleasedFromCallingThread) { - this->drmMock->gem_close_expected = 1; + this->drmMock->gemCloseExpected = 1; auto worker = new DrmGemCloseWorker(*mm); auto bo = new BufferObject(this->drmMock, 3, 1, 0, 1); @@ -157,7 +157,7 @@ TEST_F(DrmGemCloseWorkerTests, givenAllocationWhenAskedForUnreferenceWithForceFl auto r = mm->unreference(bo, true); EXPECT_EQ(1u, r); - EXPECT_EQ(drmMock->ioctl_caller_thread_id, std::this_thread::get_id()); + EXPECT_EQ(drmMock->ioctlCallerThreadId, std::this_thread::get_id()); delete worker; } diff --git a/shared/test/unit_test/os_interface/linux/drm_memory_manager_debug_surface_prelim_tests.cpp b/shared/test/unit_test/os_interface/linux/drm_memory_manager_debug_surface_prelim_tests.cpp index ee1a577726..cb6c0b4ee1 100644 --- a/shared/test/unit_test/os_interface/linux/drm_memory_manager_debug_surface_prelim_tests.cpp +++ b/shared/test/unit_test/os_interface/linux/drm_memory_manager_debug_surface_prelim_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2022 Intel Corporation + * Copyright (C) 2022-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -36,11 +36,11 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenCreateDebugSurfaceAndAlignedM } TEST_F(DrmMemoryManagerLocalMemoryWithCustomPrelimMockTest, givenCreateDebugSurfaceAndAllocUserptrFailedThenNullptrReturned) { - mock->ioctl_res = -1; + mock->ioctlRes = -1; AllocationProperties debugSurfaceProperties{0, true, MemoryConstants::pageSize, NEO::AllocationType::DEBUG_CONTEXT_SAVE_AREA, false, false, 0b1011}; auto debugSurface = memoryManager->allocateGraphicsMemoryWithProperties(debugSurfaceProperties); - mock->ioctl_res = 0; - EXPECT_EQ(1, mock->ioctl_cnt.gemUserptr); + mock->ioctlRes = 0; + EXPECT_EQ(1, mock->ioctlCnt.gemUserptr); EXPECT_EQ(nullptr, debugSurface); } @@ -52,7 +52,7 @@ TEST_F(DrmMemoryManagerLocalMemoryWithCustomPrelimMockTest, givenCreateDebugSurf EXPECT_EQ(MemoryPool::System4KBPages, debugSurface->getMemoryPool()); EXPECT_EQ(3u, debugSurface->getNumGmms()); - EXPECT_EQ(3, mock->ioctl_cnt.gemUserptr); + EXPECT_EQ(3, mock->ioctlCnt.gemUserptr); EXPECT_NE(nullptr, debugSurface->getUnderlyingBuffer()); EXPECT_EQ(MemoryConstants::pageSize, debugSurface->getUnderlyingBufferSize()); diff --git a/shared/test/unit_test/os_interface/linux/drm_memory_manager_localmem_prelim_tests.cpp b/shared/test/unit_test/os_interface/linux/drm_memory_manager_localmem_prelim_tests.cpp index ad740ec427..cd0bdfe6cf 100644 --- a/shared/test/unit_test/os_interface/linux/drm_memory_manager_localmem_prelim_tests.cpp +++ b/shared/test/unit_test/os_interface/linux/drm_memory_manager_localmem_prelim_tests.cpp @@ -1749,7 +1749,7 @@ TEST_F(DrmMemoryManagerLocalMemoryPrelimTest, givenDebugVariableSetWhenAllocatin using DrmMemoryManagerFailInjectionPrelimTest = Test; TEST_F(DrmMemoryManagerFailInjectionPrelimTest, givenEnabledLocalMemoryWhenNewFailsThenAllocateInDevicePoolReturnsStatusErrorAndNullallocation) { - mock->ioctl_expected.total = -1; // don't care + mock->ioctlExpected.total = -1; // don't care class MockGfxPartition : public GfxPartition { public: MockGfxPartition() : GfxPartition(reservedCpuAddressRange) { @@ -1982,9 +1982,9 @@ TEST_F(DrmMemoryManagerCopyMemoryToAllocationPrelimTest, givenDrmMemoryManagerWh typedef Test DrmMemoryManagerTestPrelim; TEST_F(DrmMemoryManagerTestPrelim, whenSettingNumHandlesThenTheyAreRetrievedCorrectly) { - mock->ioctl_expected.primeFdToHandle = 2; - mock->ioctl_expected.gemWait = 1; - mock->ioctl_expected.gemClose = 2; + mock->ioctlExpected.primeFdToHandle = 2; + mock->ioctlExpected.gemWait = 1; + mock->ioctlExpected.gemClose = 2; std::vector handles{6, 7}; size_t size = 65536u * 2; @@ -2003,9 +2003,9 @@ TEST_F(DrmMemoryManagerTestPrelim, whenSettingNumHandlesThenTheyAreRetrievedCorr } TEST_F(DrmMemoryManagerTestPrelim, whenCreatingAllocationFromMultipleSharedHandlesWithSharingResourcesThenDifferentAllocationsAreReturned) { - mock->ioctl_expected.primeFdToHandle = 4; - mock->ioctl_expected.gemWait = 2; - mock->ioctl_expected.gemClose = 2; + mock->ioctlExpected.primeFdToHandle = 4; + mock->ioctlExpected.gemWait = 2; + mock->ioctlExpected.gemClose = 2; std::vector handles{6, 7}; size_t size = 65536u * 2; @@ -2036,9 +2036,9 @@ TEST_F(DrmMemoryManagerTestPrelim, whenCreatingAllocationFromMultipleSharedHandl } TEST_F(DrmMemoryManagerTestPrelim, whenCreatingAllocationFromMultipleSharedHandlesWithNoSharingResourcesThenDifferentAllocationsAreReturned) { - mock->ioctl_expected.primeFdToHandle = 4; - mock->ioctl_expected.gemWait = 2; - mock->ioctl_expected.gemClose = 4; + mock->ioctlExpected.primeFdToHandle = 4; + mock->ioctlExpected.gemWait = 2; + mock->ioctlExpected.gemClose = 4; std::vector handles{6, 7}; size_t size = 65536u * 2; @@ -2069,9 +2069,9 @@ TEST_F(DrmMemoryManagerTestPrelim, whenCreatingAllocationFromMultipleSharedHandl } TEST_F(DrmMemoryManagerTestPrelim, whenCreatingAllocationFromMultipleSharedHandlesAndFindAndReferenceSharedBufferObjectReturnsNonNullThenAllocationSucceeds) { - mock->ioctl_expected.primeFdToHandle = 4; - mock->ioctl_expected.gemWait = 2; - mock->ioctl_expected.gemClose = 2; + mock->ioctlExpected.primeFdToHandle = 4; + mock->ioctlExpected.gemWait = 2; + mock->ioctlExpected.gemClose = 2; std::vector handles{6, 7}; size_t size = 65536u * 2; @@ -2099,9 +2099,9 @@ TEST_F(DrmMemoryManagerTestPrelim, whenCreatingAllocationFromMultipleSharedHandl } TEST_F(DrmMemoryManagerTestPrelim, whenCreatingAllocationFromMultipleSharedHandlesWithOneHandleThenAllocationSucceedsAndGpuAddressIsFromTheExpectedHeap) { - mock->ioctl_expected.primeFdToHandle = 1; - mock->ioctl_expected.gemWait = 1; - mock->ioctl_expected.gemClose = 1; + mock->ioctlExpected.primeFdToHandle = 1; + mock->ioctlExpected.gemWait = 1; + mock->ioctlExpected.gemClose = 1; std::vector handles{6}; size_t size = 65536u * 2; @@ -2130,9 +2130,9 @@ TEST_F(DrmMemoryManagerTestPrelim, whenCreatingAllocationFromMultipleSharedHandl } TEST_F(DrmMemoryManagerTestPrelim, whenCreatingAllocationFromMultipleSharedHandlesAndIoctlFailsThenNullIsReturned) { - mock->ioctl_expected.primeFdToHandle = 1; - mock->ioctl_expected.gemWait = 0; - mock->ioctl_expected.gemClose = 0; + mock->ioctlExpected.primeFdToHandle = 1; + mock->ioctlExpected.gemWait = 0; + mock->ioctlExpected.gemClose = 0; mock->failOnPrimeFdToHandle = true; std::vector handles{6, 7}; @@ -2145,9 +2145,9 @@ TEST_F(DrmMemoryManagerTestPrelim, whenCreatingAllocationFromMultipleSharedHandl } TEST_F(DrmMemoryManagerTestPrelim, whenCreatingAllocationFromMultipleSharedHandlesThenAllocationSucceeds) { - mock->ioctl_expected.primeFdToHandle = 2; - mock->ioctl_expected.gemWait = 1; - mock->ioctl_expected.gemClose = 2; + mock->ioctlExpected.primeFdToHandle = 2; + mock->ioctlExpected.gemWait = 1; + mock->ioctlExpected.gemClose = 2; std::vector handles{6, 7}; size_t size = 65536u * 2; @@ -2166,9 +2166,9 @@ TEST_F(DrmMemoryManagerTestPrelim, whenCreatingAllocationFromMultipleSharedHandl } TEST_F(DrmMemoryManagerTestPrelim, givenDrmMemoryManagerWhenLockUnlockIsCalledOnAllocationInLocalMemoryButFailsOnMmapFunctionThenReturnNullPtr) { - mock->ioctl_expected.gemMmapOffset = 2; - this->ioctlResExt = {mock->ioctl_cnt.total, -1}; - mock->ioctl_res_ext = &ioctlResExt; + mock->ioctlExpected.gemMmapOffset = 2; + this->ioctlResExt = {mock->ioctlCnt.total, -1}; + mock->ioctlResExt = &ioctlResExt; BufferObject bo(mock, 3, 1, 0, 1); DrmAllocation drmAllocation(0, AllocationType::UNKNOWN, &bo, nullptr, 0u, 0u, MemoryPool::LocalMemory); @@ -2178,11 +2178,11 @@ TEST_F(DrmMemoryManagerTestPrelim, givenDrmMemoryManagerWhenLockUnlockIsCalledOn EXPECT_EQ(nullptr, ptr); memoryManager->unlockResource(&drmAllocation); - mock->ioctl_res_ext = &mock->NONE; + mock->ioctlResExt = &mock->none; } TEST_F(DrmMemoryManagerTestPrelim, givenDrmMemoryManagerWhenLockUnlockIsCalledOnAllocationInLocalMemoryButFailsOnIoctlMmapOffsetThenReturnNullPtr) { - mock->ioctl_expected.gemMmapOffset = 2; + mock->ioctlExpected.gemMmapOffset = 2; mock->failOnMmapOffset = true; BufferObject bo(mock, 3, 1, 0, 1); @@ -2193,14 +2193,14 @@ TEST_F(DrmMemoryManagerTestPrelim, givenDrmMemoryManagerWhenLockUnlockIsCalledOn EXPECT_EQ(nullptr, ptr); memoryManager->unlockResource(&drmAllocation); - mock->ioctl_res_ext = &mock->NONE; + mock->ioctlResExt = &mock->none; } TEST_F(DrmMemoryManagerTestPrelim, givenDrmMemoryManagerAndOsHandleWhenCreateIsCalledThenGraphicsAllocationIsReturned2) { - mock->ioctl_expected.primeFdToHandle = 1; - mock->ioctl_expected.gemWait = 1; - mock->ioctl_expected.gemClose = 1; - mock->ioctl_expected.gemMmapOffset = 1; + mock->ioctlExpected.primeFdToHandle = 1; + mock->ioctlExpected.gemWait = 1; + mock->ioctlExpected.gemClose = 1; + mock->ioctlExpected.gemMmapOffset = 1; osHandle handle = 1u; size_t size = 4096u; @@ -2225,10 +2225,10 @@ TEST_F(DrmMemoryManagerTestPrelim, givenDrmMemoryManagerAndOsHandleWhenCreateIsC TEST_F(DrmMemoryManagerTestPrelim, whenPrintBOCreateDestroyResultFlagIsSetAndCallToCreateSharedAllocationForHostAllocationThenExpectedMessageIsPrinted) { - mock->ioctl_expected.primeFdToHandle = 1; - mock->ioctl_expected.gemWait = 1; - mock->ioctl_expected.gemClose = 1; - mock->ioctl_expected.gemMmapOffset = 1; + mock->ioctlExpected.primeFdToHandle = 1; + mock->ioctlExpected.gemWait = 1; + mock->ioctlExpected.gemClose = 1; + mock->ioctlExpected.gemMmapOffset = 1; DebugManagerStateRestore stateRestore; DebugManager.flags.PrintBOCreateDestroyResult.set(true); @@ -2268,10 +2268,10 @@ TEST_F(DrmMemoryManagerTestPrelim, } TEST_F(DrmMemoryManagerTestPrelim, givenDrmMemoryManagerAndOsHandleWhenCreateIsCalledWithBufferHostMemoryAllocationTypeThenGraphicsAllocationIsReturned) { - mock->ioctl_expected.primeFdToHandle = 1; - mock->ioctl_expected.gemWait = 1; - mock->ioctl_expected.gemClose = 1; - mock->ioctl_expected.gemMmapOffset = 1; + mock->ioctlExpected.primeFdToHandle = 1; + mock->ioctlExpected.gemWait = 1; + mock->ioctlExpected.gemClose = 1; + mock->ioctlExpected.gemMmapOffset = 1; osHandle handle = 1u; this->mock->outputHandle = 2u; @@ -2297,10 +2297,10 @@ TEST_F(DrmMemoryManagerTestPrelim, givenDrmMemoryManagerAndOsHandleWhenCreateIsC } TEST_F(DrmMemoryManagerTestPrelim, givenDrmMemoryManagerAndOsHandleWhenCreateIsCalledForAnExistingAllocationGraphicsAllocationIsReturned) { - mock->ioctl_expected.primeFdToHandle = 2; - mock->ioctl_expected.gemWait = 2; - mock->ioctl_expected.gemClose = 1; - mock->ioctl_expected.gemMmapOffset = 1; + mock->ioctlExpected.primeFdToHandle = 2; + mock->ioctlExpected.gemWait = 2; + mock->ioctlExpected.gemClose = 1; + mock->ioctlExpected.gemMmapOffset = 1; osHandle handle = 1u; this->mock->outputHandle = 2u; @@ -2340,8 +2340,8 @@ TEST_F(DrmMemoryManagerTestPrelim, givenDrmMemoryManagerAndOsHandleWhenCreateIsC } TEST_F(DrmMemoryManagerTestPrelim, givenDrmMemoryManagerAndOsHandleWhenCreateIsCalledAndMmapOffsetIoctlFailsThenNullAllocationIsReturned) { - mock->ioctl_expected.primeFdToHandle = 1; - mock->ioctl_expected.gemMmapOffset = 2; + mock->ioctlExpected.primeFdToHandle = 1; + mock->ioctlExpected.gemMmapOffset = 2; osHandle handle = 1u; size_t size = 4096u; @@ -2356,9 +2356,9 @@ TEST_F(DrmMemoryManagerTestPrelim, givenDrmMemoryManagerAndOsHandleWhenCreateIsC } TEST_F(DrmMemoryManagerTestPrelim, givenDrmMemoryManagerAndUseMmapObjectSetToFalseThenDrmAllocationWithoutMappingIsReturned) { - mock->ioctl_expected.primeFdToHandle = 1; - mock->ioctl_expected.gemWait = 1; - mock->ioctl_expected.gemClose = 1; + mock->ioctlExpected.primeFdToHandle = 1; + mock->ioctlExpected.gemWait = 1; + mock->ioctlExpected.gemClose = 1; osHandle handle = 99u; this->mock->outputHandle = handle; @@ -2374,9 +2374,9 @@ TEST_F(DrmMemoryManagerTestPrelim, givenDrmMemoryManagerAndUseMmapObjectSetToFal } TEST_F(DrmMemoryManagerTestPrelim, givenDrmMemoryManagerWithoutMemoryInfoThenDrmAllocationWithoutMappingIsReturned) { - mock->ioctl_expected.primeFdToHandle = 1; - mock->ioctl_expected.gemWait = 1; - mock->ioctl_expected.gemClose = 1; + mock->ioctlExpected.primeFdToHandle = 1; + mock->ioctlExpected.gemWait = 1; + mock->ioctlExpected.gemClose = 1; mock->memoryInfo.reset(); @@ -2393,7 +2393,7 @@ TEST_F(DrmMemoryManagerTestPrelim, givenDrmMemoryManagerWithoutMemoryInfoThenDrm } TEST_F(DrmMemoryManagerTestPrelim, MmapFailWhenUSMHostAllocationFromSharedHandleThenNullPtrReturned) { - mock->ioctl_expected.primeFdToHandle = 1; + mock->ioctlExpected.primeFdToHandle = 1; osHandle handle = 1u; size_t size = 4096u; diff --git a/shared/test/unit_test/os_interface/linux/drm_memory_manager_localmem_upstream_tests.cpp b/shared/test/unit_test/os_interface/linux/drm_memory_manager_localmem_upstream_tests.cpp index 64cfb06842..69f4402ebc 100644 --- a/shared/test/unit_test/os_interface/linux/drm_memory_manager_localmem_upstream_tests.cpp +++ b/shared/test/unit_test/os_interface/linux/drm_memory_manager_localmem_upstream_tests.cpp @@ -656,7 +656,7 @@ TEST_F(DrmMemoryManagerLocalMemoryWithCustomMockTest, givenDrmMemoryManagerWithL using DrmMemoryManagerFailInjectionTest = Test; HWTEST2_F(DrmMemoryManagerFailInjectionTest, givenEnabledLocalMemoryWhenNewFailsThenAllocateInDevicePoolReturnsStatusErrorAndNullallocation, NonDefaultIoctlsSupported) { - mock->ioctl_expected.total = -1; // don't care + mock->ioctlExpected.total = -1; // don't care class MockGfxPartition : public GfxPartition { public: MockGfxPartition() : GfxPartition(reservedCpuAddressRange) { @@ -804,10 +804,10 @@ TEST_F(DrmMemoryManagerCopyMemoryToAllocationTest, givenDrmMemoryManagerWhenCopy using DrmMemoryManagerTestImpl = Test; HWTEST2_F(DrmMemoryManagerTestImpl, givenDrmMemoryManagerWhenLockUnlockIsCalledOnAllocationInLocalMemoryThenCallIoctlGemMapOffsetAndReturnLockedPtr, NonDefaultIoctlsSupported) { - mockExp->ioctl_expected.gemCreateExt = 1; - mockExp->ioctl_expected.gemWait = 1; - mockExp->ioctl_expected.gemClose = 1; - mockExp->ioctl_expected.gemMmapOffset = 1; + mockExp->ioctlExpected.gemCreateExt = 1; + mockExp->ioctlExpected.gemWait = 1; + mockExp->ioctlExpected.gemClose = 1; + mockExp->ioctlExpected.gemMmapOffset = 1; mockExp->memoryInfo.reset(new MockMemoryInfo(*mockExp)); AllocationData allocData; @@ -840,9 +840,9 @@ HWTEST2_F(DrmMemoryManagerTestImpl, givenDrmMemoryManagerWhenLockUnlockIsCalledO } TEST_F(DrmMemoryManagerTestImpl, givenDrmMemoryManagerWhenLockUnlockIsCalledOnAllocationInLocalMemoryButFailsOnMmapThenReturnNullPtr) { - mockExp->ioctl_expected.gemMmapOffset = 2; - this->ioctlResExt = {mockExp->ioctl_cnt.total, -1}; - mockExp->ioctl_res_ext = &ioctlResExt; + mockExp->ioctlExpected.gemMmapOffset = 2; + this->ioctlResExt = {mockExp->ioctlCnt.total, -1}; + mockExp->ioctlResExt = &ioctlResExt; BufferObject bo(mockExp, 3, 1, 0, 0); DrmAllocation drmAllocation(0, AllocationType::UNKNOWN, &bo, nullptr, 0u, 0u, MemoryPool::LocalMemory); @@ -852,11 +852,11 @@ TEST_F(DrmMemoryManagerTestImpl, givenDrmMemoryManagerWhenLockUnlockIsCalledOnAl EXPECT_EQ(nullptr, ptr); memoryManager->unlockResource(&drmAllocation); - mockExp->ioctl_res_ext = &mockExp->NONE; + mockExp->ioctlResExt = &mockExp->none; } TEST_F(DrmMemoryManagerTestImpl, givenDrmMemoryManagerWhenLockUnlockIsCalledOnAllocationInLocalMemoryButFailsOnIoctlMmapFunctionOffsetThenReturnNullPtr) { - mockExp->ioctl_expected.gemMmapOffset = 2; + mockExp->ioctlExpected.gemMmapOffset = 2; mockExp->returnIoctlExtraErrorValue = true; mockExp->failOnMmapOffset = true; @@ -868,7 +868,7 @@ TEST_F(DrmMemoryManagerTestImpl, givenDrmMemoryManagerWhenLockUnlockIsCalledOnAl EXPECT_EQ(nullptr, ptr); memoryManager->unlockResource(&drmAllocation); - mockExp->ioctl_res_ext = &mockExp->NONE; + mockExp->ioctlResExt = &mockExp->none; } TEST_F(DrmMemoryManagerTestImpl, givenDrmMemoryManagerWhenLockUnlockIsCalledOnAllocationInLocalMemoryButBufferObjectIsNullThenReturnNullPtr) { diff --git a/shared/test/unit_test/os_interface/linux/drm_memory_manager_tests.cpp b/shared/test/unit_test/os_interface/linux/drm_memory_manager_tests.cpp index 18c5fedf26..bbff494853 100644 --- a/shared/test/unit_test/os_interface/linux/drm_memory_manager_tests.cpp +++ b/shared/test/unit_test/os_interface/linux/drm_memory_manager_tests.cpp @@ -255,9 +255,9 @@ TEST_F(DrmMemoryManagerTest, GivenGraphicsAllocationWhenAddAndRemoveAllocationTo } TEST_F(DrmMemoryManagerTest, GivenAllocatePhysicalDeviceMemoryThenSuccessReturnedAndNoVirtualMemoryAssigned) { - mock->ioctl_expected.gemWait = 1; - mock->ioctl_expected.gemCreate = 1; - mock->ioctl_expected.gemClose = 1; + mock->ioctlExpected.gemWait = 1; + mock->ioctlExpected.gemCreate = 1; + mock->ioctlExpected.gemClose = 1; allocationData.size = MemoryConstants::pageSize; allocationData.flags.shareable = true; @@ -328,8 +328,8 @@ TEST_F(DrmMemoryManagerWithExplicitExpectationsTest, givenSmallSizeAndGpuAddress properties.osContext = osContext; mock->reset(); - mock->ioctl_expected.gemUserptr = 1; - mock->ioctl_expected.execbuffer2 = 0; // pinBB not called + mock->ioctlExpected.gemUserptr = 1; + mock->ioctlExpected.execbuffer2 = 0; // pinBB not called auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(properties); @@ -342,7 +342,7 @@ TEST_F(DrmMemoryManagerWithExplicitExpectationsTest, givenSmallSizeAndGpuAddress } TEST_F(DrmMemoryManagerTest, givenInjectedFailuresWhenGraphicsMemoryWithGpuVaIsAllocatedThenNullptrIsReturned) { - mock->ioctl_expected.total = -1; // don't care + mock->ioctlExpected.total = -1; // don't care auto memoryManager = std::make_unique(false, true, false, *executionEnvironment); auto osContext = device->getDefaultEngine().osContext; @@ -373,8 +373,8 @@ TEST_F(DrmMemoryManagerWithExplicitExpectationsTest, givenSizeExceedingThreshold properties.osContext = osContext; mock->reset(); - mock->ioctl_expected.gemUserptr = 1; - mock->ioctl_expected.execbuffer2 = 1; // pinBB called + mock->ioctlExpected.gemUserptr = 1; + mock->ioctlExpected.execbuffer2 = 1; // pinBB called auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(properties); @@ -388,8 +388,8 @@ TEST_F(DrmMemoryManagerWithExplicitExpectationsTest, givenSizeExceedingThreshold memoryManager->injectPinBB(nullptr, rootDeviceIndex); // pinBB not available mock->reset(); - mock->ioctl_expected.gemUserptr = 1; - mock->ioctl_expected.execbuffer2 = 0; // pinBB not called + mock->ioctlExpected.gemUserptr = 1; + mock->ioctlExpected.execbuffer2 = 0; // pinBB not called properties.gpuAddress = 0x5000; @@ -412,8 +412,8 @@ TEST_F(DrmMemoryManagerWithExplicitExpectationsTest, givenDisabledForcePinAndSiz properties.osContext = osContext; mock->reset(); - mock->ioctl_expected.gemUserptr = 1; - mock->ioctl_expected.execbuffer2 = 0; // pinBB not called + mock->ioctlExpected.gemUserptr = 1; + mock->ioctlExpected.execbuffer2 = 0; // pinBB not called auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(properties); @@ -447,16 +447,16 @@ TEST_F(DrmMemoryManagerTest, givenDefaultDrmMemoryManagerWhenItIsCreatedAndGfxPa } TEST_F(DrmMemoryManagerTest, WhenMemoryManagerIsCreatedThenPinBbIsCreated) { - mock->ioctl_expected.gemUserptr = 1; - mock->ioctl_expected.gemClose = 1; + mock->ioctlExpected.gemUserptr = 1; + mock->ioctlExpected.gemClose = 1; auto memoryManager = std::make_unique(false, true, false, *executionEnvironment); EXPECT_NE(nullptr, memoryManager->pinBBs[rootDeviceIndex]); } TEST_F(DrmMemoryManagerTest, GivenMemoryManagerIsCreatedWhenInvokingReleaseMemResourcesBasedOnGpuDeviceThenPinBbIsRemoved) { - mock->ioctl_expected.gemUserptr = 1; - mock->ioctl_expected.gemClose = 1; + mock->ioctlExpected.gemUserptr = 1; + mock->ioctlExpected.gemClose = 1; auto drmMemoryManager = std::make_unique(false, true, false, *executionEnvironment); EXPECT_NE(nullptr, drmMemoryManager->pinBBs[rootDeviceIndex]); @@ -467,8 +467,8 @@ TEST_F(DrmMemoryManagerTest, GivenMemoryManagerIsCreatedWhenInvokingReleaseMemRe } TEST_F(DrmMemoryManagerTest, GivenMemoryManagerIsCreatedWhenInvokingCreatMemResourcesBasedOnGpuDeviceThenPinBbIsCreated) { - mock->ioctl_expected.gemUserptr = 2; - mock->ioctl_expected.gemClose = 2; + mock->ioctlExpected.gemUserptr = 2; + mock->ioctlExpected.gemClose = 2; auto drmMemoryManager = std::make_unique(false, true, false, *executionEnvironment); auto rootDeviceBufferObjectOld = drmMemoryManager->pinBBs[rootDeviceIndex]; @@ -493,19 +493,19 @@ TEST_F(DrmMemoryManagerTest, givenNotAllowedForcePinWhenMemoryManagerIsCreatedTh } TEST_F(DrmMemoryManagerTest, WhenIoctlFailsThenPinBbIsNotCreated) { - mock->ioctl_expected.gemUserptr = 1; - mock->ioctl_res = -1; + mock->ioctlExpected.gemUserptr = 1; + mock->ioctlRes = -1; auto memoryManager = new (std::nothrow) TestedDrmMemoryManager(false, true, false, *executionEnvironment); EXPECT_EQ(nullptr, memoryManager->pinBBs[rootDeviceIndex]); - mock->ioctl_res = 0; + mock->ioctlRes = 0; delete memoryManager; } TEST_F(DrmMemoryManagerTest, WhenAskedAndAllowedAndBigAllocationThenPinAfterAllocate) { - mock->ioctl_expected.gemUserptr = 2; - mock->ioctl_expected.execbuffer2 = 1; - mock->ioctl_expected.gemWait = 1; - mock->ioctl_expected.gemClose = 2; + mock->ioctlExpected.gemUserptr = 2; + mock->ioctlExpected.execbuffer2 = 1; + mock->ioctlExpected.gemWait = 1; + mock->ioctlExpected.gemClose = 2; auto memoryManager = std::make_unique(false, true, false, *executionEnvironment); memoryManager->registeredEngines = EngineControlContainer{this->device->allEngines}; @@ -522,10 +522,10 @@ TEST_F(DrmMemoryManagerTest, WhenAskedAndAllowedAndBigAllocationThenPinAfterAllo } TEST_F(DrmMemoryManagerTest, whenPeekInternalHandleIsCalledThenBoIsReturned) { - mock->ioctl_expected.gemUserptr = 1; - mock->ioctl_expected.gemWait = 1; - mock->ioctl_expected.gemClose = 1; - mock->ioctl_expected.handleToPrimeFd = 1; + mock->ioctlExpected.gemUserptr = 1; + mock->ioctlExpected.gemWait = 1; + mock->ioctlExpected.gemClose = 1; + mock->ioctlExpected.handleToPrimeFd = 1; mock->outputFd = 1337; auto allocation = static_cast(this->memoryManager->allocateGraphicsMemoryWithProperties(createAllocationProperties(rootDeviceIndex, 10 * MemoryConstants::pageSize, true))); ASSERT_NE(allocation->getBO(), nullptr); @@ -538,9 +538,9 @@ TEST_F(DrmMemoryManagerTest, whenPeekInternalHandleIsCalledThenBoIsReturned) { } TEST_F(DrmMemoryManagerTest, whenPeekInternalHandleIsCalledAndObtainFdFromHandleFailsThenErrorIsReturned) { - mock->ioctl_expected.gemUserptr = 1; - mock->ioctl_expected.gemWait = 1; - mock->ioctl_expected.gemClose = 1; + mock->ioctlExpected.gemUserptr = 1; + mock->ioctlExpected.gemWait = 1; + mock->ioctlExpected.gemClose = 1; mock->outputFd = 1337; auto allocation = static_cast(this->memoryManager->allocateGraphicsMemoryWithProperties(createAllocationProperties(rootDeviceIndex, 10 * MemoryConstants::pageSize, true))); ASSERT_NE(allocation->getBO(), nullptr); @@ -553,10 +553,10 @@ TEST_F(DrmMemoryManagerTest, whenPeekInternalHandleIsCalledAndObtainFdFromHandle } TEST_F(DrmMemoryManagerTest, whenCallingPeekInternalHandleSeveralTimesThenSameHandleIsReturned) { - mock->ioctl_expected.gemUserptr = 1; - mock->ioctl_expected.gemWait = 1; - mock->ioctl_expected.gemClose = 1; - mock->ioctl_expected.handleToPrimeFd = 1; + mock->ioctlExpected.gemUserptr = 1; + mock->ioctlExpected.gemWait = 1; + mock->ioctlExpected.gemClose = 1; + mock->ioctlExpected.handleToPrimeFd = 1; uint64_t expectedFd = 1337; mock->outputFd = static_cast(expectedFd); mock->incrementOutputFdAfterCall = true; @@ -585,10 +585,10 @@ TEST_F(DrmMemoryManagerTest, whenCallingPeekInternalHandleSeveralTimesThenSameHa } TEST_F(DrmMemoryManagerTest, whenPeekInternalHandleWithHandleIdIsCalledThenBoIsReturned) { - mock->ioctl_expected.gemUserptr = 1; - mock->ioctl_expected.gemWait = 1; - mock->ioctl_expected.gemClose = 1; - mock->ioctl_expected.handleToPrimeFd = 1; + mock->ioctlExpected.gemUserptr = 1; + mock->ioctlExpected.gemWait = 1; + mock->ioctlExpected.gemClose = 1; + mock->ioctlExpected.handleToPrimeFd = 1; mock->outputFd = 1337; auto allocation = static_cast(this->memoryManager->allocateGraphicsMemoryWithProperties(createAllocationProperties(rootDeviceIndex, 10 * MemoryConstants::pageSize, true))); ASSERT_NE(allocation->getBO(), nullptr); @@ -603,10 +603,10 @@ TEST_F(DrmMemoryManagerTest, whenPeekInternalHandleWithHandleIdIsCalledThenBoIsR } TEST_F(DrmMemoryManagerTest, whenCallingPeekInternalHandleWithIdSeveralTimesThenSameHandleIsReturned) { - mock->ioctl_expected.gemUserptr = 1; - mock->ioctl_expected.gemWait = 1; - mock->ioctl_expected.gemClose = 1; - mock->ioctl_expected.handleToPrimeFd = 1; + mock->ioctlExpected.gemUserptr = 1; + mock->ioctlExpected.gemWait = 1; + mock->ioctlExpected.gemClose = 1; + mock->ioctlExpected.handleToPrimeFd = 1; uint64_t expectedFd = 1337; mock->outputFd = static_cast(expectedFd); mock->incrementOutputFdAfterCall = true; @@ -635,10 +635,10 @@ TEST_F(DrmMemoryManagerTest, whenCallingPeekInternalHandleWithIdSeveralTimesThen } TEST_F(DrmMemoryManagerTest, givenDrmContextIdWhenAllocationIsCreatedThenPinWithPassedDrmContextId) { - mock->ioctl_expected.gemUserptr = 2; - mock->ioctl_expected.execbuffer2 = 1; - mock->ioctl_expected.gemWait = 1; - mock->ioctl_expected.gemClose = 2; + mock->ioctlExpected.gemUserptr = 2; + mock->ioctlExpected.execbuffer2 = 1; + mock->ioctlExpected.gemWait = 1; + mock->ioctlExpected.gemClose = 2; auto memoryManager = std::make_unique(false, true, false, *executionEnvironment); memoryManager->registeredEngines = EngineControlContainer{this->device->allEngines}; @@ -656,9 +656,9 @@ TEST_F(DrmMemoryManagerTest, givenDrmContextIdWhenAllocationIsCreatedThenPinWith } TEST_F(DrmMemoryManagerTest, WhenAskedAndAllowedButSmallAllocationThenDoNotPinAfterAllocate) { - mock->ioctl_expected.gemUserptr = 2; - mock->ioctl_expected.gemWait = 1; - mock->ioctl_expected.gemClose = 2; + mock->ioctlExpected.gemUserptr = 2; + mock->ioctlExpected.gemWait = 1; + mock->ioctlExpected.gemClose = 2; auto memoryManager = std::make_unique(false, true, false, *executionEnvironment); ASSERT_NE(nullptr, memoryManager->pinBBs[rootDeviceIndex]); @@ -672,9 +672,9 @@ TEST_F(DrmMemoryManagerTest, WhenAskedAndAllowedButSmallAllocationThenDoNotPinAf } TEST_F(DrmMemoryManagerTest, WhenNotAskedButAllowedThenDoNotPinAfterAllocate) { - mock->ioctl_expected.gemUserptr = 2; - mock->ioctl_expected.gemClose = 2; - mock->ioctl_expected.gemWait = 1; + mock->ioctlExpected.gemUserptr = 2; + mock->ioctlExpected.gemClose = 2; + mock->ioctlExpected.gemWait = 1; auto memoryManager = std::make_unique(false, true, false, *executionEnvironment); memoryManager->registeredEngines = EngineControlContainer{this->device->allEngines}; @@ -691,9 +691,9 @@ TEST_F(DrmMemoryManagerTest, WhenNotAskedButAllowedThenDoNotPinAfterAllocate) { } TEST_F(DrmMemoryManagerTest, WhenAskedButNotAllowedThenDoNotPinAfterAllocate) { - mock->ioctl_expected.gemUserptr = 1; - mock->ioctl_expected.gemWait = 1; - mock->ioctl_expected.gemClose = 1; + mock->ioctlExpected.gemUserptr = 1; + mock->ioctlExpected.gemWait = 1; + mock->ioctlExpected.gemClose = 1; auto memoryManager = std::make_unique(false, false, false, *executionEnvironment); memoryManager->registeredEngines = EngineControlContainer{this->device->allEngines}; @@ -710,10 +710,10 @@ TEST_F(DrmMemoryManagerTest, WhenAskedButNotAllowedThenDoNotPinAfterAllocate) { // ---- HostPtr TEST_F(DrmMemoryManagerTest, WhenAskedAndAllowedAndBigAllocationHostPtrThenPinAfterAllocate) { - mock->ioctl_expected.gemUserptr = 2; - mock->ioctl_expected.gemClose = 2; - mock->ioctl_expected.execbuffer2 = 1; - mock->ioctl_expected.gemWait = 1; + mock->ioctlExpected.gemUserptr = 2; + mock->ioctlExpected.gemClose = 2; + mock->ioctlExpected.execbuffer2 = 1; + mock->ioctlExpected.gemWait = 1; auto memoryManager = std::make_unique(false, true, false, *executionEnvironment); memoryManager->registeredEngines = EngineControlContainer{this->device->allEngines}; @@ -734,9 +734,9 @@ TEST_F(DrmMemoryManagerTest, WhenAskedAndAllowedAndBigAllocationHostPtrThenPinAf } TEST_F(DrmMemoryManagerTest, givenSmallAllocationHostPtrAllocationWhenForcePinIsTrueThenBufferObjectIsNotPinned) { - mock->ioctl_expected.gemUserptr = 2; - mock->ioctl_expected.gemWait = 1; - mock->ioctl_expected.gemClose = 2; + mock->ioctlExpected.gemUserptr = 2; + mock->ioctlExpected.gemWait = 1; + mock->ioctlExpected.gemClose = 2; auto memoryManager = std::make_unique(false, true, false, *executionEnvironment); memoryManager->registeredEngines = EngineControlContainer{this->device->allEngines}; @@ -759,9 +759,9 @@ TEST_F(DrmMemoryManagerTest, givenSmallAllocationHostPtrAllocationWhenForcePinIs } TEST_F(DrmMemoryManagerTest, WhenNotAskedButAllowedHostPtrThendoNotPinAfterAllocate) { - mock->ioctl_expected.gemUserptr = 2; - mock->ioctl_expected.gemWait = 1; - mock->ioctl_expected.gemClose = 2; + mock->ioctlExpected.gemUserptr = 2; + mock->ioctlExpected.gemWait = 1; + mock->ioctlExpected.gemClose = 2; auto memoryManager = std::make_unique(false, true, false, *executionEnvironment); ASSERT_NE(nullptr, memoryManager->pinBBs[rootDeviceIndex]); @@ -778,9 +778,9 @@ TEST_F(DrmMemoryManagerTest, WhenNotAskedButAllowedHostPtrThendoNotPinAfterAlloc } TEST_F(DrmMemoryManagerTest, WhenAskedButNotAllowedHostPtrThenDoNotPinAfterAllocate) { - mock->ioctl_expected.gemUserptr = 1; - mock->ioctl_expected.gemWait = 1; - mock->ioctl_expected.gemClose = 1; + mock->ioctlExpected.gemUserptr = 1; + mock->ioctlExpected.gemWait = 1; + mock->ioctlExpected.gemClose = 1; auto memoryManager = std::make_unique(false, false, false, *executionEnvironment); @@ -797,8 +797,8 @@ TEST_F(DrmMemoryManagerTest, WhenAskedButNotAllowedHostPtrThenDoNotPinAfterAlloc } TEST_F(DrmMemoryManagerTest, WhenUnreferenceIsCalledThenCallSucceeds) { - mock->ioctl_expected.gemUserptr = 1; - mock->ioctl_expected.gemClose = 1; + mock->ioctlExpected.gemUserptr = 1; + mock->ioctlExpected.gemClose = 1; BufferObject *bo = memoryManager->allocUserptr(0, (size_t)1024, rootDeviceIndex); ASSERT_NE(nullptr, bo); memoryManager->unreference(bo, false); @@ -808,8 +808,8 @@ TEST_F(DrmMemoryManagerTest, whenPrintBOCreateDestroyResultIsSetAndAllocUserptrI DebugManagerStateRestore stateRestore; DebugManager.flags.PrintBOCreateDestroyResult.set(true); - mock->ioctl_expected.gemUserptr = 1; - mock->ioctl_expected.gemClose = 1; + mock->ioctlExpected.gemUserptr = 1; + mock->ioctlExpected.gemClose = 1; testing::internal::CaptureStdout(); BufferObject *bo = memoryManager->allocUserptr(0, (size_t)1024, rootDeviceIndex); @@ -839,9 +839,9 @@ TEST_F(DrmMemoryManagerWithExplicitExpectationsTest, givenDrmMemoryManagerCreate } TEST_F(DrmMemoryManagerTest, GivenAllocationWhenClosingSharedHandleThenSucceeds) { - mock->ioctl_expected.primeFdToHandle = 1; - mock->ioctl_expected.gemWait = 1; - mock->ioctl_expected.gemClose = 1; + mock->ioctlExpected.primeFdToHandle = 1; + mock->ioctlExpected.gemWait = 1; + mock->ioctlExpected.gemClose = 1; osHandle handle = 1u; this->mock->outputHandle = 2u; @@ -865,9 +865,9 @@ TEST_F(DrmMemoryManagerTest, GivenNullptrDrmAllocationWhenTryingToRegisterItThen } TEST_F(DrmMemoryManagerTest, GivenAllocationWhenTryingToRegisterIpcExportedThenItsBoIsMarkedAsSharedHandleAndHandleIsStored) { - mock->ioctl_expected.gemUserptr = 1; - mock->ioctl_expected.gemWait = 1; - mock->ioctl_expected.gemClose = 1; + mock->ioctlExpected.gemUserptr = 1; + mock->ioctlExpected.gemWait = 1; + mock->ioctlExpected.gemClose = 1; ASSERT_TRUE(memoryManager->sharedBoHandles.empty()); @@ -918,10 +918,10 @@ TEST_F(DrmMemoryManagerTest, GivenWrapperInBoHandlesContainerWhenTryingToGetShar } TEST_F(DrmMemoryManagerTest, GivenDeviceSharedAllocationWhichRequiresHostMapThenCorrectAlignmentReturned) { - mock->ioctl_expected.primeFdToHandle = 1; - mock->ioctl_expected.gemWait = 1; - mock->ioctl_expected.gemClose = 1; - mock->ioctl_expected.gemMmapOffset = 1; + mock->ioctlExpected.primeFdToHandle = 1; + mock->ioctlExpected.gemWait = 1; + mock->ioctlExpected.gemClose = 1; + mock->ioctlExpected.gemMmapOffset = 1; osHandle handle = 1u; this->mock->outputHandle = 2u; @@ -944,9 +944,9 @@ TEST_F(DrmMemoryManagerTest, GivenDeviceSharedAllocationWhichRequiresHostMapThen } TEST_F(DrmMemoryManagerTest, GivenAllocationWhenFreeingThenSucceeds) { - mock->ioctl_expected.gemUserptr = 1; - mock->ioctl_expected.gemWait = 1; - mock->ioctl_expected.gemClose = 1; + mock->ioctlExpected.gemUserptr = 1; + mock->ioctlExpected.gemWait = 1; + mock->ioctlExpected.gemClose = 1; auto alloc = static_cast(memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{rootDeviceIndex, MemoryConstants::pageSize})); ASSERT_NE(nullptr, alloc); @@ -957,7 +957,7 @@ TEST_F(DrmMemoryManagerTest, GivenAllocationWhenFreeingThenSucceeds) { } TEST_F(DrmMemoryManagerTest, GivenInjectedFailureWhenAllocatingThenAllocationFails) { - mock->ioctl_expected.total = -1; // don't care + mock->ioctlExpected.total = -1; // don't care InjectedFunction method = [this](size_t failureIndex) { auto ptr = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{rootDeviceIndex, MemoryConstants::pageSize}); @@ -973,9 +973,9 @@ TEST_F(DrmMemoryManagerTest, GivenInjectedFailureWhenAllocatingThenAllocationFai } TEST_F(DrmMemoryManagerTest, GivenZeroBytesWhenAllocatingThenAllocationIsCreated) { - mock->ioctl_expected.gemUserptr = 1; - mock->ioctl_expected.gemWait = 1; - mock->ioctl_expected.gemClose = 1; + mock->ioctlExpected.gemUserptr = 1; + mock->ioctlExpected.gemWait = 1; + mock->ioctlExpected.gemClose = 1; auto ptr = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{rootDeviceIndex, 0u}); ASSERT_NE(nullptr, ptr); @@ -985,9 +985,9 @@ TEST_F(DrmMemoryManagerTest, GivenZeroBytesWhenAllocatingThenAllocationIsCreated } TEST_F(DrmMemoryManagerTest, GivenThreeBytesWhenAllocatingThenAllocationIsCreated) { - mock->ioctl_expected.gemUserptr = 1; - mock->ioctl_expected.gemWait = 1; - mock->ioctl_expected.gemClose = 1; + mock->ioctlExpected.gemUserptr = 1; + mock->ioctlExpected.gemWait = 1; + mock->ioctlExpected.gemClose = 1; auto ptr = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{rootDeviceIndex, MemoryConstants::pageSize}); ASSERT_NE(nullptr, ptr); @@ -997,12 +997,12 @@ TEST_F(DrmMemoryManagerTest, GivenThreeBytesWhenAllocatingThenAllocationIsCreate } TEST_F(DrmMemoryManagerTest, GivenUserptrWhenCreatingAllocationThenFail) { - mock->ioctl_expected.gemUserptr = 1; - mock->ioctl_res = -1; + mock->ioctlExpected.gemUserptr = 1; + mock->ioctlRes = -1; auto ptr = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{rootDeviceIndex, MemoryConstants::pageSize}); EXPECT_EQ(nullptr, ptr); - mock->ioctl_res = 0; + mock->ioctlRes = 0; } TEST_F(DrmMemoryManagerTest, GivenNullPtrWhenFreeingThenSucceeds) { @@ -1010,9 +1010,9 @@ TEST_F(DrmMemoryManagerTest, GivenNullPtrWhenFreeingThenSucceeds) { } TEST_F(DrmMemoryManagerTest, GivenHostPtrWhenCreatingAllocationThenSucceeds) { - mock->ioctl_expected.gemUserptr = 1; - mock->ioctl_expected.gemWait = 1; - mock->ioctl_expected.gemClose = 1; + mock->ioctlExpected.gemUserptr = 1; + mock->ioctlExpected.gemWait = 1; + mock->ioctlExpected.gemClose = 1; void *ptr = ::alignedMalloc(1024, 4096); ASSERT_NE(nullptr, ptr); @@ -1031,9 +1031,9 @@ TEST_F(DrmMemoryManagerTest, GivenHostPtrWhenCreatingAllocationThenSucceeds) { } TEST_F(DrmMemoryManagerTest, GivenNullHostPtrWhenCreatingAllocationThenSucceeds) { - mock->ioctl_expected.gemUserptr = 1; - mock->ioctl_expected.gemWait = 1; - mock->ioctl_expected.gemClose = 1; + mock->ioctlExpected.gemUserptr = 1; + mock->ioctlExpected.gemWait = 1; + mock->ioctlExpected.gemClose = 1; void *ptr = nullptr; @@ -1052,9 +1052,9 @@ TEST_F(DrmMemoryManagerTest, GivenNullHostPtrWhenCreatingAllocationThenSucceeds) } TEST_F(DrmMemoryManagerTest, GivenMisalignedHostPtrWhenCreatingAllocationThenSucceeds) { - mock->ioctl_expected.gemUserptr = 1; - mock->ioctl_expected.gemWait = 1; - mock->ioctl_expected.gemClose = 1; + mock->ioctlExpected.gemUserptr = 1; + mock->ioctlExpected.gemWait = 1; + mock->ioctlExpected.gemClose = 1; void *ptrT = ::alignedMalloc(1024, 4096); ASSERT_NE(nullptr, ptrT); @@ -1075,8 +1075,8 @@ TEST_F(DrmMemoryManagerTest, GivenMisalignedHostPtrWhenCreatingAllocationThenSuc } TEST_F(DrmMemoryManagerTest, GivenHostPtrUserptrWhenCreatingAllocationThenFails) { - mock->ioctl_expected.gemUserptr = 1; - mock->ioctl_res = -1; + mock->ioctlExpected.gemUserptr = 1; + mock->ioctlRes = -1; void *ptrT = ::alignedMalloc(1024, 4096); ASSERT_NE(nullptr, ptrT); @@ -1085,20 +1085,20 @@ TEST_F(DrmMemoryManagerTest, GivenHostPtrUserptrWhenCreatingAllocationThenFails) EXPECT_EQ(nullptr, alloc); ::alignedFree(ptrT); - mock->ioctl_res = 0; + mock->ioctlRes = 0; } TEST_F(DrmMemoryManagerTest, givenDrmAllocationWhenHandleFenceCompletionThenCallBufferObjectWait) { - mock->ioctl_expected.gemUserptr = 1; - mock->ioctl_expected.gemWait = 1; - mock->ioctl_expected.contextDestroy = 0; + mock->ioctlExpected.gemUserptr = 1; + mock->ioctlExpected.gemWait = 1; + mock->ioctlExpected.contextDestroy = 0; auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{rootDeviceIndex, 1024}); memoryManager->handleFenceCompletion(allocation); mock->testIoctls(); - mock->ioctl_expected.gemClose = 1; - mock->ioctl_expected.gemWait = 2; + mock->ioctlExpected.gemClose = 1; + mock->ioctlExpected.gemWait = 2; memoryManager->freeGraphicsMemory(allocation); } @@ -1119,7 +1119,7 @@ TEST(DrmMemoryManagerTest2, givenDrmMemoryManagerWhengetSystemSharedMemoryIsCall mock->getContextParamRetValue = 16 * MemoryConstants::gigaByte; uint64_t mem = memoryManager->getSystemSharedMemory(i); - mock->ioctl_expected.contextGetParam = 1; + mock->ioctlExpected.contextGetParam = 1; EXPECT_EQ(mock->recordedGetContextParam.param, static_cast<__u64>(I915_CONTEXT_PARAM_GTT_SIZE)); EXPECT_GT(mem, 0u); @@ -1156,21 +1156,21 @@ TEST(DrmMemoryManagerTest2, WhenGetMinimumSystemSharedMemoryThenCorrectValueIsRe // gpuMemSize < hostMemSize auto gpuMemorySize = hostMemorySize - 1u; - mock->ioctl_expected.contextGetParam = 1; + mock->ioctlExpected.contextGetParam = 1; mock->getContextParamRetValue = gpuMemorySize; uint64_t systemSharedMemorySize = memoryManager->getSystemSharedMemory(i); EXPECT_EQ(gpuMemorySize, systemSharedMemorySize); - mock->ioctl_expected.contextDestroy = 0; - mock->ioctl_expected.contextCreate = 0; + mock->ioctlExpected.contextDestroy = 0; + mock->ioctlExpected.contextCreate = 0; mock->testIoctls(); // gpuMemSize > hostMemSize gpuMemorySize = hostMemorySize + 1u; mock->getContextParamRetValue = gpuMemorySize; systemSharedMemorySize = memoryManager->getSystemSharedMemory(i); - mock->ioctl_expected.contextGetParam = 2; + mock->ioctlExpected.contextGetParam = 2; EXPECT_EQ(hostMemorySize, systemSharedMemorySize); mock->testIoctls(); @@ -1179,24 +1179,24 @@ TEST(DrmMemoryManagerTest2, WhenGetMinimumSystemSharedMemoryThenCorrectValueIsRe } TEST_F(DrmMemoryManagerTest, GivenBoWaitFailureThenExpectThrow) { - mock->ioctl_expected.gemUserptr = 1; - mock->ioctl_expected.gemWait = 1; - mock->ioctl_expected.gemClose = 1; + mock->ioctlExpected.gemUserptr = 1; + mock->ioctlExpected.gemWait = 1; + mock->ioctlExpected.gemClose = 1; BufferObject *bo = memoryManager->allocUserptr(0, (size_t)1024, rootDeviceIndex); ASSERT_NE(nullptr, bo); - mock->ioctl_res = -EIO; + mock->ioctlRes = -EIO; EXPECT_THROW(bo->wait(-1), std::exception); - mock->ioctl_res = 1; + mock->ioctlRes = 1; memoryManager->unreference(bo, false); - mock->ioctl_res = 0; + mock->ioctlRes = 0; } TEST_F(DrmMemoryManagerTest, WhenNullOsHandleStorageAskedForPopulationThenFilledPointerIsReturned) { - mock->ioctl_expected.gemUserptr = 1; - mock->ioctl_expected.gemWait = 1; - mock->ioctl_expected.gemClose = 1; + mock->ioctlExpected.gemUserptr = 1; + mock->ioctlExpected.gemWait = 1; + mock->ioctlExpected.gemClose = 1; OsHandleStorage storage; storage.fragmentStorageData[0].cpuPtr = reinterpret_cast(0x1000); @@ -1228,10 +1228,10 @@ TEST_F(DrmMemoryManagerWithExplicitExpectationsTest, givenEnabledHostMemoryValid DrmMockCustom::IoctlResExt ioctlResExt = {1, -1}; ioctlResExt.no.push_back(2); ioctlResExt.no.push_back(3); - mock->ioctl_res_ext = &ioctlResExt; + mock->ioctlResExt = &ioctlResExt; mock->errnoValue = EFAULT; - mock->ioctl_expected.gemUserptr = 1; - mock->ioctl_expected.execbuffer2 = 3; + mock->ioctlExpected.gemUserptr = 1; + mock->ioctlExpected.execbuffer2 = 3; MemoryManager::AllocationStatus result = memoryManager->populateOsHandles(storage, rootDeviceIndex); @@ -1244,7 +1244,7 @@ TEST_F(DrmMemoryManagerWithExplicitExpectationsTest, givenEnabledHostMemoryValid storage.fragmentStorageData[0].freeTheFragment = true; memoryManager->cleanOsHandles(storage, rootDeviceIndex); - mock->ioctl_res_ext = &mock->NONE; + mock->ioctlResExt = &mock->none; } TEST_F(DrmMemoryManagerWithExplicitExpectationsTest, givenEnabledHostMemoryValidationWhenReadOnlyPointerCausesPinningFailWithEfaultThenAlocateMemoryForNonSvmHostPtrReturnsNullptr) { @@ -1264,11 +1264,11 @@ TEST_F(DrmMemoryManagerWithExplicitExpectationsTest, givenEnabledHostMemoryValid DrmMockCustom::IoctlResExt ioctlResExt = {1, -1}; ioctlResExt.no.push_back(2); ioctlResExt.no.push_back(3); - mock->ioctl_res_ext = &ioctlResExt; + mock->ioctlResExt = &ioctlResExt; mock->errnoValue = EFAULT; - mock->ioctl_expected.gemUserptr = 1; - mock->ioctl_expected.execbuffer2 = 3; - mock->ioctl_expected.gemClose = 1; + mock->ioctlExpected.gemUserptr = 1; + mock->ioctlExpected.execbuffer2 = 3; + mock->ioctlExpected.gemClose = 1; AllocationData allocationData; allocationData.size = dummySize; @@ -1284,7 +1284,7 @@ TEST_F(DrmMemoryManagerWithExplicitExpectationsTest, givenEnabledHostMemoryValid EXPECT_EQ(nullptr, allocation); mock->testIoctls(); - mock->ioctl_res_ext = &mock->NONE; + mock->ioctlResExt = &mock->none; // make sure that partition is free size_t dummySize2 = 13u; @@ -1309,10 +1309,10 @@ TEST_F(DrmMemoryManagerWithExplicitExpectationsTest, givenEnabledHostMemoryValid DrmMockCustom::IoctlResExt ioctlResExt = {1, -1}; ioctlResExt.no.push_back(2); ioctlResExt.no.push_back(3); - mock->ioctl_res_ext = &ioctlResExt; + mock->ioctlResExt = &ioctlResExt; mock->errnoValue = 0; - mock->ioctl_expected.gemUserptr = 1; - mock->ioctl_expected.execbuffer2 = 3; + mock->ioctlExpected.gemUserptr = 1; + mock->ioctlExpected.execbuffer2 = 3; AllocationData allocationData; allocationData.size = 13u; @@ -1324,7 +1324,7 @@ TEST_F(DrmMemoryManagerWithExplicitExpectationsTest, givenEnabledHostMemoryValid EXPECT_NE(nullptr, allocation); mock->testIoctls(); - mock->ioctl_res_ext = &mock->NONE; + mock->ioctlResExt = &mock->none; memoryManager->freeGraphicsMemory(allocation); } @@ -1345,10 +1345,10 @@ TEST_F(DrmMemoryManagerWithExplicitExpectationsTest, givenEnabledHostMemoryValid DrmMockCustom::IoctlResExt ioctlResExt = {1, -1}; ioctlResExt.no.push_back(2); ioctlResExt.no.push_back(3); - mock->ioctl_res_ext = &ioctlResExt; + mock->ioctlResExt = &ioctlResExt; mock->errnoValue = 0; - mock->ioctl_expected.gemUserptr = 1; - mock->ioctl_expected.execbuffer2 = 3; + mock->ioctlExpected.gemUserptr = 1; + mock->ioctlExpected.execbuffer2 = 3; AllocationData allocationData; allocationData.size = 13u; @@ -1361,7 +1361,7 @@ TEST_F(DrmMemoryManagerWithExplicitExpectationsTest, givenEnabledHostMemoryValid EXPECT_EQ(allocation->getGpuAddress() - allocation->getAllocationOffset(), mock->execBufferBufferObjects.getOffset()); mock->testIoctls(); - mock->ioctl_res_ext = &mock->NONE; + mock->ioctlResExt = &mock->none; memoryManager->freeGraphicsMemory(allocation); } @@ -1384,10 +1384,10 @@ TEST_F(DrmMemoryManagerWithExplicitExpectationsTest, givenEnabledHostMemoryValid DrmMockCustom::IoctlResExt ioctlResExt = {1, -1}; ioctlResExt.no.push_back(2); ioctlResExt.no.push_back(3); - mock->ioctl_res_ext = &ioctlResExt; + mock->ioctlResExt = &ioctlResExt; mock->errnoValue = ENOMEM; - mock->ioctl_expected.gemUserptr = 1; - mock->ioctl_expected.execbuffer2 = 3; + mock->ioctlExpected.gemUserptr = 1; + mock->ioctlExpected.execbuffer2 = 3; MemoryManager::AllocationStatus result = memoryManager->populateOsHandles(storage, rootDeviceIndex); @@ -1400,7 +1400,7 @@ TEST_F(DrmMemoryManagerWithExplicitExpectationsTest, givenEnabledHostMemoryValid storage.fragmentStorageData[0].freeTheFragment = true; memoryManager->cleanOsHandles(storage, rootDeviceIndex); - mock->ioctl_res_ext = &mock->NONE; + mock->ioctlResExt = &mock->none; } TEST_F(DrmMemoryManagerTest, GivenNoInputsWhenOsHandleIsCreatedThenAllBoHandlesAreInitializedAsNullPtrs) { @@ -1472,9 +1472,9 @@ TEST_F(DrmMemoryManagerTest, givenRequiresStandard2MBHeapThenStandard2MBHeapIsAc } TEST_F(DrmMemoryManagerTest, GivenShareableEnabledWhenAskedToCreateGraphicsAllocationThenValidAllocationIsReturnedAndStandard64KBHeapIsUsed) { - mock->ioctl_expected.gemWait = 1; - mock->ioctl_expected.gemCreate = 1; - mock->ioctl_expected.gemClose = 1; + mock->ioctlExpected.gemWait = 1; + mock->ioctlExpected.gemCreate = 1; + mock->ioctlExpected.gemClose = 1; allocationData.size = MemoryConstants::pageSize; allocationData.flags.shareable = true; @@ -1490,9 +1490,9 @@ TEST_F(DrmMemoryManagerTest, GivenShareableEnabledWhenAskedToCreateGraphicsAlloc } TEST_F(DrmMemoryManagerTest, GivenMisalignedHostPtrAndMultiplePagesSizeWhenAskedForGraphicsAllocationThenItContainsAllFragmentsWithProperGpuAdrresses) { - mock->ioctl_expected.gemUserptr = 3; - mock->ioctl_expected.gemWait = 3; - mock->ioctl_expected.gemClose = 3; + mock->ioctlExpected.gemUserptr = 3; + mock->ioctlExpected.gemWait = 3; + mock->ioctlExpected.gemClose = 3; auto ptr = reinterpret_cast(0x1001); auto size = MemoryConstants::pageSize * 10; @@ -1516,9 +1516,9 @@ TEST_F(DrmMemoryManagerTest, GivenMisalignedHostPtrAndMultiplePagesSizeWhenAsked } TEST_F(DrmMemoryManagerTest, givenMemoryManagerWhenAskedFor32BitAllocationThen32BitDrmAllocationIsBeingReturned) { - mock->ioctl_expected.gemUserptr = 1; - mock->ioctl_expected.gemWait = 1; - mock->ioctl_expected.gemClose = 1; + mock->ioctlExpected.gemUserptr = 1; + mock->ioctlExpected.gemWait = 1; + mock->ioctlExpected.gemClose = 1; auto size = 10u; memoryManager->setForce32BitAllocations(true); @@ -1538,9 +1538,9 @@ TEST_F(DrmMemoryManagerTest, givenMemoryManagerWhenAskedFor32BitAllocationThen32 } TEST_F(DrmMemoryManagerTest, givenMemoryManagerWhenAskedFor32BitAllocationWhenLimitedAllocationEnabledThen32BitDrmAllocationWithGpuAddrDifferentFromCpuAddrIsBeingReturned) { - mock->ioctl_expected.gemUserptr = 1; - mock->ioctl_expected.gemWait = 1; - mock->ioctl_expected.gemClose = 1; + mock->ioctlExpected.gemUserptr = 1; + mock->ioctlExpected.gemWait = 1; + mock->ioctlExpected.gemClose = 1; memoryManager->forceLimitedRangeAllocator(0xFFFFFFFFF); @@ -1571,8 +1571,8 @@ TEST_F(DrmMemoryManagerTest, givenMemoryManagerWhenLimitedRangeAllocatorSetThenH } TEST_F(DrmMemoryManagerTest, givenMemoryManagerWhenAskedForAllocationWithAlignmentAndLimitedRangeAllocatorSetAndAcquireGpuRangeFailsThenNullIsReturned) { - mock->ioctl_expected.gemUserptr = 0; - mock->ioctl_expected.gemClose = 0; + mock->ioctlExpected.gemUserptr = 0; + mock->ioctlExpected.gemClose = 0; AllocationData allocationData; @@ -1587,10 +1587,10 @@ TEST_F(DrmMemoryManagerTest, givenMemoryManagerWhenAskedForAllocationWithAlignme } TEST_F(DrmMemoryManagerTest, givenMemoryManagerWhenAskedFor32BitAllocationWithHostPtrAndAllocUserptrFailsThenFails) { - mock->ioctl_expected.gemUserptr = 1; + mock->ioctlExpected.gemUserptr = 1; - this->ioctlResExt = {mock->ioctl_cnt.total, -1}; - mock->ioctl_res_ext = &ioctlResExt; + this->ioctlResExt = {mock->ioctlCnt.total, -1}; + mock->ioctlResExt = &ioctlResExt; auto size = 10u; void *hostPtr = reinterpret_cast(0x1000); @@ -1598,35 +1598,35 @@ TEST_F(DrmMemoryManagerTest, givenMemoryManagerWhenAskedFor32BitAllocationWithHo auto allocation = memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, size, hostPtr, AllocationType::BUFFER); EXPECT_EQ(nullptr, allocation); - mock->ioctl_res_ext = &mock->NONE; + mock->ioctlResExt = &mock->none; } TEST_F(DrmMemoryManagerTest, givenMemoryManagerWhenAskedFor32BitAllocationAndAllocUserptrFailsThenFails) { - mock->ioctl_expected.gemUserptr = 1; + mock->ioctlExpected.gemUserptr = 1; - this->ioctlResExt = {mock->ioctl_cnt.total, -1}; - mock->ioctl_res_ext = &ioctlResExt; + this->ioctlResExt = {mock->ioctlCnt.total, -1}; + mock->ioctlResExt = &ioctlResExt; auto size = 10u; memoryManager->setForce32BitAllocations(true); auto allocation = memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, size, nullptr, AllocationType::BUFFER); EXPECT_EQ(nullptr, allocation); - mock->ioctl_res_ext = &mock->NONE; + mock->ioctlResExt = &mock->none; } TEST_F(DrmMemoryManagerTest, givenLimitedRangeAllocatorWhenAskedForInternal32BitAllocationAndAllocUserptrFailsThenFails) { - mock->ioctl_expected.gemUserptr = 1; + mock->ioctlExpected.gemUserptr = 1; - this->ioctlResExt = {mock->ioctl_cnt.total, -1}; - mock->ioctl_res_ext = &ioctlResExt; + this->ioctlResExt = {mock->ioctlCnt.total, -1}; + mock->ioctlResExt = &ioctlResExt; auto size = 10u; memoryManager->forceLimitedRangeAllocator(0xFFFFFFFFF); auto allocation = memoryManager->allocate32BitGraphicsMemory(rootDeviceIndex, size, nullptr, AllocationType::INTERNAL_HEAP); EXPECT_EQ(nullptr, allocation); - mock->ioctl_res_ext = &mock->NONE; + mock->ioctlResExt = &mock->none; } TEST_F(DrmMemoryManagerTest, GivenExhaustedInternalHeapWhenAllocate32BitIsCalledThenNullIsReturned) { @@ -1655,10 +1655,10 @@ TEST_F(DrmMemoryManagerTest, whenGetUserptrAlignmentThenDefaultValueIsReturned) } TEST_F(DrmMemoryManagerTest, GivenMemoryManagerWhenAllocateGraphicsMemoryForImageIsCalledThenProperIoctlsAreCalledAndUnmapSizeIsNonZero) { - mock->ioctl_expected.gemCreate = 1; - mock->ioctl_expected.gemSetTiling = 1; - mock->ioctl_expected.gemWait = 1; - mock->ioctl_expected.gemClose = 1; + mock->ioctlExpected.gemCreate = 1; + mock->ioctlExpected.gemSetTiling = 1; + mock->ioctlExpected.gemWait = 1; + mock->ioctlExpected.gemClose = 1; ImageDescriptor imgDesc = {}; imgDesc.imageType = ImageType::Image2D; // tiled @@ -1693,9 +1693,9 @@ TEST_F(DrmMemoryManagerTest, GivenMemoryManagerWhenAllocateGraphicsMemoryForImag } TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerAndOsHandleWhenCreateIsCalledThenGraphicsAllocationIsReturned) { - mock->ioctl_expected.primeFdToHandle = 1; - mock->ioctl_expected.gemWait = 1; - mock->ioctl_expected.gemClose = 1; + mock->ioctlExpected.primeFdToHandle = 1; + mock->ioctlExpected.gemWait = 1; + mock->ioctlExpected.gemClose = 1; osHandle handle = 1u; this->mock->outputHandle = 2u; @@ -1723,9 +1723,9 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerAndOsHandleWhenCreateIsCalledT } TEST_F(DrmMemoryManagerWithLocalMemoryTest, givenDrmMemoryManagerWithLocalMemoryWhenCreateGraphicsAllocationFromSharedHandleIsCalledThenAcquireGpuAddressFromExpectedHeap) { - mock->ioctl_expected.primeFdToHandle = 1; - mock->ioctl_expected.gemWait = 1; - mock->ioctl_expected.gemClose = 1; + mock->ioctlExpected.primeFdToHandle = 1; + mock->ioctlExpected.gemWait = 1; + mock->ioctlExpected.gemClose = 1; osHandle handle = 1u; this->mock->outputHandle = 2u; @@ -1763,9 +1763,9 @@ TEST_F(DrmMemoryManagerWithLocalMemoryTest, givenDrmMemoryManagerWithLocalMemory } TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerAndOsHandleWhenCreateIsCalledAndRootDeviceIndexIsSpecifiedThenGraphicsAllocationIsReturnedWithCorrectRootDeviceIndex) { - mock->ioctl_expected.primeFdToHandle = 1; - mock->ioctl_expected.gemWait = 1; - mock->ioctl_expected.gemClose = 1; + mock->ioctlExpected.primeFdToHandle = 1; + mock->ioctlExpected.gemWait = 1; + mock->ioctlExpected.gemClose = 1; osHandle handle = 1u; this->mock->outputHandle = 2u; @@ -1814,9 +1814,9 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerAndOsHandleWhenAllocationFails } TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerAndThreeOsHandlesWhenReuseCreatesAreCalledThenGraphicsAllocationsAreReturned) { - mock->ioctl_expected.primeFdToHandle = 3; - mock->ioctl_expected.gemWait = 3; - mock->ioctl_expected.gemClose = 2; + mock->ioctlExpected.primeFdToHandle = 3; + mock->ioctlExpected.gemWait = 3; + mock->ioctlExpected.gemClose = 2; osHandle handles[] = {1u, 2u, 3u}; size_t size = 4096u; @@ -1865,9 +1865,9 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerAndThreeOsHandlesWhenReuseCrea } TEST_F(DrmMemoryManagerTest, given32BitAddressingWhenBufferFromSharedHandleAndBitnessRequiredIsCreatedThenItis32BitAllocation) { - mock->ioctl_expected.primeFdToHandle = 1; - mock->ioctl_expected.gemWait = 1; - mock->ioctl_expected.gemClose = 1; + mock->ioctlExpected.primeFdToHandle = 1; + mock->ioctlExpected.gemWait = 1; + mock->ioctlExpected.gemClose = 1; memoryManager->setForce32BitAllocations(true); osHandle handle = 1u; @@ -1885,9 +1885,9 @@ TEST_F(DrmMemoryManagerTest, given32BitAddressingWhenBufferFromSharedHandleAndBi } TEST_F(DrmMemoryManagerTest, given32BitAddressingWhenBufferFromSharedHandleIsCreatedAndDoesntRequireBitnessThenItIsNot32BitAllocation) { - mock->ioctl_expected.primeFdToHandle = 1; - mock->ioctl_expected.gemWait = 1; - mock->ioctl_expected.gemClose = 1; + mock->ioctlExpected.primeFdToHandle = 1; + mock->ioctlExpected.gemWait = 1; + mock->ioctlExpected.gemClose = 1; memoryManager->setForce32BitAllocations(true); osHandle handle = 1u; @@ -1905,9 +1905,9 @@ TEST_F(DrmMemoryManagerTest, given32BitAddressingWhenBufferFromSharedHandleIsCre } TEST_F(DrmMemoryManagerTest, givenLimitedRangeAllocatorWhenBufferFromSharedHandleIsCreatedThenItIsLimitedRangeAllocation) { - mock->ioctl_expected.primeFdToHandle = 1; - mock->ioctl_expected.gemWait = 1; - mock->ioctl_expected.gemClose = 1; + mock->ioctlExpected.primeFdToHandle = 1; + mock->ioctlExpected.gemWait = 1; + mock->ioctlExpected.gemClose = 1; memoryManager->forceLimitedRangeAllocator(0xFFFFFFFFF); osHandle handle = 1u; @@ -1923,9 +1923,9 @@ TEST_F(DrmMemoryManagerTest, givenLimitedRangeAllocatorWhenBufferFromSharedHandl } TEST_F(DrmMemoryManagerTest, givenNon32BitAddressingWhenBufferFromSharedHandleIsCreatedAndDRequireBitnessThenItIsNot32BitAllocation) { - mock->ioctl_expected.primeFdToHandle = 1; - mock->ioctl_expected.gemWait = 1; - mock->ioctl_expected.gemClose = 1; + mock->ioctlExpected.primeFdToHandle = 1; + mock->ioctlExpected.gemWait = 1; + mock->ioctlExpected.gemClose = 1; memoryManager->setForce32BitAllocations(false); osHandle handle = 1u; @@ -1940,9 +1940,9 @@ TEST_F(DrmMemoryManagerTest, givenNon32BitAddressingWhenBufferFromSharedHandleIs } TEST_F(DrmMemoryManagerTest, givenSharedHandleWhenAllocationIsCreatedAndIoctlPrimeFdToHandleFailsThenNullPtrIsReturned) { - mock->ioctl_expected.primeFdToHandle = 1; - this->ioctlResExt = {mock->ioctl_cnt.total, -1}; - mock->ioctl_res_ext = &this->ioctlResExt; + mock->ioctlExpected.primeFdToHandle = 1; + this->ioctlResExt = {mock->ioctlCnt.total, -1}; + mock->ioctlResExt = &this->ioctlResExt; osHandle handle = 1u; this->mock->outputHandle = 2u; @@ -1954,9 +1954,9 @@ TEST_F(DrmMemoryManagerTest, givenSharedHandleWhenAllocationIsCreatedAndIoctlPri TEST_F(DrmMemoryManagerTest, givenTwoGraphicsAllocationsThatShareTheSameBufferObjectWhenTheyAreMadeResidentThenOnlyOneBoIsPassedToExec) { auto testedCsr = static_cast *>(device->getDefaultEngine().commandStreamReceiver); - mock->ioctl_expected.primeFdToHandle = 2; - mock->ioctl_expected.gemClose = 1; - mock->ioctl_expected.gemWait = 2; + mock->ioctlExpected.primeFdToHandle = 2; + mock->ioctlExpected.gemClose = 1; + mock->ioctlExpected.gemWait = 2; osHandle sharedHandle = 1u; AllocationProperties properties(rootDeviceIndex, false, MemoryConstants::pageSize, AllocationType::SHARED_BUFFER, false, mockDeviceBitfield); @@ -1980,9 +1980,9 @@ TEST_F(DrmMemoryManagerTest, givenTwoGraphicsAllocationsThatShareTheSameBufferOb TEST_F(DrmMemoryManagerTest, givenTwoGraphicsAllocationsThatDoesnShareTheSameBufferObjectWhenTheyAreMadeResidentThenTwoBoIsPassedToExec) { auto testedCsr = static_cast *>(device->getDefaultEngine().commandStreamReceiver); - mock->ioctl_expected.primeFdToHandle = 2; - mock->ioctl_expected.gemClose = 2; - mock->ioctl_expected.gemWait = 2; + mock->ioctlExpected.primeFdToHandle = 2; + mock->ioctlExpected.gemClose = 2; + mock->ioctlExpected.gemWait = 2; osHandle sharedHandle = 1u; AllocationProperties properties(rootDeviceIndex, false, MemoryConstants::pageSize, AllocationType::SHARED_BUFFER, false, {}); @@ -2010,10 +2010,10 @@ TEST_F(DrmMemoryManagerWithExplicitExpectationsTest, givenDrmMemoryManagerWhenCr } TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenLockUnlockIsCalledThenReturnPtr) { - mock->ioctl_expected.gemUserptr = 1; - mock->ioctl_expected.gemSetDomain = 1; - mock->ioctl_expected.gemWait = 1; - mock->ioctl_expected.gemClose = 1; + mock->ioctlExpected.gemUserptr = 1; + mock->ioctlExpected.gemSetDomain = 1; + mock->ioctlExpected.gemWait = 1; + mock->ioctlExpected.gemClose = 1; auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{rootDeviceIndex, MemoryConstants::pageSize}); ASSERT_NE(nullptr, allocation); @@ -2026,10 +2026,10 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenLockUnlockIsCalledThenRetu } TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenLockUnlockIsCalledOnAllocationWithCpuPtrThenReturnCpuPtrAndSetCpuDomain) { - mock->ioctl_expected.gemUserptr = 1; - mock->ioctl_expected.gemSetDomain = 1; - mock->ioctl_expected.gemWait = 1; - mock->ioctl_expected.gemClose = 1; + mock->ioctlExpected.gemUserptr = 1; + mock->ioctlExpected.gemSetDomain = 1; + mock->ioctlExpected.gemWait = 1; + mock->ioctlExpected.gemClose = 1; auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{rootDeviceIndex, MemoryConstants::pageSize}); ASSERT_NE(nullptr, allocation); @@ -2049,12 +2049,12 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenLockUnlockIsCalledOnAlloca } TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenLockUnlockIsCalledOnAllocationWithoutCpuPtrThenReturnLockedPtrAndSetCpuDomain) { - mock->ioctl_expected.gemCreate = 1; - mock->ioctl_expected.gemMmapOffset = 1; - mock->ioctl_expected.gemSetDomain = 0; - mock->ioctl_expected.gemSetTiling = 1; - mock->ioctl_expected.gemWait = 1; - mock->ioctl_expected.gemClose = 1; + mock->ioctlExpected.gemCreate = 1; + mock->ioctlExpected.gemMmapOffset = 1; + mock->ioctlExpected.gemSetDomain = 0; + mock->ioctlExpected.gemSetTiling = 1; + mock->ioctlExpected.gemWait = 1; + mock->ioctlExpected.gemClose = 1; ImageDescriptor imgDesc = {}; imgDesc.imageType = ImageType::Image2D; @@ -2110,9 +2110,9 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenLockUnlockIsCalledOnAlloca } TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenLockUnlockIsCalledButFailsOnIoctlMmapThenReturnNullPtr) { - mock->ioctl_expected.gemMmapOffset = 1; - this->ioctlResExt = {mock->ioctl_cnt.total, -1}; - mock->ioctl_res_ext = &ioctlResExt; + mock->ioctlExpected.gemMmapOffset = 1; + this->ioctlResExt = {mock->ioctlCnt.total, -1}; + mock->ioctlResExt = &ioctlResExt; BufferObject bo(mock, 3, 1, 0, 1); DrmAllocation drmAllocation(rootDeviceIndex, AllocationType::UNKNOWN, &bo, nullptr, 0u, static_cast(0u), MemoryPool::MemoryNull); @@ -2122,7 +2122,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenLockUnlockIsCalledButFails EXPECT_EQ(nullptr, ptr); memoryManager->unlockResource(&drmAllocation); - mock->ioctl_res_ext = &mock->NONE; + mock->ioctlResExt = &mock->none; } TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenUnlockResourceIsCalledOnAllocationInLocalMemoryThenRedirectToUnlockResourceInLocalMemory) { @@ -2166,9 +2166,9 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenSetDomainCpuIsCalledOnAllo } TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenSetDomainCpuIsCalledButFailsOnIoctlSetDomainThenReturnFalse) { - mock->ioctl_expected.gemSetDomain = 1; - this->ioctlResExt = {mock->ioctl_cnt.total, -1}; - mock->ioctl_res_ext = &ioctlResExt; + mock->ioctlExpected.gemSetDomain = 1; + this->ioctlResExt = {mock->ioctlCnt.total, -1}; + mock->ioctlResExt = &ioctlResExt; DrmMockCustom drmMock(*executionEnvironment->rootDeviceEnvironments[0]); struct BufferObjectMock : public BufferObject { @@ -2180,11 +2180,11 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenSetDomainCpuIsCalledButFai auto success = memoryManager->setDomainCpu(drmAllocation, false); EXPECT_FALSE(success); - mock->ioctl_res_ext = &mock->NONE; + mock->ioctlResExt = &mock->none; } TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenSetDomainCpuIsCalledOnAllocationThenReturnSetWriteDomain) { - mock->ioctl_expected.gemSetDomain = 1; + mock->ioctlExpected.gemSetDomain = 1; DrmMockCustom drmMock(*executionEnvironment->rootDeviceEnvironments[0]); struct BufferObjectMock : public BufferObject { @@ -2204,9 +2204,9 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenSetDomainCpuIsCalledOnAllo } TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerAndUnifiedAuxCapableAllocationWhenMappingThenReturnFalse) { - mock->ioctl_expected.gemUserptr = 1; - mock->ioctl_expected.gemWait = 1; - mock->ioctl_expected.gemClose = 1; + mock->ioctlExpected.gemUserptr = 1; + mock->ioctlExpected.gemWait = 1; + mock->ioctlExpected.gemClose = 1; auto gmm = new Gmm(rootDeviceEnvironment->getGmmHelper(), nullptr, 123, 0, GMM_RESOURCE_USAGE_OCL_BUFFER, false, {}, true); auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{rootDeviceIndex, MemoryConstants::pageSize}); @@ -2221,9 +2221,9 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerAndUnifiedAuxCapableAllocation } TEST_F(DrmMemoryManagerTest, given32BitAllocatorWithHeapAllocatorWhenLargerFragmentIsReusedThenOnlyUnmapSizeIsLargerWhileSizeStaysTheSame) { - mock->ioctl_expected.gemUserptr = 1; - mock->ioctl_expected.gemWait = 1; - mock->ioctl_expected.gemClose = 1; + mock->ioctlExpected.gemUserptr = 1; + mock->ioctlExpected.gemWait = 1; + mock->ioctlExpected.gemClose = 1; DebugManagerStateRestore dbgFlagsKeeper; memoryManager->setForce32BitAllocations(true); @@ -2254,9 +2254,9 @@ TEST_F(DrmMemoryManagerTest, given32BitAllocatorWithHeapAllocatorWhenLargerFragm TEST_F(DrmMemoryManagerTest, givenSharedAllocationWithSmallerThenRealSizeWhenCreateIsCalledThenRealSizeIsUsed) { unsigned int realSize = 64 * 1024; lseekReturn = realSize; - mock->ioctl_expected.primeFdToHandle = 1; - mock->ioctl_expected.gemWait = 1; - mock->ioctl_expected.gemClose = 1; + mock->ioctlExpected.primeFdToHandle = 1; + mock->ioctlExpected.gemWait = 1; + mock->ioctlExpected.gemClose = 1; osHandle sharedHandle = 1u; AllocationProperties properties(rootDeviceIndex, false, MemoryConstants::pageSize, AllocationType::SHARED_BUFFER, false, {}); @@ -2277,9 +2277,9 @@ TEST_F(DrmMemoryManagerTest, givenSharedAllocationWithSmallerThenRealSizeWhenCre } TEST_F(DrmMemoryManagerTest, givenMemoryManagerWhenAskedForInternalAllocationWithNoPointerThenAllocationFromInternalHeapIsReturned) { - mock->ioctl_expected.gemUserptr = 1; - mock->ioctl_expected.gemWait = 1; - mock->ioctl_expected.gemClose = 1; + mock->ioctlExpected.gemUserptr = 1; + mock->ioctlExpected.gemWait = 1; + mock->ioctlExpected.gemClose = 1; auto bufferSize = MemoryConstants::pageSize; void *ptr = nullptr; @@ -2305,9 +2305,9 @@ TEST_F(DrmMemoryManagerTest, givenMemoryManagerWhenAskedForInternalAllocationWit } TEST_F(DrmMemoryManagerTest, givenLimitedRangeAllocatorWhenAskedForInternalAllocationWithNoPointerThenAllocationFromInternalHeapIsReturned) { - mock->ioctl_expected.gemUserptr = 1; - mock->ioctl_expected.gemWait = 1; - mock->ioctl_expected.gemClose = 1; + mock->ioctlExpected.gemUserptr = 1; + mock->ioctlExpected.gemWait = 1; + mock->ioctlExpected.gemClose = 1; memoryManager->forceLimitedRangeAllocator(0xFFFFFFFFF); @@ -2338,9 +2338,9 @@ TEST_F(DrmMemoryManagerTest, givenLimitedRangeAllocatorWhenAskedForInternalAlloc } TEST_F(DrmMemoryManagerTest, givenLimitedRangeAllocatorWhenAskedForExternalAllocationWithNoPointerThenAllocationFromInternalHeapIsReturned) { - mock->ioctl_expected.gemUserptr = 1; - mock->ioctl_expected.gemWait = 1; - mock->ioctl_expected.gemClose = 1; + mock->ioctlExpected.gemUserptr = 1; + mock->ioctlExpected.gemWait = 1; + mock->ioctlExpected.gemClose = 1; memoryManager->setForce32BitAllocations(true); memoryManager->forceLimitedRangeAllocator(0xFFFFFFFFF); @@ -2366,9 +2366,9 @@ TEST_F(DrmMemoryManagerTest, givenLimitedRangeAllocatorWhenAskedForInternalAlloc } TEST_F(DrmMemoryManagerTest, givenMemoryManagerWhenAskedForInternalAllocationWithPointerThenAllocationFromInternalHeapIsReturned) { - mock->ioctl_expected.gemUserptr = 1; - mock->ioctl_expected.gemWait = 1; - mock->ioctl_expected.gemClose = 1; + mock->ioctlExpected.gemUserptr = 1; + mock->ioctlExpected.gemWait = 1; + mock->ioctlExpected.gemClose = 1; auto bufferSize = MemoryConstants::pageSize; void *ptr = reinterpret_cast(0x100000); @@ -2397,8 +2397,8 @@ TEST_F(DrmMemoryManagerTest, givenMemoryManagerWhenAskedForInternalAllocationWit using DrmMemoryManagerUSMHostAllocationTests = Test; TEST_F(DrmMemoryManagerUSMHostAllocationTests, givenCallToAllocateGraphicsMemoryWithAlignmentWithIsHostUsmAllocationSetToFalseThenNewHostPointerIsUsedAndAllocationIsCreatedSuccesfully) { - mock->ioctl_expected.gemUserptr = 1; - mock->ioctl_expected.gemClose = 1; + mock->ioctlExpected.gemUserptr = 1; + mock->ioctlExpected.gemClose = 1; AllocationData allocationData; allocationData.size = 16384; @@ -2409,8 +2409,8 @@ TEST_F(DrmMemoryManagerUSMHostAllocationTests, givenCallToAllocateGraphicsMemory } TEST_F(DrmMemoryManagerUSMHostAllocationTests, givenCallToAllocateGraphicsMemoryWithAlignmentWithIsHostUsmAllocationSetToTrueThenGpuAddressIsNotFromGfxPartition) { - mock->ioctl_expected.gemUserptr = 1; - mock->ioctl_expected.gemClose = 1; + mock->ioctlExpected.gemUserptr = 1; + mock->ioctlExpected.gemClose = 1; AllocationData allocationData; allocationData.size = 16384; @@ -2426,8 +2426,8 @@ TEST_F(DrmMemoryManagerUSMHostAllocationTests, givenCallToAllocateGraphicsMemory } TEST_F(DrmMemoryManagerUSMHostAllocationTests, givenMmapPtrWhenFreeGraphicsMemoryImplThenPtrIsDeallocated) { - mock->ioctl_expected.gemUserptr = 1; - mock->ioctl_expected.gemClose = 1; + mock->ioctlExpected.gemUserptr = 1; + mock->ioctlExpected.gemClose = 1; const size_t size = 16384; AllocationData allocationData; @@ -2445,8 +2445,8 @@ TEST_F(DrmMemoryManagerUSMHostAllocationTests, givenMmapPtrWhenFreeGraphicsMemor TEST_F(DrmMemoryManagerUSMHostAllocationTests, givenCallToallocateGraphicsMemoryWithAlignmentWithisHostUSMAllocationSetToTrueThenTheExistingHostPointerIsUsedAndAllocationIsCreatedSuccesfully) { - mock->ioctl_expected.gemUserptr = 1; - mock->ioctl_expected.gemClose = 1; + mock->ioctlExpected.gemUserptr = 1; + mock->ioctlExpected.gemClose = 1; AllocationData allocationData; @@ -2637,8 +2637,8 @@ TEST_F(DrmMemoryManagerBasic, givenMemoryManagerWhenCreateAllocationFromHandleIs TEST_F(DrmMemoryManagerWithExplicitExpectationsTest, givenDisabledForcePinAndEnabledValidateHostMemoryWhenPinBBAllocationFailsThenUnrecoverableIsCalled) { this->mock = static_cast(executionEnvironment->rootDeviceEnvironments[0]->osInterface->getDriverModel()->as()); this->mock->reset(); - this->mock->ioctl_res = -1; - this->mock->ioctl_expected.gemUserptr = 1; + this->mock->ioctlRes = -1; + this->mock->ioctlExpected.gemUserptr = 1; EXPECT_THROW( { std::unique_ptr memoryManager(new TestedDrmMemoryManager(false, @@ -2648,8 +2648,8 @@ TEST_F(DrmMemoryManagerWithExplicitExpectationsTest, givenDisabledForcePinAndEna EXPECT_NE(nullptr, memoryManager.get()); }, std::exception); - this->mock->ioctl_res = 0; - this->mock->ioctl_expected.contextDestroy = 0; + this->mock->ioctlRes = 0; + this->mock->ioctlExpected.contextDestroy = 0; this->mock->testIoctls(); } @@ -2664,8 +2664,8 @@ TEST_F(DrmMemoryManagerWithExplicitExpectationsTest, givenDisabledForcePinAndEna ASSERT_NE(nullptr, memoryManager->pinBBs[device->getRootDeviceIndex()]); mock->reset(); - mock->ioctl_expected.gemUserptr = 1; - mock->ioctl_expected.execbuffer2 = 1; // for pinning - host memory validation + mock->ioctlExpected.gemUserptr = 1; + mock->ioctlExpected.execbuffer2 = 1; // for pinning - host memory validation OsHandleStorage handleStorage; handleStorage.fragmentStorageData[0].cpuPtr = reinterpret_cast(0x1000); @@ -2711,8 +2711,8 @@ TEST_F(DrmMemoryManagerWithExplicitExpectationsTest, givenDisabledForcePinAndEna memoryManager->injectPinBB(pinBB, rootDeviceIndex); mock->reset(); - mock->ioctl_expected.gemUserptr = 2; - mock->ioctl_expected.execbuffer2 = 0; // pinning for host memory validation is mocked + mock->ioctlExpected.gemUserptr = 2; + mock->ioctlExpected.execbuffer2 = 0; // pinning for host memory validation is mocked OsHandleStorage handleStorage; OsHandleLinux handle1; @@ -2748,9 +2748,9 @@ TEST_F(DrmMemoryManagerWithExplicitExpectationsTest, givenDisabledForcePinAndEna } TEST_F(DrmMemoryManagerWithExplicitExpectationsTest, givenValidateHostPtrMemoryEnabledWhenHostPtrAllocationIsCreatedWithoutForcingPinThenBufferObjectIsPinned) { - mock->ioctl_expected.gemUserptr = 2; - mock->ioctl_expected.gemWait = 1; - mock->ioctl_expected.gemClose = 2; + mock->ioctlExpected.gemUserptr = 2; + mock->ioctlExpected.gemWait = 1; + mock->ioctlExpected.gemClose = 2; std::unique_ptr memoryManager(new (std::nothrow) TestedDrmMemoryManager(false, true, true, *executionEnvironment)); memoryManager->registeredEngines = EngineControlContainer{this->device->allEngines}; @@ -2791,10 +2791,10 @@ TEST_F(DrmMemoryManagerWithExplicitExpectationsTest, givenEnabledHostMemoryValid } TEST_F(DrmMemoryManagerTest, givenForcePinAndHostMemoryValidationEnabledWhenSmallAllocationIsCreatedThenBufferObjectIsPinned) { - mock->ioctl_expected.gemUserptr = 2; // 1 pinBB, 1 small allocation - mock->ioctl_expected.execbuffer2 = 1; // pinning - mock->ioctl_expected.gemWait = 1; // in freeGraphicsAllocation - mock->ioctl_expected.gemClose = 2; // 1 pinBB, 1 small allocation + mock->ioctlExpected.gemUserptr = 2; // 1 pinBB, 1 small allocation + mock->ioctlExpected.execbuffer2 = 1; // pinning + mock->ioctlExpected.gemWait = 1; // in freeGraphicsAllocation + mock->ioctlExpected.gemClose = 2; // 1 pinBB, 1 small allocation std::unique_ptr memoryManager(new (std::nothrow) TestedDrmMemoryManager(false, true, true, *executionEnvironment)); memoryManager->registeredEngines = EngineControlContainer{this->device->allEngines}; @@ -2815,8 +2815,8 @@ TEST_F(DrmMemoryManagerTest, givenForcePinAndHostMemoryValidationEnabledWhenSmal } TEST_F(DrmMemoryManagerTest, givenForcePinAndHostMemoryValidationEnabledThenPinnedBufferObjectGpuAddressWithinDeviceGpuAddressSpace) { - mock->ioctl_expected.gemUserptr = 1; - mock->ioctl_expected.gemClose = 1; + mock->ioctlExpected.gemUserptr = 1; + mock->ioctlExpected.gemClose = 1; std::unique_ptr memoryManager(new (std::nothrow) TestedDrmMemoryManager(false, true, true, *executionEnvironment)); @@ -2828,8 +2828,8 @@ TEST_F(DrmMemoryManagerTest, givenForcePinAndHostMemoryValidationEnabledThenPinn } TEST_F(DrmMemoryManagerTest, givenForcePinAndHostMemoryValidationEnabledThenPinnedBufferObjectWrittenWithMIBBENDAndNOOP) { - mock->ioctl_expected.gemUserptr = 1; - mock->ioctl_expected.gemClose = 1; + mock->ioctlExpected.gemUserptr = 1; + mock->ioctlExpected.gemClose = 1; std::unique_ptr memoryManager(new (std::nothrow) TestedDrmMemoryManager(false, true, true, *executionEnvironment)); @@ -2843,17 +2843,17 @@ TEST_F(DrmMemoryManagerTest, givenForcePinAndHostMemoryValidationEnabledThenPinn } TEST_F(DrmMemoryManagerTest, givenForcePinAllowedAndNoPinBBInMemoryManagerWhenAllocationWithForcePinFlagTrueIsCreatedThenAllocationIsNotPinned) { - mock->ioctl_expected.gemUserptr = 2; - mock->ioctl_expected.gemWait = 1; - mock->ioctl_expected.gemClose = 1; - mock->ioctl_res = -1; + mock->ioctlExpected.gemUserptr = 2; + mock->ioctlExpected.gemWait = 1; + mock->ioctlExpected.gemClose = 1; + mock->ioctlRes = -1; std::unique_ptr memoryManager(new (std::nothrow) TestedDrmMemoryManager(false, true, false, *executionEnvironment)); memoryManager->registeredEngines = EngineControlContainer{this->device->allEngines}; for (auto engine : memoryManager->registeredEngines) { engine.osContext->incRefInternal(); } EXPECT_EQ(nullptr, memoryManager->pinBBs[rootDeviceIndex]); - mock->ioctl_res = 0; + mock->ioctlRes = 0; auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(createAllocationProperties(rootDeviceIndex, MemoryConstants::pageSize, true)); EXPECT_NE(nullptr, allocation); @@ -2962,16 +2962,16 @@ TEST_F(DrmMemoryManagerBasic, givenDrmMemoryManagerWhenAllocateGraphicsMemoryFor TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenAllocateGraphicsMemoryForNonSvmHostPtrIsCalledWithHostPtrIsPassedAndWhenAllocUserptrFailsThenFails) { memoryManager->forceLimitedRangeAllocator(0xFFFFFFFFF); - mock->ioctl_expected.gemUserptr = 1; - this->ioctlResExt = {mock->ioctl_cnt.total, -1}; - mock->ioctl_res_ext = &ioctlResExt; + mock->ioctlExpected.gemUserptr = 1; + this->ioctlResExt = {mock->ioctlCnt.total, -1}; + mock->ioctlResExt = &ioctlResExt; allocationData.size = 10; allocationData.hostPtr = reinterpret_cast(0x1000); auto allocation = memoryManager->allocateGraphicsMemoryForNonSvmHostPtr(allocationData); EXPECT_EQ(nullptr, allocation); - mock->ioctl_res_ext = &mock->NONE; + mock->ioctlResExt = &mock->none; } TEST_F(DrmMemoryManagerWithExplicitExpectationsTest, givenForcePinNotAllowedAndHostMemoryValidationEnabledWhenAllocationIsCreatedThenBufferObjectIsPinnedOnlyOnce) { @@ -2981,10 +2981,10 @@ TEST_F(DrmMemoryManagerWithExplicitExpectationsTest, givenForcePinNotAllowedAndH engine.osContext->incRefInternal(); } mock->reset(); - mock->ioctl_expected.gemUserptr = 1; - mock->ioctl_expected.execbuffer2 = 1; - mock->ioctl_expected.gemClose = 1; - mock->ioctl_expected.gemWait = 1; + mock->ioctlExpected.gemUserptr = 1; + mock->ioctlExpected.execbuffer2 = 1; + mock->ioctlExpected.gemClose = 1; + mock->ioctlExpected.gemWait = 1; AllocationData allocationData; allocationData.size = 4 * 1024; @@ -3008,9 +3008,9 @@ TEST_F(DrmMemoryManagerWithExplicitExpectationsTest, givenForcePinNotAllowedAndH engine.osContext->incRefInternal(); } mock->reset(); - mock->ioctl_expected.gemUserptr = 1; - mock->ioctl_expected.gemClose = 1; - mock->ioctl_expected.gemWait = 1; + mock->ioctlExpected.gemUserptr = 1; + mock->ioctlExpected.gemClose = 1; + mock->ioctlExpected.gemWait = 1; AllocationData allocationData; allocationData.size = 10 * MB; // bigger than threshold @@ -3041,10 +3041,10 @@ TEST_F(DrmMemoryManagerWithExplicitExpectationsTest, givenEnabledValidateHostMem DrmMockCustom::IoctlResExt ioctlResExt = {2, -1}; ioctlResExt.no.push_back(3); ioctlResExt.no.push_back(4); - mock->ioctl_res_ext = &ioctlResExt; + mock->ioctlResExt = &ioctlResExt; mock->errnoValue = EFAULT; - mock->ioctl_expected.gemUserptr = 2; - mock->ioctl_expected.execbuffer2 = 3; + mock->ioctlExpected.gemUserptr = 2; + mock->ioctlExpected.execbuffer2 = 3; OsHandleStorage handleStorage; OsHandleLinux handle1; @@ -3077,7 +3077,7 @@ TEST_F(DrmMemoryManagerWithExplicitExpectationsTest, givenEnabledValidateHostMem handleStorage.fragmentStorageData[2].freeTheFragment = true; memoryManager->cleanOsHandles(handleStorage, rootDeviceIndex); - mock->ioctl_res_ext = &mock->NONE; + mock->ioctlResExt = &mock->none; } TEST_F(DrmMemoryManagerWithExplicitExpectationsTest, givenEnabledValidateHostMemoryWhenReadOnlyPointerCausesPinningFailWithEfaultThenPopulateOsHandlesDoesNotStoreTheFragments) { @@ -3093,10 +3093,10 @@ TEST_F(DrmMemoryManagerWithExplicitExpectationsTest, givenEnabledValidateHostMem DrmMockCustom::IoctlResExt ioctlResExt = {2, -1}; ioctlResExt.no.push_back(3); ioctlResExt.no.push_back(4); - mock->ioctl_res_ext = &ioctlResExt; + mock->ioctlResExt = &ioctlResExt; mock->errnoValue = EFAULT; - mock->ioctl_expected.gemUserptr = 2; - mock->ioctl_expected.execbuffer2 = 3; + mock->ioctlExpected.gemUserptr = 2; + mock->ioctlExpected.execbuffer2 = 3; OsHandleStorage handleStorage; OsHandleLinux handle1; @@ -3128,7 +3128,7 @@ TEST_F(DrmMemoryManagerWithExplicitExpectationsTest, givenEnabledValidateHostMem handleStorage.fragmentStorageData[2].freeTheFragment = true; memoryManager->cleanOsHandles(handleStorage, rootDeviceIndex); - mock->ioctl_res_ext = &mock->NONE; + mock->ioctlResExt = &mock->none; } TEST_F(DrmMemoryManagerWithExplicitExpectationsTest, givenEnabledValidateHostMemoryWhenPopulateOsHandlesSucceedsThenFragmentIsStoredInHostPtrManager) { @@ -3140,8 +3140,8 @@ TEST_F(DrmMemoryManagerWithExplicitExpectationsTest, givenEnabledValidateHostMem ASSERT_NE(nullptr, memoryManager->pinBBs[device->getRootDeviceIndex()]); mock->reset(); - mock->ioctl_expected.gemUserptr = 1; - mock->ioctl_expected.execbuffer2 = 1; + mock->ioctlExpected.gemUserptr = 1; + mock->ioctlExpected.execbuffer2 = 1; OsHandleStorage handleStorage; handleStorage.fragmentStorageData[0].osHandleStorage = nullptr; @@ -3272,9 +3272,9 @@ TEST_F(DrmMemoryManagerBasic, givenLocalMemoryDisabledWhenAllocateInDevicePoolIs } TEST_F(DrmMemoryManagerTest, givenDebugModuleAreaTypeWhenCreatingAllocationThen32BitDrmAllocationWithFrontWindowGpuVaIsReturned) { - mock->ioctl_expected.gemUserptr = 1; - mock->ioctl_expected.gemWait = 1; - mock->ioctl_expected.gemClose = 1; + mock->ioctlExpected.gemUserptr = 1; + mock->ioctlExpected.gemWait = 1; + mock->ioctlExpected.gemClose = 1; const auto size = MemoryConstants::pageSize64k; @@ -3362,7 +3362,7 @@ TEST(DrmMemoryManagerWithExplicitExpectationsTest2, whenObtainFdFromHandleIsCall int boHandle = 3; mock->outputFd = 1337; - mock->ioctl_expected.handleToPrimeFd = 1; + mock->ioctlExpected.handleToPrimeFd = 1; auto fdHandle = memoryManager->obtainFdFromHandle(boHandle, i); EXPECT_EQ(mock->inputHandle, static_cast(boHandle)); EXPECT_EQ(mock->inputFlags, DRM_CLOEXEC | DRM_RDWR); @@ -3386,17 +3386,17 @@ TEST(DrmMemoryManagerWithExplicitExpectationsTest2, whenFailingToObtainFdFromHan int boHandle = 3; mock->outputFd = -1; - mock->ioctl_res = -1; - mock->ioctl_expected.handleToPrimeFd = 1; + mock->ioctlRes = -1; + mock->ioctlExpected.handleToPrimeFd = 1; auto fdHandle = memoryManager->obtainFdFromHandle(boHandle, i); EXPECT_EQ(-1, fdHandle); } } TEST_F(DrmMemoryManagerTest, givenSvmCpuAllocationWhenSizeAndAlignmentProvidedThenAllocateMemoryAndReserveGpuVa) { - mock->ioctl_expected.gemUserptr = 1; - mock->ioctl_expected.gemWait = 1; - mock->ioctl_expected.gemClose = 1; + mock->ioctlExpected.gemUserptr = 1; + mock->ioctlExpected.gemWait = 1; + mock->ioctlExpected.gemClose = 1; AllocationData allocationData; allocationData.size = 2 * MemoryConstants::megaByte; @@ -3434,9 +3434,9 @@ TEST_F(DrmMemoryManagerTest, givenSvmCpuAllocationWhenSizeAndAlignmentProvidedTh } TEST_F(DrmMemoryManagerTest, givenSvmCpuAllocationWhenSizeAndAlignmentProvidedButFailsToReserveGpuVaThenNullAllocationIsReturned) { - mock->ioctl_expected.gemUserptr = 0; - mock->ioctl_expected.gemWait = 0; - mock->ioctl_expected.gemClose = 0; + mock->ioctlExpected.gemUserptr = 0; + mock->ioctlExpected.gemWait = 0; + mock->ioctlExpected.gemClose = 0; memoryManager->getGfxPartition(rootDeviceIndex)->heapInit(HeapIndex::HEAP_STANDARD, 0, 0); @@ -4210,7 +4210,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmAllocationWithHostPtrWhenItIsCreatedWithCac if (gfxCoreHelper.getNumCacheRegions() == 0) { GTEST_SKIP(); } - mock->ioctl_expected.total = -1; + mock->ioctlExpected.total = -1; auto drm = static_cast(executionEnvironment->rootDeviceEnvironments[rootDeviceIndex]->osInterface->getDriverModel()->as()); drm->cacheInfo.reset(new MockCacheInfo(*drm, 32 * MemoryConstants::kiloByte, 2, 32)); @@ -4240,7 +4240,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmAllocationWithHostPtrWhenItIsCreatedWithCac } HWTEST_F(DrmMemoryManagerTest, givenDrmAllocationWithHostPtrWhenItIsCreatedWithIncorrectCacheRegionThenReturnNull) { - mock->ioctl_expected.total = -1; + mock->ioctlExpected.total = -1; auto drm = static_cast(executionEnvironment->rootDeviceEnvironments[rootDeviceIndex]->osInterface->getDriverModel()->as()); drm->setupCacheInfo(*defaultHwInfo.get()); @@ -4256,7 +4256,7 @@ HWTEST_F(DrmMemoryManagerTest, givenDrmAllocationWithHostPtrWhenItIsCreatedWithI } HWTEST_F(DrmMemoryManagerTest, givenDrmAllocationWithWithAlignmentFromUserptrWhenItIsCreatedWithIncorrectCacheRegionThenReturnNull) { - mock->ioctl_expected.total = -1; + mock->ioctlExpected.total = -1; auto drm = static_cast(executionEnvironment->rootDeviceEnvironments[rootDeviceIndex]->osInterface->getDriverModel()->as()); drm->setupCacheInfo(*defaultHwInfo.get()); @@ -4439,9 +4439,9 @@ TEST_F(DrmMemoryManagerTest, givenDrmManagerWithLocalMemoryWhenLockResourceIsCal TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWithoutLocalMemoryWhenCopyMemoryToAllocationThenAllocationIsFilledWithCorrectData) { TestedDrmMemoryManager memoryManager(false, false, false, *executionEnvironment); - mock->ioctl_expected.gemUserptr = 1; - mock->ioctl_expected.gemWait = 1; - mock->ioctl_expected.gemClose = 1; + mock->ioctlExpected.gemUserptr = 1; + mock->ioctlExpected.gemWait = 1; + mock->ioctlExpected.gemClose = 1; std::vector dataToCopy(MemoryConstants::pageSize, 1u); @@ -4458,9 +4458,9 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWithoutLocalMemoryWhenCopyMemo TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWithoutLocalMemoryAndCpuPtrWhenCopyMemoryToAllocationThenReturnFalse) { TestedDrmMemoryManager memoryManager(false, false, false, *executionEnvironment); - mock->ioctl_expected.gemUserptr = 1; - mock->ioctl_expected.gemWait = 1; - mock->ioctl_expected.gemClose = 1; + mock->ioctlExpected.gemUserptr = 1; + mock->ioctlExpected.gemWait = 1; + mock->ioctlExpected.gemClose = 1; std::vector dataToCopy(MemoryConstants::pageSize, 1u); @@ -4475,7 +4475,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWithoutLocalMemoryAndCpuPtrWhe TEST_F(DrmMemoryManagerTest, givenNullDefaultAllocWhenCreateGraphicsAllocationFromExistingStorageThenDoNotImportHandle) { TestedDrmMemoryManager memoryManager(false, false, false, *executionEnvironment); - mock->ioctl_expected.primeFdToHandle = 0; + mock->ioctlExpected.primeFdToHandle = 0; MockAllocationProperties properties(0u, 1u); MultiGraphicsAllocation allocation(0u); @@ -4601,9 +4601,9 @@ TEST_F(DrmMemoryManagerWithLocalMemoryTest, givenDrmMemoryManagerWithLocalMemory using DrmMemoryManagerTest = Test; TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenCopyMemoryToAllocationThenAllocationIsFilledWithCorrectData) { - mock->ioctl_expected.gemUserptr = 1; - mock->ioctl_expected.gemWait = 1; - mock->ioctl_expected.gemClose = 1; + mock->ioctlExpected.gemUserptr = 1; + mock->ioctlExpected.gemWait = 1; + mock->ioctlExpected.gemClose = 1; std::vector dataToCopy(MemoryConstants::pageSize, 1u); @@ -4619,9 +4619,9 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenCopyMemoryToAllocationThen } TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenFreeingImportedMemoryThenCloseSharedHandleIsNotCalled) { - mock->ioctl_expected.gemUserptr = 1; - mock->ioctl_expected.gemWait = 1; - mock->ioctl_expected.gemClose = 1; + mock->ioctlExpected.gemUserptr = 1; + mock->ioctlExpected.gemWait = 1; + mock->ioctlExpected.gemClose = 1; std::vector dataToCopy(MemoryConstants::pageSize, 1u); @@ -4634,9 +4634,9 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenFreeingImportedMemoryThenC } TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenFreeingNonImportedMemoryThenCloseSharedHandleIsCalled) { - mock->ioctl_expected.gemUserptr = 1; - mock->ioctl_expected.gemWait = 1; - mock->ioctl_expected.gemClose = 1; + mock->ioctlExpected.gemUserptr = 1; + mock->ioctlExpected.gemWait = 1; + mock->ioctlExpected.gemClose = 1; std::vector dataToCopy(MemoryConstants::pageSize, 1u); @@ -6083,7 +6083,7 @@ TEST(DrmMemoryManagerCopyMemoryToAllocationBanksTest, givenDrmMemoryManagerWhenC } TEST_F(DrmMemoryManagerWithLocalMemoryTest, givenDrmWhenRetrieveMmapOffsetForBufferObjectSucceedsThenReturnTrueAndCorrectOffset) { - mock->ioctl_expected.gemMmapOffset = 1; + mock->ioctlExpected.gemMmapOffset = 1; BufferObject bo(mock, 3, 1, 1024, 0); mock->mmapOffsetExpected = 21; @@ -6095,7 +6095,7 @@ TEST_F(DrmMemoryManagerWithLocalMemoryTest, givenDrmWhenRetrieveMmapOffsetForBuf } TEST_F(DrmMemoryManagerWithLocalMemoryTest, givenDrmWhenRetrieveMmapOffsetForBufferObjectFailsThenReturnFalse) { - mock->ioctl_expected.gemMmapOffset = 2; + mock->ioctlExpected.gemMmapOffset = 2; BufferObject bo(mock, 3, 1, 1024, 0); mock->failOnMmapOffset = true; @@ -6106,7 +6106,7 @@ TEST_F(DrmMemoryManagerWithLocalMemoryTest, givenDrmWhenRetrieveMmapOffsetForBuf } TEST_F(DrmMemoryManagerWithLocalMemoryTest, givenDrmWhenRetrieveMmapOffsetForBufferObjectIsCalledForLocalMemoryThenApplyCorrectFlags) { - mock->ioctl_expected.gemMmapOffset = 5; + mock->ioctlExpected.gemMmapOffset = 5; BufferObject bo(mock, 3, 1, 1024, 0); uint64_t offset = 0; @@ -6126,7 +6126,7 @@ TEST_F(DrmMemoryManagerWithLocalMemoryTest, givenDrmWhenRetrieveMmapOffsetForBuf } TEST_F(DrmMemoryManagerTest, givenDrmWhenRetrieveMmapOffsetForBufferObjectIsCalledForSystemMemoryThenApplyCorrectFlags) { - mock->ioctl_expected.gemMmapOffset = 4; + mock->ioctlExpected.gemMmapOffset = 4; BufferObject bo(mock, 3, 1, 1024, 0); uint64_t offset = 0; @@ -6192,7 +6192,7 @@ TEST_F(DrmMemoryManagerTest, GivenNotEligbleAllocationTypeAndDebugFlagOverriding } TEST_F(DrmMemoryManagerTest, givenCompletionFenceEnabledWhenHandlingCompletionOfUsedAndEligbleAllocationThenCallWaitUserFence) { - mock->ioctl_expected.total = -1; + mock->ioctlExpected.total = -1; VariableBackup backupFenceSupported{&mock->completionFenceSupported, true}; VariableBackup backupVmBindCallParent{&mock->isVmBindAvailableCall.callParent, false}; @@ -6215,7 +6215,7 @@ TEST_F(DrmMemoryManagerTest, givenCompletionFenceEnabledWhenHandlingCompletionOf } TEST_F(DrmMemoryManagerTest, givenCompletionFenceEnabledWhenHandlingCompletionOfNotUsedAndEligbleAllocationThenDoNotCallWaitUserFence) { - mock->ioctl_expected.total = -1; + mock->ioctlExpected.total = -1; VariableBackup backupFenceSupported{&mock->completionFenceSupported, true}; VariableBackup backupVmBindCallParent{&mock->isVmBindAvailableCall.callParent, false}; @@ -6231,7 +6231,7 @@ TEST_F(DrmMemoryManagerTest, givenCompletionFenceEnabledWhenHandlingCompletionOf } TEST_F(DrmMemoryManagerTest, givenCompletionFenceEnabledWhenHandlingCompletionOfUsedAndNotEligbleAllocationThenDoNotCallWaitUserFence) { - mock->ioctl_expected.total = -1; + mock->ioctlExpected.total = -1; VariableBackup backupFenceSupported{&mock->completionFenceSupported, true}; VariableBackup backupVmBindCallParent{&mock->isVmBindAvailableCall.callParent, false}; @@ -6249,7 +6249,7 @@ TEST_F(DrmMemoryManagerTest, givenCompletionFenceEnabledWhenHandlingCompletionOf } HWTEST_F(DrmMemoryManagerTest, givenCompletionFenceEnabledWhenHandlingCompletionAndTagAddressIsNullThenDoNotCallWaitUserFence) { - mock->ioctl_expected.total = -1; + mock->ioctlExpected.total = -1; VariableBackup backupFenceSupported{&mock->completionFenceSupported, true}; VariableBackup backupVmBindCallParent{&mock->isVmBindAvailableCall.callParent, false}; @@ -6272,7 +6272,7 @@ HWTEST_F(DrmMemoryManagerTest, givenCompletionFenceEnabledWhenHandlingCompletion } TEST_F(DrmMemoryManagerTest, givenMultiSubDevicesBitfieldWhenAllocatingSbaTrackingBufferThenCorrectMultiHostAllocationReturned) { - mock->ioctl_expected.total = -1; + mock->ioctlExpected.total = -1; NEO::AllocationProperties properties{device->getRootDeviceIndex(), true, MemoryConstants::pageSize, NEO::AllocationType::DEBUG_SBA_TRACKING_BUFFER, @@ -6319,7 +6319,7 @@ TEST_F(DrmMemoryManagerTest, givenMultiSubDevicesBitfieldWhenAllocatingSbaTracki } TEST_F(DrmMemoryManagerTest, givenSingleSubDevicesBitfieldWhenAllocatingSbaTrackingBufferThenSingleHostAllocationReturned) { - mock->ioctl_expected.total = -1; + mock->ioctlExpected.total = -1; NEO::AllocationProperties properties{device->getRootDeviceIndex(), true, MemoryConstants::pageSize, NEO::AllocationType::DEBUG_SBA_TRACKING_BUFFER, diff --git a/shared/test/unit_test/os_interface/linux/os_time_test.cpp b/shared/test/unit_test/os_interface/linux/os_time_test.cpp index e7dc264098..b482a68215 100644 --- a/shared/test/unit_test/os_interface/linux/os_time_test.cpp +++ b/shared/test/unit_test/os_interface/linux/os_time_test.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2022 Intel Corporation + * Copyright (C) 2018-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -165,7 +165,7 @@ TEST_F(DrmTimeTest, WhenGettingTimeThenTimeIsCorrect) { } { - drm->ioctl_res = -1; + drm->ioctlRes = -1; osTime->getDeviceTime()->timestampTypeDetect(); auto p = osTime->getDeviceTime()->getGpuTime; EXPECT_EQ(p, &DeviceTimeDrm::getGpuTime32); @@ -174,12 +174,12 @@ TEST_F(DrmTimeTest, WhenGettingTimeThenTimeIsCorrect) { DrmMockCustom::IoctlResExt ioctlToPass = {1, 0}; { drm->reset(); - drm->ioctl_res = -1; - drm->ioctl_res_ext = &ioctlToPass; // 2nd ioctl is successful + drm->ioctlRes = -1; + drm->ioctlResExt = &ioctlToPass; // 2nd ioctl is successful osTime->getDeviceTime()->timestampTypeDetect(); auto p = osTime->getDeviceTime()->getGpuTime; EXPECT_EQ(p, &DeviceTimeDrm::getGpuTimeSplitted); - drm->ioctl_res_ext = &drm->NONE; + drm->ioctlResExt = &drm->none; } } @@ -190,7 +190,7 @@ TEST_F(DrmTimeTest, givenGpuTimestampResolutionQueryWhenIoctlFailsThenDefaultRes osTime->updateDrm(drm); drm->getParamRetValue = 0; - drm->ioctl_res = -1; + drm->ioctlRes = -1; auto result = osTime->getDynamicDeviceTimerResolution(*defaultHwInfo); EXPECT_DOUBLE_EQ(result, defaultResolution); @@ -203,7 +203,7 @@ TEST_F(DrmTimeTest, givenGetDynamicDeviceTimerClockWhenIoctlFailsThenDefaultCloc osTime->updateDrm(drm); drm->getParamRetValue = 0; - drm->ioctl_res = -1; + drm->ioctlRes = -1; auto result = osTime->getDynamicDeviceTimerClock(*defaultHwInfo); auto expectedResult = static_cast(1000000000.0 / defaultResolution); @@ -236,7 +236,7 @@ TEST_F(DrmTimeTest, givenGpuTimestampResolutionQueryWhenIoctlSuccedsThenCorrectR // 19200000 is frequency yelding 52.083ns resolution drm->getParamRetValue = 19200000; - drm->ioctl_res = 0; + drm->ioctlRes = 0; auto result = osTime->getDynamicDeviceTimerResolution(*defaultHwInfo); EXPECT_DOUBLE_EQ(result, 52.08333333333333); diff --git a/shared/test/unit_test/os_interface/linux/product_helper_linux_tests.h b/shared/test/unit_test/os_interface/linux/product_helper_linux_tests.h index 9e1b916d18..fcc3f7207e 100644 --- a/shared/test/unit_test/os_interface/linux/product_helper_linux_tests.h +++ b/shared/test/unit_test/os_interface/linux/product_helper_linux_tests.h @@ -45,12 +45,12 @@ struct ProductHelperTestLinux : public ProductHelperTest { drm->storedEUVal = pInHwInfo.gtSystemInfo.EUCount; drm->storedSSVal = pInHwInfo.gtSystemInfo.SubSliceCount; - rt_cpuidex_func = CpuInfo::cpuidexFunc; + rtCpuidexFunc = CpuInfo::cpuidexFunc; CpuInfo::cpuidexFunc = mockCpuidex; } void TearDown() override { - CpuInfo::cpuidexFunc = rt_cpuidex_func; + CpuInfo::cpuidexFunc = rtCpuidexFunc; ProductHelperTest::TearDown(); } @@ -69,5 +69,5 @@ struct ProductHelperTestLinux : public ProductHelperTest { std::unique_ptr executionEnvironment; DrmMock *drm; - void (*rt_cpuidex_func)(int *, int, int); + void (*rtCpuidexFunc)(int *, int, int); }; diff --git a/shared/test/unit_test/utilities/tag_allocator_tests.cpp b/shared/test/unit_test/utilities/tag_allocator_tests.cpp index 77540c2c3f..e7cef10fe1 100644 --- a/shared/test/unit_test/utilities/tag_allocator_tests.cpp +++ b/shared/test/unit_test/utilities/tag_allocator_tests.cpp @@ -66,8 +66,8 @@ struct TimeStamps { uint64_t start; uint64_t end; - uint64_t ContextCompleteTS; - uint64_t GlobalEndTS; + uint64_t contextCompleteTS; + uint64_t globalEndTS; }; template