Create enum for Ioctl request values

Related-To: NEO-6852
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2022-05-25 17:05:52 +00:00
committed by Compute-Runtime-Automation
parent 0bf3af37d3
commit b3814e41b4
44 changed files with 606 additions and 464 deletions

View File

@@ -39,13 +39,8 @@ class DrmMockForWorker : public Drm {
std::atomic<std::thread::id> ioctl_caller_thread_id;
DrmMockForWorker(RootDeviceEnvironment &rootDeviceEnvironment) : Drm(std::make_unique<HwDeviceIdDrm>(mockFd, mockPciPath), rootDeviceEnvironment) {
}
int ioctl(unsigned long request, void *arg) override {
if (_IOC_TYPE(request) == DRM_IOCTL_BASE) {
//when drm ioctl is called, try acquire mutex
//main thread can hold mutex, to prevent ioctl handling
std::lock_guard<std::mutex> lock(mutex);
}
if (request == DRM_IOCTL_GEM_CLOSE)
int ioctl(DrmIoctl request, void *arg) override {
if (request == DrmIoctl::GemClose)
gem_close_cnt++;
ioctl_caller_thread_id = std::this_thread::get_id();