mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-05 09:09:04 +08:00
refactor: correct naming of DrmIoctl enums
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
9121209c41
commit
cff6c81be0
@@ -50,7 +50,7 @@ int DrmMock::ioctl(DrmIoctl request, void *arg) {
|
||||
ioctlCallsCount++;
|
||||
ioctlCount.total++;
|
||||
|
||||
if ((request == DrmIoctl::Getparam) && (arg != nullptr)) {
|
||||
if ((request == DrmIoctl::getparam) && (arg != nullptr)) {
|
||||
ioctlCount.contextGetParam++;
|
||||
auto gp = static_cast<GetParam *>(arg);
|
||||
if (gp->param == I915_PARAM_EU_TOTAL) {
|
||||
@@ -107,7 +107,7 @@ int DrmMock::ioctl(DrmIoctl request, void *arg) {
|
||||
}
|
||||
}
|
||||
|
||||
if ((request == DrmIoctl::GemContextCreateExt) && (arg != nullptr)) {
|
||||
if ((request == DrmIoctl::gemContextCreateExt) && (arg != nullptr)) {
|
||||
ioctlCount.contextCreate++;
|
||||
auto create = static_cast<GemContextCreateExt *>(arg);
|
||||
create->contextId = this->storedDrmContextId;
|
||||
@@ -127,7 +127,7 @@ int DrmMock::ioctl(DrmIoctl request, void *arg) {
|
||||
}
|
||||
}
|
||||
|
||||
if ((request == DrmIoctl::GemVmCreate) && (arg != nullptr)) {
|
||||
if ((request == DrmIoctl::gemVmCreate) && (arg != nullptr)) {
|
||||
ioctlCount.gemVmCreate++;
|
||||
auto gemVmControl = static_cast<GemVmControl *>(arg);
|
||||
receivedGemVmControl = *gemVmControl;
|
||||
@@ -135,20 +135,20 @@ int DrmMock::ioctl(DrmIoctl request, void *arg) {
|
||||
return storedRetValForVmCreate;
|
||||
}
|
||||
|
||||
if ((request == DrmIoctl::GemVmDestroy) && (arg != nullptr)) {
|
||||
if ((request == DrmIoctl::gemVmDestroy) && (arg != nullptr)) {
|
||||
ioctlCount.gemVmDestroy++;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ((request == DrmIoctl::GemContextDestroy) && (arg != nullptr)) {
|
||||
if ((request == DrmIoctl::gemContextDestroy) && (arg != nullptr)) {
|
||||
ioctlCount.contextDestroy++;
|
||||
auto destroy = static_cast<GemContextDestroy *>(arg);
|
||||
this->receivedDestroyContextId = destroy->contextId;
|
||||
return this->storedRetVal;
|
||||
}
|
||||
|
||||
if ((request == DrmIoctl::GemContextSetparam) && (arg != nullptr)) {
|
||||
if ((request == DrmIoctl::gemContextSetparam) && (arg != nullptr)) {
|
||||
ioctlCount.contextSetParam++;
|
||||
receivedContextParamRequestCount++;
|
||||
receivedContextParamRequest = *static_cast<GemContextParam *>(arg);
|
||||
@@ -178,7 +178,7 @@ int DrmMock::ioctl(DrmIoctl request, void *arg) {
|
||||
}
|
||||
}
|
||||
|
||||
if ((request == DrmIoctl::GemContextGetparam) && (arg != nullptr)) {
|
||||
if ((request == DrmIoctl::gemContextGetparam) && (arg != nullptr)) {
|
||||
ioctlCount.contextGetParam++;
|
||||
receivedContextParamRequestCount++;
|
||||
receivedContextParamRequest = *static_cast<GemContextParam *>(arg);
|
||||
@@ -206,7 +206,7 @@ int DrmMock::ioctl(DrmIoctl request, void *arg) {
|
||||
}
|
||||
}
|
||||
|
||||
if (request == DrmIoctl::GemExecbuffer2) {
|
||||
if (request == DrmIoctl::gemExecbuffer2) {
|
||||
ioctlCount.execbuffer2++;
|
||||
auto execbuf = static_cast<NEO::MockExecBuffer *>(arg);
|
||||
auto execObjects = reinterpret_cast<const MockExecObject *>(execbuf->getBuffersPtr());
|
||||
@@ -216,14 +216,14 @@ int DrmMock::ioctl(DrmIoctl request, void *arg) {
|
||||
}
|
||||
return execBufferResult;
|
||||
}
|
||||
if (request == DrmIoctl::GemUserptr) {
|
||||
if (request == DrmIoctl::gemUserptr) {
|
||||
ioctlCount.gemUserptr++;
|
||||
auto userPtrParams = static_cast<NEO::GemUserPtr *>(arg);
|
||||
userPtrParams->handle = returnHandle;
|
||||
returnHandle++;
|
||||
return 0;
|
||||
}
|
||||
if (request == DrmIoctl::GemCreate) {
|
||||
if (request == DrmIoctl::gemCreate) {
|
||||
ioctlCount.gemCreate++;
|
||||
auto createParams = static_cast<NEO::GemCreate *>(arg);
|
||||
this->createParamsSize = createParams->size;
|
||||
@@ -233,7 +233,7 @@ int DrmMock::ioctl(DrmIoctl request, void *arg) {
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
if (request == DrmIoctl::GemSetTiling) {
|
||||
if (request == DrmIoctl::gemSetTiling) {
|
||||
ioctlCount.gemSetTiling++;
|
||||
auto setTilingParams = static_cast<NEO::GemSetTiling *>(arg);
|
||||
setTilingMode = setTilingParams->tilingMode;
|
||||
@@ -241,7 +241,7 @@ int DrmMock::ioctl(DrmIoctl request, void *arg) {
|
||||
setTilingStride = setTilingParams->stride;
|
||||
return 0;
|
||||
}
|
||||
if (request == DrmIoctl::PrimeFdToHandle) {
|
||||
if (request == DrmIoctl::primeFdToHandle) {
|
||||
ioctlCount.primeFdToHandle++;
|
||||
auto primeToHandleParams = static_cast<PrimeHandle *>(arg);
|
||||
// return BO
|
||||
@@ -249,22 +249,22 @@ int DrmMock::ioctl(DrmIoctl request, void *arg) {
|
||||
inputFd = primeToHandleParams->fileDescriptor;
|
||||
return fdToHandleRetVal;
|
||||
}
|
||||
if (request == DrmIoctl::PrimeHandleToFd) {
|
||||
if (request == DrmIoctl::primeHandleToFd) {
|
||||
ioctlCount.handleToPrimeFd++;
|
||||
auto primeToFdParams = static_cast<PrimeHandle *>(arg);
|
||||
primeToFdParams->fileDescriptor = outputFd;
|
||||
return 0;
|
||||
}
|
||||
if (request == DrmIoctl::GemWait) {
|
||||
if (request == DrmIoctl::gemWait) {
|
||||
ioctlCount.gemWait++;
|
||||
receivedGemWait = *static_cast<GemWait *>(arg);
|
||||
return 0;
|
||||
}
|
||||
if (request == DrmIoctl::GemClose) {
|
||||
if (request == DrmIoctl::gemClose) {
|
||||
ioctlCount.gemClose++;
|
||||
return storedRetValForGemClose;
|
||||
}
|
||||
if (request == DrmIoctl::GetResetStats && arg != nullptr) {
|
||||
if (request == DrmIoctl::getResetStats && arg != nullptr) {
|
||||
ioctlCount.gemResetStats++;
|
||||
auto outResetStats = static_cast<ResetStats *>(arg);
|
||||
for (const auto &resetStats : resetStatsToReturn) {
|
||||
@@ -277,7 +277,7 @@ int DrmMock::ioctl(DrmIoctl request, void *arg) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (request == DrmIoctl::Query && arg != nullptr) {
|
||||
if (request == DrmIoctl::query && arg != nullptr) {
|
||||
ioctlCount.query++;
|
||||
auto queryArg = static_cast<Query *>(arg);
|
||||
auto queryItemArg = reinterpret_cast<QueryItem *>(queryArg->itemsPtr);
|
||||
@@ -319,7 +319,7 @@ int DrmMock::waitUserFence(uint32_t ctxIdx, uint64_t address, uint64_t value, Va
|
||||
return Drm::waitUserFence(ctxIdx, address, value, dataWidth, timeout, flags);
|
||||
}
|
||||
int DrmMockEngine::handleRemainingRequests(DrmIoctl request, void *arg) {
|
||||
if ((request == DrmIoctl::Query) && (arg != nullptr)) {
|
||||
if ((request == DrmIoctl::query) && (arg != nullptr)) {
|
||||
if (i915QuerySuccessCount == 0) {
|
||||
return EINVAL;
|
||||
}
|
||||
|
||||
@@ -337,7 +337,7 @@ class DrmMockReturnErrorNotSupported : public DrmMock {
|
||||
public:
|
||||
using DrmMock::DrmMock;
|
||||
int ioctl(DrmIoctl request, void *arg) override {
|
||||
if (request == DrmIoctl::GemExecbuffer2) {
|
||||
if (request == DrmIoctl::gemExecbuffer2) {
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
|
||||
@@ -39,7 +39,7 @@ constexpr std::array<uint64_t, 9> copyEnginesCapsMap = {{
|
||||
|
||||
int DrmMockPrelimContext::handlePrelimRequest(DrmIoctl request, void *arg) {
|
||||
switch (request) {
|
||||
case DrmIoctl::Getparam: {
|
||||
case DrmIoctl::getparam: {
|
||||
auto gp = static_cast<GetParam *>(arg);
|
||||
if (gp->param == PRELIM_I915_PARAM_HAS_PAGE_FAULT) {
|
||||
*gp->value = hasPageFaultQueryValue;
|
||||
@@ -58,14 +58,14 @@ int DrmMockPrelimContext::handlePrelimRequest(DrmIoctl request, void *arg) {
|
||||
return chunkingQueryReturn;
|
||||
}
|
||||
} break;
|
||||
case DrmIoctl::GemContextGetparam: {
|
||||
case DrmIoctl::gemContextGetparam: {
|
||||
auto gp = static_cast<GemContextParam *>(arg);
|
||||
if (gp->param == PRELIM_I915_CONTEXT_PARAM_DEBUG_FLAGS) {
|
||||
gp->value = contextDebugSupported ? PRELIM_I915_CONTEXT_PARAM_DEBUG_FLAG_SIP << 32 : 0;
|
||||
return 0;
|
||||
}
|
||||
} break;
|
||||
case DrmIoctl::GemContextCreateExt: {
|
||||
case DrmIoctl::gemContextCreateExt: {
|
||||
auto create = static_cast<GemContextCreateExt *>(arg);
|
||||
auto setParam = reinterpret_cast<GemContextCreateExtSetParam *>(create->extensions);
|
||||
if (setParam->param.param == PRELIM_I915_CONTEXT_PARAM_ACC) {
|
||||
@@ -76,12 +76,12 @@ int DrmMockPrelimContext::handlePrelimRequest(DrmIoctl request, void *arg) {
|
||||
}
|
||||
return 0;
|
||||
} break;
|
||||
case DrmIoctl::GemMmapOffset: {
|
||||
case DrmIoctl::gemMmapOffset: {
|
||||
auto mmapArg = static_cast<GemMmapOffset *>(arg);
|
||||
mmapArg->offset = 0;
|
||||
return mmapOffsetReturn;
|
||||
} break;
|
||||
case DrmIoctl::GemClosReserve: {
|
||||
case DrmIoctl::gemClosReserve: {
|
||||
auto closReserveArg = static_cast<prelim_drm_i915_gem_clos_reserve *>(arg);
|
||||
closIndex++;
|
||||
if (closIndex == 0) {
|
||||
@@ -90,7 +90,7 @@ int DrmMockPrelimContext::handlePrelimRequest(DrmIoctl request, void *arg) {
|
||||
closReserveArg->clos_index = closIndex;
|
||||
return 0;
|
||||
} break;
|
||||
case DrmIoctl::GemClosFree: {
|
||||
case DrmIoctl::gemClosFree: {
|
||||
auto closFreeArg = static_cast<prelim_drm_i915_gem_clos_free *>(arg);
|
||||
if (closFreeArg->clos_index > closIndex) {
|
||||
return EINVAL;
|
||||
@@ -98,7 +98,7 @@ int DrmMockPrelimContext::handlePrelimRequest(DrmIoctl request, void *arg) {
|
||||
closIndex--;
|
||||
return 0;
|
||||
} break;
|
||||
case DrmIoctl::GemCacheReserve: {
|
||||
case DrmIoctl::gemCacheReserve: {
|
||||
auto cacheReserveArg = static_cast<prelim_drm_i915_gem_cache_reserve *>(arg);
|
||||
if (cacheReserveArg->clos_index > closIndex) {
|
||||
return EINVAL;
|
||||
@@ -114,7 +114,7 @@ int DrmMockPrelimContext::handlePrelimRequest(DrmIoctl request, void *arg) {
|
||||
allocNumWays += cacheReserveArg->num_ways;
|
||||
return 0;
|
||||
} break;
|
||||
case DrmIoctl::GemVmBind: {
|
||||
case DrmIoctl::gemVmBind: {
|
||||
vmBindCalled++;
|
||||
const auto vmBind = reinterpret_cast<prelim_drm_i915_gem_vm_bind *>(arg);
|
||||
receivedVmBind = VmBindParams{
|
||||
@@ -129,7 +129,7 @@ int DrmMockPrelimContext::handlePrelimRequest(DrmIoctl request, void *arg) {
|
||||
storeVmBindExtensions(vmBind->extensions, true);
|
||||
return vmBindReturn;
|
||||
} break;
|
||||
case DrmIoctl::GemVmUnbind: {
|
||||
case DrmIoctl::gemVmUnbind: {
|
||||
vmUnbindCalled++;
|
||||
const auto vmBind = reinterpret_cast<prelim_drm_i915_gem_vm_bind *>(arg);
|
||||
receivedVmUnbind = VmBindParams{
|
||||
@@ -144,7 +144,7 @@ int DrmMockPrelimContext::handlePrelimRequest(DrmIoctl request, void *arg) {
|
||||
storeVmBindExtensions(vmBind->extensions, false);
|
||||
return vmUnbindReturn;
|
||||
} break;
|
||||
case DrmIoctl::GemCreateExt: {
|
||||
case DrmIoctl::gemCreateExt: {
|
||||
auto createExt = static_cast<prelim_drm_i915_gem_create_ext *>(arg);
|
||||
if (createExt->size == 0) {
|
||||
return EINVAL;
|
||||
@@ -206,7 +206,7 @@ int DrmMockPrelimContext::handlePrelimRequest(DrmIoctl request, void *arg) {
|
||||
|
||||
return gemCreateExtReturn;
|
||||
} break;
|
||||
case DrmIoctl::GemWaitUserFence: {
|
||||
case DrmIoctl::gemWaitUserFence: {
|
||||
waitUserFenceCalled++;
|
||||
const auto wait = reinterpret_cast<prelim_drm_i915_gem_wait_user_fence *>(arg);
|
||||
receivedWaitUserFence = WaitUserFence{
|
||||
@@ -221,7 +221,7 @@ int DrmMockPrelimContext::handlePrelimRequest(DrmIoctl request, void *arg) {
|
||||
};
|
||||
return 0;
|
||||
} break;
|
||||
case DrmIoctl::GemContextSetparam: {
|
||||
case DrmIoctl::gemContextSetparam: {
|
||||
const auto req = reinterpret_cast<GemContextParam *>(arg);
|
||||
if (req->param == PRELIM_I915_CONTEXT_PARAM_DEBUG_FLAGS) {
|
||||
receivedSetContextParamValue = req->value;
|
||||
@@ -230,7 +230,7 @@ int DrmMockPrelimContext::handlePrelimRequest(DrmIoctl request, void *arg) {
|
||||
|
||||
return !contextDebugSupported ? EINVAL : 0;
|
||||
} break;
|
||||
case DrmIoctl::GemVmAdvise: {
|
||||
case DrmIoctl::gemVmAdvise: {
|
||||
const auto req = reinterpret_cast<prelim_drm_i915_gem_vm_advise *>(arg);
|
||||
switch (req->attribute) {
|
||||
case PRELIM_I915_VM_ADVISE_ATOMIC_NONE:
|
||||
@@ -244,13 +244,13 @@ int DrmMockPrelimContext::handlePrelimRequest(DrmIoctl request, void *arg) {
|
||||
}
|
||||
return vmAdviseReturn;
|
||||
} break;
|
||||
case DrmIoctl::GemVmPrefetch: {
|
||||
case DrmIoctl::gemVmPrefetch: {
|
||||
const auto req = static_cast<prelim_drm_i915_gem_vm_prefetch *>(arg);
|
||||
vmPrefetchCalled++;
|
||||
receivedVmPrefetch.push_back(VmPrefetch{req->vm_id, req->region});
|
||||
return 0;
|
||||
} break;
|
||||
case DrmIoctl::UuidRegister: {
|
||||
case DrmIoctl::uuidRegister: {
|
||||
auto uuidControl = reinterpret_cast<prelim_drm_i915_uuid_control *>(arg);
|
||||
|
||||
if (uuidControl->uuid_class != uint32_t(PRELIM_I915_UUID_CLASS_STRING) && uuidControl->uuid_class > uuidHandle) {
|
||||
@@ -271,7 +271,7 @@ int DrmMockPrelimContext::handlePrelimRequest(DrmIoctl request, void *arg) {
|
||||
memcpy_s(receivedRegisterUuid->uuid, sizeof(receivedRegisterUuid->uuid), uuidControl->uuid, sizeof(uuidControl->uuid));
|
||||
return uuidControlReturn;
|
||||
} break;
|
||||
case DrmIoctl::UuidUnregister: {
|
||||
case DrmIoctl::uuidUnregister: {
|
||||
auto uuidControl = reinterpret_cast<prelim_drm_i915_uuid_control *>(arg);
|
||||
receivedUnregisterUuid = UuidControl{
|
||||
{},
|
||||
@@ -286,7 +286,7 @@ int DrmMockPrelimContext::handlePrelimRequest(DrmIoctl request, void *arg) {
|
||||
return uuidControlReturn;
|
||||
} break;
|
||||
|
||||
case DrmIoctl::DebuggerOpen: {
|
||||
case DrmIoctl::debuggerOpen: {
|
||||
auto debuggerOpen = reinterpret_cast<prelim_drm_i915_debugger_open_param *>(arg);
|
||||
if (debuggerOpen->pid != 0 && debuggerOpen->events == 0) {
|
||||
if (debuggerOpen->version != 0) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Intel Corporation
|
||||
* Copyright (C) 2022-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -24,7 +24,7 @@ DrmQueryMock::DrmQueryMock(RootDeviceEnvironment &rootDeviceEnvironment) : DrmMo
|
||||
}
|
||||
|
||||
int DrmQueryMock::handleRemainingRequests(DrmIoctl request, void *arg) {
|
||||
if (request == DrmIoctl::Query && arg) {
|
||||
if (request == DrmIoctl::query && arg) {
|
||||
if (i915QuerySuccessCount == 0) {
|
||||
return EINVAL;
|
||||
}
|
||||
@@ -43,7 +43,7 @@ int DrmQueryMock::handleRemainingRequests(DrmIoctl request, void *arg) {
|
||||
}
|
||||
|
||||
return 0;
|
||||
} else if (request == DrmIoctl::GemContextSetparam && receivedContextParamRequest.param == I915_CONTEXT_PARAM_ENGINES) {
|
||||
} else if (request == DrmIoctl::gemContextSetparam && receivedContextParamRequest.param == I915_CONTEXT_PARAM_ENGINES) {
|
||||
EXPECT_LE(receivedContextParamRequest.size, sizeof(receivedContextParamEngines));
|
||||
memcpy(&receivedContextParamEngines, reinterpret_cast<const void *>(receivedContextParamRequest.value), receivedContextParamRequest.size);
|
||||
auto srcBalancer = reinterpret_cast<const I915::i915_context_engines_load_balance *>(receivedContextParamEngines.extensions);
|
||||
|
||||
Reference in New Issue
Block a user