Enhance VME registry support

Related-To: NEO-3583
Change-Id: I4ddad40348d276cb4f52ceedadf77ab615c85db9
Signed-off-by: Andrzej Koska <andrzej.koska@intel.com>
This commit is contained in:
Koska, Andrzej
2019-09-06 12:30:35 +02:00
committed by sys_ocldev
parent 6ab6a06b1b
commit ccea3f497c
4 changed files with 35 additions and 25 deletions

View File

@ -121,6 +121,7 @@ void Device::initializeCaps() {
deviceInfo.platformLP = (hwInfo.capabilityTable.clVersionSupport == 12) ? true : false; deviceInfo.platformLP = (hwInfo.capabilityTable.clVersionSupport == 12) ? true : false;
deviceInfo.spirVersions = spirVersions.c_str(); deviceInfo.spirVersions = spirVersions.c_str();
auto supportsVme = hwInfo.capabilityTable.supportsVme; auto supportsVme = hwInfo.capabilityTable.supportsVme;
auto supportsAdvancedVme = hwInfo.capabilityTable.supportsVme;
if (enabledClVersion >= 21) { if (enabledClVersion >= 21) {
deviceInfo.independentForwardProgress = true; deviceInfo.independentForwardProgress = true;
@ -146,11 +147,19 @@ void Device::initializeCaps() {
deviceExtensions += "cl_intel_packed_yuv "; deviceExtensions += "cl_intel_packed_yuv ";
deviceInfo.packedYuvExtension = true; deviceInfo.packedYuvExtension = true;
} }
if (DebugManager.flags.EnableIntelVme.get() && supportsVme) { if (DebugManager.flags.EnableIntelVme.get() != -1) {
supportsVme = !!DebugManager.flags.EnableIntelVme.get();
}
if (supportsVme) {
deviceExtensions += "cl_intel_motion_estimation cl_intel_device_side_avc_motion_estimation "; deviceExtensions += "cl_intel_motion_estimation cl_intel_device_side_avc_motion_estimation ";
deviceInfo.vmeExtension = true; deviceInfo.vmeExtension = true;
} }
if (DebugManager.flags.EnableIntelAdvancedVme.get() && supportsVme) {
if (DebugManager.flags.EnableIntelAdvancedVme.get() != -1) {
supportsAdvancedVme = !!DebugManager.flags.EnableIntelAdvancedVme.get();
}
if (supportsAdvancedVme) {
deviceExtensions += "cl_intel_advanced_motion_estimation "; deviceExtensions += "cl_intel_advanced_motion_estimation ";
} }
@ -169,10 +178,11 @@ void Device::initializeCaps() {
deviceInfo.deviceExtensions = deviceExtensions.c_str(); deviceInfo.deviceExtensions = deviceExtensions.c_str();
exposedBuiltinKernels = builtInKernels; exposedBuiltinKernels = builtInKernels;
if (deviceExtensions.find("cl_intel_motion_estimation") != std::string::npos) {
if (supportsVme) {
exposedBuiltinKernels.append("block_motion_estimate_intel;"); exposedBuiltinKernels.append("block_motion_estimate_intel;");
} }
if (deviceExtensions.find("cl_intel_advanced_motion_estimation") != std::string::npos) { if (supportsAdvancedVme) {
auto advVmeKernels = "block_advanced_motion_estimate_check_intel;block_advanced_motion_estimate_bidirectional_check_intel;"; auto advVmeKernels = "block_advanced_motion_estimate_check_intel;block_advanced_motion_estimate_bidirectional_check_intel;";
exposedBuiltinKernels.append(advVmeKernels); exposedBuiltinKernels.append(advVmeKernels);
} }

View File

@ -89,8 +89,6 @@ DECLARE_DEBUG_VARIABLE(bool, DisableDcFlushInEpilogue, false, "Disable DC flush
/*FEATURE FLAGS*/ /*FEATURE FLAGS*/
DECLARE_DEBUG_VARIABLE(bool, EnableNV12, true, "Enables NV12 extension") DECLARE_DEBUG_VARIABLE(bool, EnableNV12, true, "Enables NV12 extension")
DECLARE_DEBUG_VARIABLE(bool, EnablePackedYuv, true, "Enables cl_packed_yuv extension") DECLARE_DEBUG_VARIABLE(bool, EnablePackedYuv, true, "Enables cl_packed_yuv extension")
DECLARE_DEBUG_VARIABLE(bool, EnableIntelVme, true, "Enables cl_intel_motion_estimation extension")
DECLARE_DEBUG_VARIABLE(bool, EnableIntelAdvancedVme, true, "Enables cl_intel_advanced_motion_estimation extension")
DECLARE_DEBUG_VARIABLE(bool, EnableDeferredDeleter, true, "Enables async deleter") DECLARE_DEBUG_VARIABLE(bool, EnableDeferredDeleter, true, "Enables async deleter")
DECLARE_DEBUG_VARIABLE(bool, EnableAsyncDestroyAllocations, true, "Enables async destroying graphics allocations in mem obj destructor") DECLARE_DEBUG_VARIABLE(bool, EnableAsyncDestroyAllocations, true, "Enables async destroying graphics allocations in mem obj destructor")
DECLARE_DEBUG_VARIABLE(bool, EnableAsyncEventsHandler, true, "Enables async events handler") DECLARE_DEBUG_VARIABLE(bool, EnableAsyncEventsHandler, true, "Enables async events handler")
@ -104,6 +102,8 @@ DECLARE_DEBUG_VARIABLE(bool, EnablePassInlineData, false, "Enable passing of inl
DECLARE_DEBUG_VARIABLE(bool, EnableFormatQuery, false, "Enable sharing format querying") DECLARE_DEBUG_VARIABLE(bool, EnableFormatQuery, false, "Enable sharing format querying")
DECLARE_DEBUG_VARIABLE(bool, AllowOpenFdOperations, false, "When enabled driver is allowed to call DRM_IOCTL_PRIME_HANDLE_TO_FD.") DECLARE_DEBUG_VARIABLE(bool, AllowOpenFdOperations, false, "When enabled driver is allowed to call DRM_IOCTL_PRIME_HANDLE_TO_FD.")
DECLARE_DEBUG_VARIABLE(bool, EnableFreeMemory, false, "Enable freeMemory in memory manager") DECLARE_DEBUG_VARIABLE(bool, EnableFreeMemory, false, "Enable freeMemory in memory manager")
DECLARE_DEBUG_VARIABLE(int32_t, EnableIntelVme, -1, "-1: default, 0: disabled, 1: Enables cl_intel_motion_estimation extension")
DECLARE_DEBUG_VARIABLE(int32_t, EnableIntelAdvancedVme, -1, "-1: default, 0: disabled, 1: Enables cl_intel_advanced_motion_estimation extension")
DECLARE_DEBUG_VARIABLE(int32_t, EnableBlitterOperationsForReadWriteBuffers, -1, "Use Blitter engine for Read/Write Buffers operations. -1: default, 0: disabled, 1: enabled") DECLARE_DEBUG_VARIABLE(int32_t, EnableBlitterOperationsForReadWriteBuffers, -1, "Use Blitter engine for Read/Write Buffers operations. -1: default, 0: disabled, 1: enabled")
DECLARE_DEBUG_VARIABLE(int32_t, EnableCacheFlushAfterWalker, -1, "-1: platform behavior, 0: disabled, 1: enabled. Adds dedicated cache flush command after WALKER command when surfaces used by kernel require to flush the cache") DECLARE_DEBUG_VARIABLE(int32_t, EnableCacheFlushAfterWalker, -1, "-1: platform behavior, 0: disabled, 1: enabled. Adds dedicated cache flush command after WALKER command when surfaces used by kernel require to flush the cache")
DECLARE_DEBUG_VARIABLE(int32_t, EnableLocalMemory, -1, "-1: default behavior, 0: disabled, 1: enabled, Allows allocating graphics memory in Local Memory") DECLARE_DEBUG_VARIABLE(int32_t, EnableLocalMemory, -1, "-1: default behavior, 0: disabled, 1: enabled, Allows allocating graphics memory in Local Memory")

View File

@ -451,7 +451,7 @@ TEST(DeviceGetCapsTest, givenEnablePackedYuvsetToFalseWhenCapsAreCreatedThenDevi
TEST(DeviceGetCapsTest, givenEnableVmeSetToTrueAndDeviceSupportsVmeWhenCapsAreCreatedThenDeviceReportsVmeExtensionAndBuiltins) { TEST(DeviceGetCapsTest, givenEnableVmeSetToTrueAndDeviceSupportsVmeWhenCapsAreCreatedThenDeviceReportsVmeExtensionAndBuiltins) {
DebugManagerStateRestore dbgRestorer; DebugManagerStateRestore dbgRestorer;
DebugManager.flags.EnableIntelVme.set(true); DebugManager.flags.EnableIntelVme.set(1);
auto hwInfo = *platformDevices[0]; auto hwInfo = *platformDevices[0];
hwInfo.capabilityTable.supportsVme = true; hwInfo.capabilityTable.supportsVme = true;
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hwInfo)); auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hwInfo));
@ -464,24 +464,24 @@ TEST(DeviceGetCapsTest, givenEnableVmeSetToTrueAndDeviceSupportsVmeWhenCapsAreCr
EXPECT_THAT(caps.builtInKernels, testing::HasSubstr("block_motion_estimate_intel")); EXPECT_THAT(caps.builtInKernels, testing::HasSubstr("block_motion_estimate_intel"));
} }
TEST(DeviceGetCapsTest, givenEnableVmeSetToTrueAndDeviceDoesNotSupportVmeWhenCapsAreCreatedThenDeviceDoesNotReportVmeExtensionAndBuiltins) { TEST(DeviceGetCapsTest, givenEnableVmeSetToTrueAndDeviceDoesNotSupportVmeWhenCapsAreCreatedThenDeviceReportsVmeExtensionAndBuiltins) {
DebugManagerStateRestore dbgRestorer; DebugManagerStateRestore dbgRestorer;
DebugManager.flags.EnableIntelVme.set(true); DebugManager.flags.EnableIntelVme.set(1);
auto hwInfo = *platformDevices[0]; auto hwInfo = *platformDevices[0];
hwInfo.capabilityTable.supportsVme = false; hwInfo.capabilityTable.supportsVme = false;
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hwInfo)); auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hwInfo));
const auto &caps = device->getDeviceInfo(); const auto &caps = device->getDeviceInfo();
EXPECT_THAT(caps.deviceExtensions, testing::Not(testing::HasSubstr(std::string("cl_intel_motion_estimation")))); EXPECT_THAT(caps.deviceExtensions, testing::HasSubstr(std::string("cl_intel_motion_estimation")));
EXPECT_THAT(caps.deviceExtensions, testing::Not(testing::HasSubstr(std::string("cl_intel_device_side_avc_motion_estimation")))); EXPECT_THAT(caps.deviceExtensions, testing::HasSubstr(std::string("cl_intel_device_side_avc_motion_estimation")));
EXPECT_FALSE(caps.vmeExtension); EXPECT_TRUE(caps.vmeExtension);
EXPECT_THAT(caps.builtInKernels, testing::Not(testing::HasSubstr("block_motion_estimate_intel"))); EXPECT_THAT(caps.builtInKernels, testing::HasSubstr("block_motion_estimate_intel"));
} }
TEST(DeviceGetCapsTest, givenEnableVmeSetToFalseAndDeviceDoesNotSupportVmeWhenCapsAreCreatedThenDeviceDoesNotReportVmeExtensionAndBuiltins) { TEST(DeviceGetCapsTest, givenEnableVmeSetToFalseAndDeviceDoesNotSupportVmeWhenCapsAreCreatedThenDeviceDoesNotReportVmeExtensionAndBuiltins) {
DebugManagerStateRestore dbgRestorer; DebugManagerStateRestore dbgRestorer;
DebugManager.flags.EnableIntelVme.set(false); DebugManager.flags.EnableIntelVme.set(0);
auto hwInfo = *platformDevices[0]; auto hwInfo = *platformDevices[0];
hwInfo.capabilityTable.supportsVme = false; hwInfo.capabilityTable.supportsVme = false;
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hwInfo)); auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hwInfo));
@ -496,7 +496,7 @@ TEST(DeviceGetCapsTest, givenEnableVmeSetToFalseAndDeviceDoesNotSupportVmeWhenCa
TEST(DeviceGetCapsTest, givenEnableVmeSetToFalseAndDeviceSupportsVmeWhenCapsAreCreatedThenDeviceDoesNotReportVmeExtensionAndBuiltins) { TEST(DeviceGetCapsTest, givenEnableVmeSetToFalseAndDeviceSupportsVmeWhenCapsAreCreatedThenDeviceDoesNotReportVmeExtensionAndBuiltins) {
DebugManagerStateRestore dbgRestorer; DebugManagerStateRestore dbgRestorer;
DebugManager.flags.EnableIntelVme.set(false); DebugManager.flags.EnableIntelVme.set(0);
auto hwInfo = *platformDevices[0]; auto hwInfo = *platformDevices[0];
hwInfo.capabilityTable.supportsVme = true; hwInfo.capabilityTable.supportsVme = true;
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hwInfo)); auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hwInfo));
@ -511,7 +511,7 @@ TEST(DeviceGetCapsTest, givenEnableVmeSetToFalseAndDeviceSupportsVmeWhenCapsAreC
TEST(DeviceGetCapsTest, givenEnableAdvancedVmeSetToTrueAndDeviceSupportsVmeWhenCapsAreCreatedThenDeviceReportsAdvancedVmeExtensionAndBuiltins) { TEST(DeviceGetCapsTest, givenEnableAdvancedVmeSetToTrueAndDeviceSupportsVmeWhenCapsAreCreatedThenDeviceReportsAdvancedVmeExtensionAndBuiltins) {
DebugManagerStateRestore dbgRestorer; DebugManagerStateRestore dbgRestorer;
DebugManager.flags.EnableIntelAdvancedVme.set(true); DebugManager.flags.EnableIntelAdvancedVme.set(1);
auto hwInfo = *platformDevices[0]; auto hwInfo = *platformDevices[0];
hwInfo.capabilityTable.supportsVme = true; hwInfo.capabilityTable.supportsVme = true;
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hwInfo)); auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hwInfo));
@ -537,23 +537,23 @@ TEST(DeviceGetCapsTest, givenDeviceCapsSupportFor64BitAtomicsFollowsHardwareCapa
} }
} }
TEST(DeviceGetCapsTest, givenEnableAdvancedVmeSetToTrueAndDeviceDoesNotSupportVmeWhenCapsAreCreatedThenDeviceDoesNotReportAdvancedVmeExtensionAndBuiltins) { TEST(DeviceGetCapsTest, givenEnableAdvancedVmeSetToTrueAndDeviceDoesNotSupportVmeWhenCapsAreCreatedThenDeviceReportAdvancedVmeExtensionAndBuiltins) {
DebugManagerStateRestore dbgRestorer; DebugManagerStateRestore dbgRestorer;
DebugManager.flags.EnableIntelAdvancedVme.set(true); DebugManager.flags.EnableIntelAdvancedVme.set(1);
auto hwInfo = *platformDevices[0]; auto hwInfo = *platformDevices[0];
hwInfo.capabilityTable.supportsVme = false; hwInfo.capabilityTable.supportsVme = false;
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hwInfo)); auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hwInfo));
const auto &caps = device->getDeviceInfo(); const auto &caps = device->getDeviceInfo();
EXPECT_THAT(caps.deviceExtensions, testing::Not(testing::HasSubstr(std::string("cl_intel_advanced_motion_estimation")))); EXPECT_THAT(caps.deviceExtensions, testing::HasSubstr(std::string("cl_intel_advanced_motion_estimation")));
EXPECT_THAT(caps.builtInKernels, testing::Not(testing::HasSubstr("block_advanced_motion_estimate_check_intel"))); EXPECT_THAT(caps.builtInKernels, testing::HasSubstr("block_advanced_motion_estimate_check_intel"));
EXPECT_THAT(caps.builtInKernels, testing::Not(testing::HasSubstr("block_advanced_motion_estimate_bidirectional_check_intel"))); EXPECT_THAT(caps.builtInKernels, testing::HasSubstr("block_advanced_motion_estimate_bidirectional_check_intel"));
} }
TEST(DeviceGetCapsTest, givenEnableAdvancedVmeSetToFalseAndDeviceDoesNotSupportVmeWhenCapsAreCreatedThenDeviceDoesNotReportAdvancedVmeExtensionAndBuiltins) { TEST(DeviceGetCapsTest, givenEnableAdvancedVmeSetToFalseAndDeviceDoesNotSupportVmeWhenCapsAreCreatedThenDeviceDoesNotReportAdvancedVmeExtensionAndBuiltins) {
DebugManagerStateRestore dbgRestorer; DebugManagerStateRestore dbgRestorer;
DebugManager.flags.EnableIntelAdvancedVme.set(false); DebugManager.flags.EnableIntelAdvancedVme.set(0);
auto hwInfo = *platformDevices[0]; auto hwInfo = *platformDevices[0];
hwInfo.capabilityTable.supportsVme = false; hwInfo.capabilityTable.supportsVme = false;
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hwInfo)); auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hwInfo));
@ -567,7 +567,7 @@ TEST(DeviceGetCapsTest, givenEnableAdvancedVmeSetToFalseAndDeviceDoesNotSupportV
TEST(DeviceGetCapsTest, givenEnableAdvancedVmeSetToFalseAndDeviceSupportsVmeWhenCapsAreCreatedThenDeviceDoesNotReportAdvancedVmeExtensionAndBuiltins) { TEST(DeviceGetCapsTest, givenEnableAdvancedVmeSetToFalseAndDeviceSupportsVmeWhenCapsAreCreatedThenDeviceDoesNotReportAdvancedVmeExtensionAndBuiltins) {
DebugManagerStateRestore dbgRestorer; DebugManagerStateRestore dbgRestorer;
DebugManager.flags.EnableIntelAdvancedVme.set(false); DebugManager.flags.EnableIntelAdvancedVme.set(0);
auto hwInfo = *platformDevices[0]; auto hwInfo = *platformDevices[0];
hwInfo.capabilityTable.supportsVme = true; hwInfo.capabilityTable.supportsVme = true;
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hwInfo)); auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hwInfo));

View File

@ -23,8 +23,8 @@ EnableVaLibCalls = 1
EnableExtendedVaFormats = 0 EnableExtendedVaFormats = 0
EnableNV12 = 1 EnableNV12 = 1
EnablePackedYuv = 1 EnablePackedYuv = 1
EnableIntelVme = 1 EnableIntelVme = -1
EnableAdvancedIntelVme = 1 EnableAdvancedIntelVme = -1
DisableStatelessToStatefulOptimization = 0 DisableStatelessToStatefulOptimization = 0
ForceDispatchScheduler = 0 ForceDispatchScheduler = 0
PrintEMDebugInformation = 0 PrintEMDebugInformation = 0