Move common ioctl request values to common method

Related-To: NEO-7028
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2022-06-01 18:53:00 +00:00
committed by Compute-Runtime-Automation
parent c4bb209f91
commit bb71f92ca9
4 changed files with 53 additions and 88 deletions

View File

@ -234,53 +234,10 @@ bool IoctlHelperUpstream::isDebugAttachAvailable() {
unsigned int IoctlHelperUpstream::getIoctlRequestValue(DrmIoctl ioctlRequest) {
switch (ioctlRequest) {
case DrmIoctl::GemExecbuffer2:
return DRM_IOCTL_I915_GEM_EXECBUFFER2;
case DrmIoctl::GemWait:
return DRM_IOCTL_I915_GEM_WAIT;
case DrmIoctl::GemClose:
return DRM_IOCTL_GEM_CLOSE;
case DrmIoctl::GemUserptr:
return DRM_IOCTL_I915_GEM_USERPTR;
case DrmIoctl::GemCreate:
return DRM_IOCTL_I915_GEM_CREATE;
case DrmIoctl::GemCreateExt:
return DRM_IOCTL_I915_GEM_CREATE_EXT;
case DrmIoctl::GemSetDomain:
return DRM_IOCTL_I915_GEM_SET_DOMAIN;
case DrmIoctl::GemSetTiling:
return DRM_IOCTL_I915_GEM_SET_TILING;
case DrmIoctl::GemGetTiling:
return DRM_IOCTL_I915_GEM_GET_TILING;
case DrmIoctl::GemContextCreateExt:
return DRM_IOCTL_I915_GEM_CONTEXT_CREATE_EXT;
case DrmIoctl::GemContextDestroy:
return DRM_IOCTL_I915_GEM_CONTEXT_DESTROY;
case DrmIoctl::RegRead:
return DRM_IOCTL_I915_REG_READ;
case DrmIoctl::GetResetStats:
return DRM_IOCTL_I915_GET_RESET_STATS;
case DrmIoctl::GemContextGetparam:
return DRM_IOCTL_I915_GEM_CONTEXT_GETPARAM;
case DrmIoctl::GemContextSetparam:
return DRM_IOCTL_I915_GEM_CONTEXT_SETPARAM;
case DrmIoctl::Query:
return DRM_IOCTL_I915_QUERY;
case DrmIoctl::GemMmap:
return DRM_IOCTL_I915_GEM_MMAP;
case DrmIoctl::PrimeFdToHandle:
return DRM_IOCTL_PRIME_FD_TO_HANDLE;
case DrmIoctl::PrimeHandleToFd:
return DRM_IOCTL_PRIME_HANDLE_TO_FD;
case DrmIoctl::GemMmapOffset:
return DRM_IOCTL_I915_GEM_MMAP_OFFSET;
case DrmIoctl::GemVmCreate:
return DRM_IOCTL_I915_GEM_VM_CREATE;
case DrmIoctl::GemVmDestroy:
return DRM_IOCTL_I915_GEM_VM_DESTROY;
default:
UNRECOVERABLE_IF(true);
return 0u;
return getIoctlRequestValueBase(ioctlRequest);
}
}