performance: remove excessive ioctl call

Related-to: HSD-18039694684
Signed-off-by: Naklicki, Mateusz <mateusz.naklicki@intel.com>
This commit is contained in:
Naklicki, Mateusz
2024-09-03 23:04:04 +00:00
committed by Compute-Runtime-Automation
parent 8fab22f74b
commit 2db6955296
2 changed files with 3 additions and 7 deletions

View File

@@ -1530,7 +1530,7 @@ int Drm::bindBufferObject(OsContext *osContext, uint32_t vmHandleId, BufferObjec
errno = 0;
static_cast<DrmMemoryOperationsHandlerBind *>(this->rootDeviceEnvironment.memoryOperationsInterface.get())->evictUnusedAllocations(false, false);
ret = changeBufferObjectBinding(this, osContext, vmHandleId, bo, true);
if ((getErrno() == ENOMEM) && ioctlHelper->isPageFaultSupported()) {
if ((getErrno() == ENOMEM) && pageFaultSupported) {
DEBUG_BREAK_IF(true);
bo->setIsLockable(false);
ret = changeBufferObjectBinding(this, osContext, vmHandleId, bo, true);

View File

@@ -1138,11 +1138,6 @@ TEST(DrmBufferObjectHandleWrapperTest, GivenWrapperWhenMoveConstructingAnotherOb
}
TEST_F(DrmBufferObjectTest, givenDrmWhenBindOperationFailsWithENOMEMThenBindWithoutLockingIsTried) {
struct IoctlHelperPageFaultSupport : public MockIoctlHelper {
using MockIoctlHelper::MockIoctlHelper;
bool isPageFaultSupported() override { return true; }
};
auto executionEnvironment = new ExecutionEnvironment;
executionEnvironment->setDebuggingMode(NEO::DebuggingMode::online);
executionEnvironment->prepareRootDeviceEnvironments(1);
@@ -1153,8 +1148,9 @@ TEST_F(DrmBufferObjectTest, givenDrmWhenBindOperationFailsWithENOMEMThenBindWith
auto drm = new DrmMock(*executionEnvironment->rootDeviceEnvironments[0]);
drm->requirePerContextVM = false;
drm->isVMBindImmediateSupported = true;
drm->pageFaultSupported = true;
auto ioctlHelper = std::make_unique<IoctlHelperPageFaultSupport>(*drm);
auto ioctlHelper = std::make_unique<MockIoctlHelper>(*drm);
ioctlHelper->vmBindResult = -1;
ioctlHelper->isWaitBeforeBindRequiredResult = true;
drm->ioctlHelper.reset(ioctlHelper.release());