From d44f3009b80bffb8910a8a3ee3add9a4a2bd20db Mon Sep 17 00:00:00 2001 From: Zbigniew Zdanowicz Date: Wed, 19 Jan 2022 18:14:10 +0000 Subject: [PATCH] Add interface for user fence extension Related-To: NEO-6575 Signed-off-by: Zbigniew Zdanowicz --- .../linux/drm_buffer_object_tests.cpp | 10 ++--- .../test/unit_test/test_files/igdrcl.config | 1 + .../debug_settings/debug_variables_base.inl | 1 + .../linux/drm_direct_submission.inl | 6 ++- .../source/os_interface/linux/CMakeLists.txt | 1 + .../os_interface/linux/drm_buffer_object.cpp | 17 ++++--- .../os_interface/linux/drm_buffer_object.h | 5 ++- .../os_interface/linux/drm_command_stream.inl | 11 ++++- .../os_interface/linux/drm_memory_manager.cpp | 44 +++++++++++++++++-- .../os_interface/linux/drm_memory_manager.h | 4 +- shared/source/os_interface/linux/drm_neo.cpp | 4 ++ shared/source/os_interface/linux/drm_neo.h | 8 +++- .../source/os_interface/linux/ioctl_helper.h | 5 +++ .../linux/ioctl_helper_prelim_extended.cpp | 18 ++++++++ .../linux/ioctl_helper_upstream.cpp | 4 ++ shared/test/common/libult/linux/drm_mock.h | 1 + 16 files changed, 118 insertions(+), 22 deletions(-) create mode 100644 shared/source/os_interface/linux/ioctl_helper_prelim_extended.cpp diff --git a/opencl/test/unit_test/os_interface/linux/drm_buffer_object_tests.cpp b/opencl/test/unit_test/os_interface/linux/drm_buffer_object_tests.cpp index c19f9469bb..8e8d5f03cb 100644 --- a/opencl/test/unit_test/os_interface/linux/drm_buffer_object_tests.cpp +++ b/opencl/test/unit_test/os_interface/linux/drm_buffer_object_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -82,7 +82,7 @@ TEST_F(DrmBufferObjectTest, WhenCallingExecThenReturnIsCorrect) { mock->ioctl_res = 0; drm_i915_gem_exec_object2 execObjectsStorage = {}; - auto ret = bo->exec(0, 0, 0, false, osContext.get(), 0, 1, nullptr, 0u, &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(0u, mock->execBuffer.flags); } @@ -92,7 +92,7 @@ TEST_F(DrmBufferObjectTest, GivenInvalidParamsWhenCallingExecThenEfaultIsReturne mock->ioctl_res = -1; mock->errnoValue = EFAULT; drm_i915_gem_exec_object2 execObjectsStorage = {}; - EXPECT_EQ(EFAULT, bo->exec(0, 0, 0, false, osContext.get(), 0, 1, nullptr, 0u, &execObjectsStorage)); + EXPECT_EQ(EFAULT, bo->exec(0, 0, 0, false, osContext.get(), 0, 1, nullptr, 0u, &execObjectsStorage, 0, 0)); } TEST_F(DrmBufferObjectTest, WhenSettingTilingThenCallSucceeds) { @@ -225,7 +225,7 @@ TEST_F(DrmBufferObjectTest, whenPrintExecutionBufferIsSetToTrueThenMessageFoundI drm_i915_gem_exec_object2 execObjectsStorage = {}; testing::internal::CaptureStdout(); - auto ret = bo->exec(0, 0, 0, false, osContext.get(), 0, 1, nullptr, 0u, &execObjectsStorage); + auto ret = bo->exec(0, 0, 0, false, osContext.get(), 0, 1, nullptr, 0u, &execObjectsStorage, 0, 0); EXPECT_EQ(0, ret); std::string output = testing::internal::GetCapturedStdout(); @@ -413,7 +413,7 @@ TEST(DrmBufferObject, givenDrmIoctlReturnsErrorNotSupportedThenBufferObjectRetur osContext.reset(new OsContextLinux(*drm, 0u, EngineDescriptorHelper::getDefaultDescriptor())); drm_i915_gem_exec_object2 execObjectsStorage = {}; - auto ret = bo.exec(0, 0, 0, false, osContext.get(), 0, 1, nullptr, 0u, &execObjectsStorage); + auto ret = bo.exec(0, 0, 0, false, osContext.get(), 0, 1, nullptr, 0u, &execObjectsStorage, 0, 0); EXPECT_NE(0, ret); } diff --git a/opencl/test/unit_test/test_files/igdrcl.config b/opencl/test/unit_test/test_files/igdrcl.config index 4936534b3e..3d25e8f768 100644 --- a/opencl/test/unit_test/test_files/igdrcl.config +++ b/opencl/test/unit_test/test_files/igdrcl.config @@ -364,6 +364,7 @@ AddStatePrefetchCmdToMemoryPrefetchAPI = -1 UpdateCrossThreadDataSize = 0 ForceBcsEngineIndex = -1 ResolveDependenciesViaPipeControls = -1 +EnableDrmCompletionFence = -1 ExperimentalEnableSourceLevelDebugger = 0 Force2dImageAsArray = -1 ForceExtendedBufferSize = -1 \ No newline at end of file diff --git a/shared/source/debug_settings/debug_variables_base.inl b/shared/source/debug_settings/debug_variables_base.inl index 2151c7fd57..0f719bb430 100644 --- a/shared/source/debug_settings/debug_variables_base.inl +++ b/shared/source/debug_settings/debug_variables_base.inl @@ -342,6 +342,7 @@ DECLARE_DEBUG_VARIABLE(int32_t, Force32BitDriverSupport, -1, "-1: default, 0: di DECLARE_DEBUG_VARIABLE(int32_t, OverrideSystolicPipelineSelect, -1, "set SYSTOLIC MODE ENABLE in PIPELINE_SELECT cmd, -1:default, 0:disable, 1:enable") DECLARE_DEBUG_VARIABLE(int32_t, OverrideSystolicInComputeWalker, -1, "set SYSTOLIC MODE ENABLE in COMPUTE_WALKER cmd, -1:default, 0:disable, 1:enable") DECLARE_DEBUG_VARIABLE(int32_t, AddStatePrefetchCmdToMemoryPrefetchAPI, -1, "Add STATE_PREFETCH to zeCommandListAppendMemoryPrefetch, -1:default, 0:disable, 1:enable") +DECLARE_DEBUG_VARIABLE(int32_t, EnableDrmCompletionFence, -1, "Enables DRM completion fence, -1:default (disabled), 0:disable, 1:enable") /*EXPERIMENTAL TOGGLES*/ DECLARE_DEBUG_VARIABLE(int32_t, ExperimentalSetWalkerPartitionCount, 0, "Experimental implementation: Set number of COMPUTE_WALKERs for a given Partition Type, 0 - do not set the feature.") diff --git a/shared/source/direct_submission/linux/drm_direct_submission.inl b/shared/source/direct_submission/linux/drm_direct_submission.inl index e5fbf1cedc..01fd68f457 100644 --- a/shared/source/direct_submission/linux/drm_direct_submission.inl +++ b/shared/source/direct_submission/linux/drm_direct_submission.inl @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Intel Corporation + * Copyright (C) 2020-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -93,7 +93,9 @@ bool DrmDirectSubmission::submit(uint64_t gpuAddress, siz drmContextIds[drmContextId], nullptr, 0, - &execObject); + &execObject, + 0, + 0); drmContextId++; } } diff --git a/shared/source/os_interface/linux/CMakeLists.txt b/shared/source/os_interface/linux/CMakeLists.txt index f46097dc37..93ff0b8017 100644 --- a/shared/source/os_interface/linux/CMakeLists.txt +++ b/shared/source/os_interface/linux/CMakeLists.txt @@ -51,6 +51,7 @@ set(NEO_CORE_OS_INTERFACE_LINUX ${CMAKE_CURRENT_SOURCE_DIR}/ioctl_helper.cpp ${CMAKE_CURRENT_SOURCE_DIR}/ioctl_helper_prelim.cpp ${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}ioctl_helper_getter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}ioctl_helper_prelim_extended.cpp ${CMAKE_CURRENT_SOURCE_DIR}/engine_info.h ${CMAKE_CURRENT_SOURCE_DIR}/engine_info.cpp ${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}engine_info_extended.cpp diff --git a/shared/source/os_interface/linux/drm_buffer_object.cpp b/shared/source/os_interface/linux/drm_buffer_object.cpp index 1861b5a190..c0793ae3f2 100644 --- a/shared/source/os_interface/linux/drm_buffer_object.cpp +++ b/shared/source/os_interface/linux/drm_buffer_object.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -12,6 +12,7 @@ #include "shared/source/os_interface/linux/drm_memory_manager.h" #include "shared/source/os_interface/linux/drm_memory_operations_handler.h" #include "shared/source/os_interface/linux/drm_neo.h" +#include "shared/source/os_interface/linux/ioctl_helper.h" #include "shared/source/os_interface/linux/os_context_linux.h" #include "shared/source/os_interface/linux/os_time_linux.h" #include "shared/source/os_interface/os_context.h" @@ -128,7 +129,8 @@ void BufferObject::fillExecObject(drm_i915_gem_exec_object2 &execObject, OsConte this->fillExecObjectImpl(execObject, osContext, vmHandleId); } -int BufferObject::exec(uint32_t used, size_t startOffset, unsigned int flags, bool requiresCoherency, OsContext *osContext, uint32_t vmHandleId, uint32_t drmContextId, BufferObject *const residency[], size_t residencyCount, drm_i915_gem_exec_object2 *execObjectsStorage) { +int BufferObject::exec(uint32_t used, size_t startOffset, unsigned int flags, bool requiresCoherency, OsContext *osContext, uint32_t vmHandleId, uint32_t drmContextId, + BufferObject *const residency[], size_t residencyCount, drm_i915_gem_exec_object2 *execObjectsStorage, uint64_t completionGpuAddress, uint32_t completionValue) { for (size_t i = 0; i < residencyCount; i++) { residency[i]->fillExecObject(execObjectsStorage[i], osContext, vmHandleId, drmContextId); } @@ -149,7 +151,8 @@ int BufferObject::exec(uint32_t used, size_t startOffset, unsigned int flags, bo printExecutionBuffer(execbuf, residencyCount, execObjectsStorage, residency); } - int ret = this->drm->ioctl(DRM_IOCTL_I915_GEM_EXECBUFFER2, &execbuf); + auto *ioctlHelper = IoctlHelper::get(drm); + int ret = ioctlHelper->execBuffer(drm, &execbuf, completionGpuAddress, completionValue); if (ret != 0) { int err = this->drm->getErrno(); @@ -159,12 +162,12 @@ int BufferObject::exec(uint32_t used, size_t startOffset, unsigned int flags, bo } static_cast(this->drm->getRootDeviceEnvironment().memoryOperationsInterface.get())->evictUnusedAllocations(false, true); - ret = this->drm->ioctl(DRM_IOCTL_I915_GEM_EXECBUFFER2, &execbuf); + ret = ioctlHelper->execBuffer(drm, &execbuf, completionGpuAddress, completionValue); } if (ret != 0) { static_cast(this->drm->getRootDeviceEnvironment().memoryOperationsInterface.get())->evictUnusedAllocations(true, true); - ret = this->drm->ioctl(DRM_IOCTL_I915_GEM_EXECBUFFER2, &execbuf); + ret = ioctlHelper->execBuffer(drm, &execbuf, completionGpuAddress, completionValue); } if (ret == 0) { @@ -259,7 +262,7 @@ int BufferObject::pin(BufferObject *const boToPin[], size_t numberOfBos, OsConte retVal = bindBOsWithinContext(boToPin, numberOfBos, osContext, vmHandleId); } else { StackVec execObject(numberOfBos + 1); - retVal = this->exec(4u, 0u, 0u, false, osContext, vmHandleId, drmContextId, boToPin, numberOfBos, &execObject[0]); + retVal = this->exec(4u, 0u, 0u, false, osContext, vmHandleId, drmContextId, boToPin, numberOfBos, &execObject[0], 0, 0); } return retVal; @@ -277,7 +280,7 @@ int BufferObject::validateHostPtr(BufferObject *const boToPin[], size_t numberOf } } else { StackVec execObject(numberOfBos + 1); - retVal = this->exec(4u, 0u, 0u, false, osContext, vmHandleId, drmContextId, boToPin, numberOfBos, &execObject[0]); + retVal = this->exec(4u, 0u, 0u, false, osContext, vmHandleId, drmContextId, boToPin, numberOfBos, &execObject[0], 0, 0); } return retVal; diff --git a/shared/source/os_interface/linux/drm_buffer_object.h b/shared/source/os_interface/linux/drm_buffer_object.h index 6ff562a9a2..50577ec25d 100644 --- a/shared/source/os_interface/linux/drm_buffer_object.h +++ b/shared/source/os_interface/linux/drm_buffer_object.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -46,7 +46,8 @@ class BufferObject { int pin(BufferObject *const boToPin[], size_t numberOfBos, OsContext *osContext, uint32_t vmHandleId, uint32_t drmContextId); MOCKABLE_VIRTUAL int validateHostPtr(BufferObject *const boToPin[], size_t numberOfBos, OsContext *osContext, uint32_t vmHandleId, uint32_t drmContextId); - int exec(uint32_t used, size_t startOffset, unsigned int flags, bool requiresCoherency, OsContext *osContext, uint32_t vmHandleId, uint32_t drmContextId, BufferObject *const residency[], size_t residencyCount, drm_i915_gem_exec_object2 *execObjectsStorage); + int exec(uint32_t used, size_t startOffset, unsigned int flags, bool requiresCoherency, OsContext *osContext, uint32_t vmHandleId, uint32_t drmContextId, + BufferObject *const residency[], size_t residencyCount, drm_i915_gem_exec_object2 *execObjectsStorage, uint64_t completionGpuAddress, uint32_t completionValue); int bind(OsContext *osContext, uint32_t vmHandleId); int unbind(OsContext *osContext, uint32_t vmHandleId); diff --git a/shared/source/os_interface/linux/drm_command_stream.inl b/shared/source/os_interface/linux/drm_command_stream.inl index d7ba9f61c5..c87953caa3 100644 --- a/shared/source/os_interface/linux/drm_command_stream.inl +++ b/shared/source/os_interface/linux/drm_command_stream.inl @@ -193,6 +193,13 @@ int DrmCommandStreamReceiver::exec(const BatchBuffer &batchBuffer, ui this->execObjectsStorage.resize(requiredSize); } + uint64_t completionGpuAddress = 0; + uint32_t completionValue = 0; + if (this->drm->completionFenceSupport()) { + completionGpuAddress = getTagAllocation()->getGpuAddress() + Drm::completionFenceOffset; + completionValue = this->latestSentTaskCount; + } + int ret = bb->exec(static_cast(alignUp(batchBuffer.usedSize - batchBuffer.startOffset, 8)), batchBuffer.startOffset, execFlags, batchBuffer.requiresCoherency, @@ -200,7 +207,9 @@ int DrmCommandStreamReceiver::exec(const BatchBuffer &batchBuffer, ui vmHandleId, drmContextId, this->residency.data(), this->residency.size(), - this->execObjectsStorage.data()); + this->execObjectsStorage.data(), + completionGpuAddress, + completionValue); this->residency.clear(); diff --git a/shared/source/os_interface/linux/drm_memory_manager.cpp b/shared/source/os_interface/linux/drm_memory_manager.cpp index 2cccc200d2..47157e8d6c 100644 --- a/shared/source/os_interface/linux/drm_memory_manager.cpp +++ b/shared/source/os_interface/linux/drm_memory_manager.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -806,8 +806,13 @@ void DrmMemoryManager::freeGraphicsMemoryImpl(GraphicsAllocation *gfxAllocation) } void DrmMemoryManager::handleFenceCompletion(GraphicsAllocation *allocation) { - if (this->getDrm(allocation->getRootDeviceIndex()).isVmBindAvailable()) { - waitForEnginesCompletion(*allocation); + auto &drm = this->getDrm(allocation->getRootDeviceIndex()); + if (drm.isVmBindAvailable()) { + if (drm.completionFenceSupport()) { + waitOnCompletionFence(allocation); + } else { + waitForEnginesCompletion(*allocation); + } } else { static_cast(allocation)->getBO()->wait(-1); } @@ -1460,4 +1465,37 @@ bool DrmMemoryManager::retrieveMmapOffsetForBufferObject(uint32_t rootDeviceInde return true; } +bool DrmMemoryManager::allocationTypeForCompletionFence(GraphicsAllocation::AllocationType allocationType) { + if (allocationType == GraphicsAllocation::AllocationType::COMMAND_BUFFER || + allocationType == GraphicsAllocation::AllocationType::RING_BUFFER || + allocationType == GraphicsAllocation::AllocationType::SEMAPHORE_BUFFER || + allocationType == GraphicsAllocation::AllocationType::TAG_BUFFER) { + return true; + } + return false; +} + +void DrmMemoryManager::waitOnCompletionFence(GraphicsAllocation *allocation) { + auto allocationType = allocation->getAllocationType(); + if (allocationTypeForCompletionFence(allocationType)) { + for (auto &engine : getRegisteredEngines()) { + OsContext *osContext = engine.osContext; + CommandStreamReceiver *csr = engine.commandStreamReceiver; + + auto osContextId = osContext->getContextId(); + auto allocationTaskCount = allocation->getTaskCount(osContextId); + uint64_t completionFenceAddress = castToUint64(const_cast(csr->getTagAddress())) + Drm::completionFenceOffset; + + if (allocation->isUsedByOsContext(osContextId)) { + uint32_t ctxId = static_cast(osContext)->getDrmContextIds()[0]; + constexpr int64_t timeout = -1; + constexpr uint16_t flags = 0; + getDrm(csr->getRootDeviceIndex()).waitUserFence(ctxId, completionFenceAddress, allocationTaskCount, Drm::ValueWidth::U32, timeout, flags); + } + } + } else { + waitForEnginesCompletion(*allocation); + } +} + } // namespace NEO diff --git a/shared/source/os_interface/linux/drm_memory_manager.h b/shared/source/os_interface/linux/drm_memory_manager.h index d1c909b21d..e00160ad70 100644 --- a/shared/source/os_interface/linux/drm_memory_manager.h +++ b/shared/source/os_interface/linux/drm_memory_manager.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -118,6 +118,8 @@ class DrmMemoryManager : public MemoryManager { GraphicsAllocation *allocateGraphicsMemoryInDevicePool(const AllocationData &allocationData, AllocationStatus &status) override; bool createDrmAllocation(Drm *drm, DrmAllocation *allocation, uint64_t gpuAddress, size_t maxOsContextCount); void registerAllocationInOs(GraphicsAllocation *allocation) override; + void waitOnCompletionFence(GraphicsAllocation *allocation); + bool allocationTypeForCompletionFence(GraphicsAllocation::AllocationType allocationType); Drm &getDrm(uint32_t rootDeviceIndex) const; uint32_t getRootDeviceIndex(const Drm *drm); diff --git a/shared/source/os_interface/linux/drm_neo.cpp b/shared/source/os_interface/linux/drm_neo.cpp index 43091428fb..a9e29d372d 100644 --- a/shared/source/os_interface/linux/drm_neo.cpp +++ b/shared/source/os_interface/linux/drm_neo.cpp @@ -197,6 +197,10 @@ Drm::Drm(std::unique_ptr &&hwDeviceIdIn, RootDeviceEnvironment &r hwDeviceId(std::move(hwDeviceIdIn)), rootDeviceEnvironment(rootDeviceEnvironment) { pagingFence.fill(0u); fenceVal.fill(0u); + int32_t overrideCompletionFence = DebugManager.flags.EnableDrmCompletionFence.get(); + if (overrideCompletionFence != -1) { + completionFenceSupported = !!overrideCompletionFence; + } } int Drm::ioctl(unsigned long request, void *arg) { diff --git a/shared/source/os_interface/linux/drm_neo.h b/shared/source/os_interface/linux/drm_neo.h index 8f93192bd0..19835a7549 100644 --- a/shared/source/os_interface/linux/drm_neo.h +++ b/shared/source/os_interface/linux/drm_neo.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -69,6 +69,7 @@ class Drm : public DriverModel { public: static constexpr DriverModelType driverModelType = DriverModelType::DRM; + static constexpr size_t completionFenceOffset = 1024; enum class ResourceClass : uint32_t { Elf, @@ -251,6 +252,10 @@ class Drm : public DriverModel { } MOCKABLE_VIRTUAL std::vector getMemoryRegions(); + bool completionFenceSupport() const { + return completionFenceSupported; + } + protected: Drm(std::unique_ptr &&hwDeviceIdIn, RootDeviceEnvironment &rootDeviceEnvironment); @@ -333,6 +338,7 @@ class Drm : public DriverModel { bool directSubmissionActive = false; bool contextDebugSupported = false; bool pageFaultSupported = false; + bool completionFenceSupported = false; private: int getParamIoctl(int param, int *dstValue); diff --git a/shared/source/os_interface/linux/ioctl_helper.h b/shared/source/os_interface/linux/ioctl_helper.h index bac0de6b9a..fa1c35de44 100644 --- a/shared/source/os_interface/linux/ioctl_helper.h +++ b/shared/source/os_interface/linux/ioctl_helper.h @@ -14,6 +14,8 @@ #include struct drm_i915_query_item; +struct drm_i915_gem_execbuffer2; + namespace NEO { class Drm; class IoctlHelper; @@ -71,6 +73,7 @@ class IoctlHelper { virtual std::vector translateToEngineCaps(const std::vector &data) = 0; virtual uint32_t queryDistances(Drm *drm, std::vector &queryItems, std::vector &distanceInfos) = 0; virtual int32_t getComputeEngineClass() = 0; + virtual int execBuffer(Drm *drm, drm_i915_gem_execbuffer2 *execBuffer, uint64_t completionGpuAddress, uint32_t counterValue) = 0; }; class IoctlHelperUpstream : public IoctlHelper { @@ -92,6 +95,7 @@ class IoctlHelperUpstream : public IoctlHelper { std::vector translateToEngineCaps(const std::vector &data) override; uint32_t queryDistances(Drm *drm, std::vector &queryItems, std::vector &distanceInfos) override; int32_t getComputeEngineClass() override; + int execBuffer(Drm *drm, drm_i915_gem_execbuffer2 *execBuffer, uint64_t completionGpuAddress, uint32_t counterValue) override; }; template @@ -124,6 +128,7 @@ class IoctlHelperPrelim20 : public IoctlHelper { std::vector translateToEngineCaps(const std::vector &data) override; uint32_t queryDistances(Drm *drm, std::vector &queryItems, std::vector &distanceInfos) override; int32_t getComputeEngineClass() override; + int execBuffer(Drm *drm, drm_i915_gem_execbuffer2 *execBuffer, uint64_t completionGpuAddress, uint32_t counterValue) override; }; } // namespace NEO diff --git a/shared/source/os_interface/linux/ioctl_helper_prelim_extended.cpp b/shared/source/os_interface/linux/ioctl_helper_prelim_extended.cpp new file mode 100644 index 0000000000..97a9de3e7c --- /dev/null +++ b/shared/source/os_interface/linux/ioctl_helper_prelim_extended.cpp @@ -0,0 +1,18 @@ +/* + * Copyright (C) 2022 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "shared/source/os_interface/linux/ioctl_helper.h" + +#include "third_party/uapi/prelim/drm/i915_drm.h" + +namespace NEO { + +int IoctlHelperPrelim20::execBuffer(Drm *drm, drm_i915_gem_execbuffer2 *execBuffer, uint64_t completionGpuAddress, uint32_t counterValue) { + return ioctl(drm, DRM_IOCTL_I915_GEM_EXECBUFFER2, execBuffer); +} + +} // namespace NEO diff --git a/shared/source/os_interface/linux/ioctl_helper_upstream.cpp b/shared/source/os_interface/linux/ioctl_helper_upstream.cpp index 3bc7826a34..a743214a63 100644 --- a/shared/source/os_interface/linux/ioctl_helper_upstream.cpp +++ b/shared/source/os_interface/linux/ioctl_helper_upstream.cpp @@ -130,4 +130,8 @@ int32_t IoctlHelperUpstream::getComputeEngineClass() { return 4; } +int IoctlHelperUpstream::execBuffer(Drm *drm, drm_i915_gem_execbuffer2 *execBuffer, uint64_t completionGpuAddress, uint32_t counterValue) { + return ioctl(drm, DRM_IOCTL_I915_GEM_EXECBUFFER2, execBuffer); +} + } // namespace NEO diff --git a/shared/test/common/libult/linux/drm_mock.h b/shared/test/common/libult/linux/drm_mock.h index 527d981eaa..2e13fbfbb8 100644 --- a/shared/test/common/libult/linux/drm_mock.h +++ b/shared/test/common/libult/linux/drm_mock.h @@ -27,6 +27,7 @@ class DrmMock : public Drm { using Drm::cacheInfo; using Drm::checkQueueSliceSupport; using Drm::classHandles; + using Drm::completionFenceSupported; using Drm::contextDebugSupported; using Drm::createDrmContextExt; using Drm::engineInfo;