mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-20 08:53:55 +08:00
performance: remove excessive ioctl call
Related-to: HSD-18039694684 Signed-off-by: Naklicki, Mateusz <mateusz.naklicki@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
8fab22f74b
commit
2db6955296
@@ -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);
|
||||
|
||||
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user