mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 14:55:24 +08:00
Remove redundant mock class
Related-To: NEO-6852 Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
4d6169ee8b
commit
cd2f36db5f
@@ -16,6 +16,7 @@ void Ioctls::reset() {
|
||||
execbuffer2 = 0;
|
||||
gemUserptr = 0;
|
||||
gemCreate = 0;
|
||||
gemCreateExt = 0;
|
||||
gemSetTiling = 0;
|
||||
gemGetTiling = 0;
|
||||
gemVmCreate = 0;
|
||||
@@ -46,6 +47,7 @@ void DrmMockCustom::testIoctls() {
|
||||
NEO_IOCTL_EXPECT_EQ(execbuffer2);
|
||||
NEO_IOCTL_EXPECT_EQ(gemUserptr);
|
||||
NEO_IOCTL_EXPECT_EQ(gemCreate);
|
||||
NEO_IOCTL_EXPECT_EQ(gemCreateExt);
|
||||
NEO_IOCTL_EXPECT_EQ(gemSetTiling);
|
||||
NEO_IOCTL_EXPECT_EQ(gemGetTiling);
|
||||
NEO_IOCTL_EXPECT_EQ(primeFdToHandle);
|
||||
@@ -187,6 +189,17 @@ int DrmMockCustom::ioctl(DrmIoctl request, void *arg) {
|
||||
return -1;
|
||||
}
|
||||
} break;
|
||||
case DrmIoctl::GemCreateExt: {
|
||||
auto createExtParams = reinterpret_cast<drm_i915_gem_create_ext *>(arg);
|
||||
createExtSize = createExtParams->size;
|
||||
createExtHandle = createExtParams->handle;
|
||||
createExtExtensions = createExtParams->extensions;
|
||||
ioctl_cnt.gemCreateExt++;
|
||||
} break;
|
||||
case DrmIoctl::GemVmBind: {
|
||||
} break;
|
||||
case DrmIoctl::GemVmUnbind: {
|
||||
} break;
|
||||
default:
|
||||
int res = ioctlExtra(request, arg);
|
||||
if (returnIoctlExtraErrorValue) {
|
||||
|
||||
@@ -38,6 +38,7 @@ class Ioctls {
|
||||
std::atomic<int32_t> execbuffer2;
|
||||
std::atomic<int32_t> gemUserptr;
|
||||
std::atomic<int32_t> gemCreate;
|
||||
std::atomic<int32_t> gemCreateExt;
|
||||
std::atomic<int32_t> gemSetTiling;
|
||||
std::atomic<int32_t> gemGetTiling;
|
||||
std::atomic<int32_t> gemVmCreate;
|
||||
@@ -214,6 +215,11 @@ class DrmMockCustom : public Drm {
|
||||
bool failOnMmapOffset = false;
|
||||
bool failOnPrimeFdToHandle = false;
|
||||
|
||||
//DRM_IOCTL_I915_GEM_CREATE_EXT
|
||||
uint64_t createExtSize = 0;
|
||||
uint32_t createExtHandle = 0;
|
||||
uint64_t createExtExtensions = 0;
|
||||
|
||||
int errnoValue = 0;
|
||||
|
||||
bool returnIoctlExtraErrorValue = false;
|
||||
|
||||
@@ -13,16 +13,6 @@
|
||||
|
||||
int DrmMockCustomPrelimContext::ioctlExtra(DrmIoctl request, void *arg) {
|
||||
switch (request) {
|
||||
case DrmIoctl::GemCreateExt: {
|
||||
auto createExtParams = reinterpret_cast<prelim_drm_i915_gem_create_ext *>(arg);
|
||||
createExtSize = createExtParams->size;
|
||||
createExtHandle = createExtParams->handle;
|
||||
createExtExtensions = createExtParams->extensions;
|
||||
} break;
|
||||
case DrmIoctl::GemVmBind: {
|
||||
} break;
|
||||
case DrmIoctl::GemVmUnbind: {
|
||||
} break;
|
||||
case DrmIoctl::GemWaitUserFence: {
|
||||
const auto wait = reinterpret_cast<prelim_drm_i915_gem_wait_user_fence *>(arg);
|
||||
receivedGemWaitUserFence = WaitUserFence{
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2020-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "shared/test/common/os_interface/linux/device_command_stream_fixture.h"
|
||||
|
||||
class DrmMockCustomImpl : public DrmMockCustom {
|
||||
public:
|
||||
using Drm::memoryInfo;
|
||||
|
||||
class Ioctls {
|
||||
public:
|
||||
void reset() {
|
||||
gemCreateExt = 0;
|
||||
gemMmapOffset = 0;
|
||||
}
|
||||
std::atomic<int32_t> gemCreateExt;
|
||||
std::atomic<int32_t> gemMmapOffset;
|
||||
};
|
||||
|
||||
Ioctls ioctlImpl_cnt;
|
||||
Ioctls ioctlImpl_expected;
|
||||
|
||||
void testIoctls() {
|
||||
#define NEO_IOCTL_EXPECT_EQ(PARAM) \
|
||||
if (this->ioctlImpl_expected.PARAM >= 0) { \
|
||||
EXPECT_EQ(this->ioctlImpl_expected.PARAM, this->ioctlImpl_cnt.PARAM); \
|
||||
}
|
||||
NEO_IOCTL_EXPECT_EQ(gemMmapOffset);
|
||||
#undef NEO_IOCTL_EXPECT_EQ
|
||||
}
|
||||
|
||||
//DRM_IOCTL_I915_GEM_CREATE_EXT
|
||||
__u64 createExtSize = 0;
|
||||
__u32 createExtHandle = 0;
|
||||
__u64 createExtExtensions = 0;
|
||||
|
||||
int ioctlExtra(DrmIoctl request, void *arg) override {
|
||||
switch (request) {
|
||||
case DrmIoctl::GemCreateExt: {
|
||||
auto createExtParams = reinterpret_cast<drm_i915_gem_create_ext *>(arg);
|
||||
createExtSize = createExtParams->size;
|
||||
createExtHandle = createExtParams->handle;
|
||||
createExtExtensions = createExtParams->extensions;
|
||||
ioctlImpl_cnt.gemCreateExt++;
|
||||
} break;
|
||||
default: {
|
||||
UNRECOVERABLE_IF(true);
|
||||
} break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
DrmMockCustomImpl(RootDeviceEnvironment &rootDeviceEnvironment) : DrmMockCustom(rootDeviceEnvironment) {
|
||||
ioctlImpl_cnt.reset();
|
||||
ioctlImpl_expected.reset();
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user