mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-09 06:23:01 +08:00
Return same fd handle on multiple calls to peekHandle
Signed-off-by: Jaime Arteaga <jaime.a.arteaga.molina@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
f0f545eee7
commit
623c9afdfa
@@ -231,6 +231,7 @@ class DrmMock : public Drm {
|
||||
int fdToHandleRetVal = 0;
|
||||
//DRM_IOCTL_HANDLE_TO_FD
|
||||
int32_t outputFd = 0;
|
||||
bool incrementOutputFdAfterCall = false;
|
||||
//DRM_IOCTL_I915_GEM_USERPTR
|
||||
uint32_t returnHandle = 0;
|
||||
uint64_t gpuMemSize = 3u * MemoryConstants::gigaByte;
|
||||
|
||||
@@ -124,6 +124,9 @@ int DrmMockCustom::ioctl(DrmIoctl request, void *arg) {
|
||||
inputHandle = handleToPrimeParams->handle;
|
||||
inputFlags = handleToPrimeParams->flags;
|
||||
handleToPrimeParams->fileDescriptor = outputFd;
|
||||
if (incrementOutputFdAfterCall) {
|
||||
outputFd++;
|
||||
}
|
||||
ioctl_cnt.handleToPrimeFd++;
|
||||
} break;
|
||||
case DrmIoctl::GemSetDomain: {
|
||||
|
||||
@@ -191,6 +191,7 @@ class DrmMockCustom : public Drm {
|
||||
//DRM_IOCTL_PRIME_HANDLE_TO_FD
|
||||
uint32_t inputHandle = 0;
|
||||
int32_t outputFd = 0;
|
||||
bool incrementOutputFdAfterCall = false;
|
||||
int32_t inputFlags = 0;
|
||||
//DRM_IOCTL_I915_GEM_USERPTR
|
||||
uint32_t returnHandle = 0;
|
||||
|
||||
Reference in New Issue
Block a user