2019-03-19 13:53:55 +01:00
|
|
|
/*
|
2022-01-03 14:16:00 +00:00
|
|
|
* Copyright (C) 2020-2022 Intel Corporation
|
2019-03-19 13:53:55 +01:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
2021-03-16 17:47:26 +00:00
|
|
|
#include "shared/source/os_interface/linux/sys_calls.h"
|
2019-06-17 13:56:03 +02:00
|
|
|
|
2019-03-19 13:53:55 +01:00
|
|
|
#include "drm_neo.h"
|
2020-04-10 13:54:07 +02:00
|
|
|
|
2019-03-26 11:59:46 +01:00
|
|
|
namespace NEO {
|
2019-03-19 13:53:55 +01:00
|
|
|
|
2021-03-16 17:47:26 +00:00
|
|
|
int Drm::createDrmVirtualMemory(uint32_t &drmVmId) {
|
|
|
|
|
drm_i915_gem_vm_control ctl = {};
|
|
|
|
|
auto ret = SysCalls::ioctl(getFileDescriptor(), DRM_IOCTL_I915_GEM_VM_CREATE, &ctl);
|
|
|
|
|
if (ret == 0) {
|
2020-09-20 15:41:43 +00:00
|
|
|
if (ctl.vm_id == 0) {
|
|
|
|
|
// 0 is reserved for invalid/unassigned ppgtt
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
2021-03-16 17:47:26 +00:00
|
|
|
drmVmId = ctl.vm_id;
|
|
|
|
|
}
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
|
2021-10-27 12:43:46 +00:00
|
|
|
bool Drm::isDebugAttachAvailable() {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int Drm::bindBufferObject(OsContext *osContext, uint32_t vmHandleId, BufferObject *bo) {
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int Drm::unbindBufferObject(OsContext *osContext, uint32_t vmHandleId, BufferObject *bo) {
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2019-03-26 11:59:46 +01:00
|
|
|
} // namespace NEO
|