Don't use VM when ppGTT is invalid/unassigned

Signed-off-by: Jan Beich <jbeich@FreeBSD.org>
This commit is contained in:
Jan Beich
2020-09-20 15:41:43 +00:00
committed by Compute-Runtime-Automation
parent dd27f0ffa9
commit bb6ed003e8
2 changed files with 8 additions and 0 deletions

View File

@@ -49,6 +49,10 @@ 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) {
if (ctl.vm_id == 0) {
// 0 is reserved for invalid/unassigned ppgtt
return -1;
}
drmVmId = ctl.vm_id;
}
return ret;

View File

@@ -65,6 +65,10 @@ 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) {
if (ctl.vm_id == 0) {
// 0 is reserved for invalid/unassigned ppgtt
return -1;
}
drmVmId = ctl.vm_id;
}
return ret;