-
Notifications
You must be signed in to change notification settings - Fork 229
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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>
- Loading branch information
1 parent
6dd7feb
commit 50b8069
Showing
8 changed files
with
3,105 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# | ||
# Copyright (C) 2023 Intel Corporation | ||
# | ||
# SPDX-License-Identifier: MIT | ||
# | ||
|
||
if(NEO_ENABLE_XE_DRM_DETECTION) | ||
set(NEO_CORE_OS_INTERFACE_LINUX_XE | ||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt | ||
${CMAKE_CURRENT_SOURCE_DIR}/drm_version_xe.cpp | ||
${CMAKE_CURRENT_SOURCE_DIR}/ioctl_helper_xe.cpp | ||
${CMAKE_CURRENT_SOURCE_DIR}/ioctl_helper_xe.h | ||
) | ||
|
||
set_property(GLOBAL APPEND PROPERTY NEO_CORE_OS_INTERFACE_LINUX ${NEO_CORE_OS_INTERFACE_LINUX_XE}) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* 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 |
Oops, something went wrong.