Files
compute-runtime/shared/source/os_interface/linux/xe/drm_version_xe.cpp
Mateusz Jablonski 50b8069d41 feature: add optional support for Xe drm driver
xe_drm.h header is taken from commit 9cb016ebbb6a275f57b1cb512b95d5a842391ad7
https://cgit.freedesktop.org/drm/drm-xe/tree/include/uapi/drm/xe_drm.h

Related-To: NEO-7578

Co-authored-by: Philippe Lecluse <philippe.lecluse@intel.com>
Co-authored-by: Francois Dugast <francois.dugast@intel.com>

Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2023-01-16 11:32:49 +01:00

29 lines
836 B
C++

/*
* Copyright (C) 2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/os_interface/linux/drm_neo.h"
#include "shared/source/os_interface/linux/xe/ioctl_helper_xe.h"
namespace NEO {
bool Drm::isDrmSupported(int fileDescriptor) {
auto drmVersion = Drm::getDrmVersion(fileDescriptor);
return "i915" == drmVersion || "xe" == drmVersion;
}
bool Drm::queryDeviceIdAndRevision() {
auto drmVersion = Drm::getDrmVersion(getFileDescriptor());
if ("xe" == drmVersion) {
this->ioctlHelper = std::make_unique<IoctlHelperXe>(*this);
auto xeIoctlHelperPtr = static_cast<IoctlHelperXe *>(this->ioctlHelper.get());
this->setPerContextVMRequired(false);
return xeIoctlHelperPtr->initialize();
}
return queryI915DeviceIdAndRevision();
}
} // namespace NEO