mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-22 10:17:01 +08:00
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>
29 lines
836 B
C++
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
|