Skip to content

Commit

Permalink
Merge pull request #4097 from Sonicadvance1/linux_v6.11_drm
Browse files Browse the repository at this point in the history
LinuxEmulation: Update DRM for v6.11
  • Loading branch information
lioncash authored Oct 4, 2024
2 parents 2726f35 + 0c8cfa7 commit c036868
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 14 deletions.
7 changes: 5 additions & 2 deletions Scripts/StructPackVerifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@
# C++2a std::bit_cast expression.
CursorKind.BUILTINBITCASTEXPR = CursorKind(280)

# a concept declaration.
CursorKind.CONCEPTDECL = CursorKind(604),
try:
# a concept declaration.
CursorKind.CONCEPTDECL = CursorKind(604),
except:
pass

@dataclass
class TypeDefinition:
Expand Down
2 changes: 2 additions & 0 deletions Source/Tools/LinuxEmulation/LinuxSyscalls/x32/Ioctl/drm.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ extern "C" {
#include "fex-drm/radeon_drm.h"
#include "fex-drm/vc4_drm.h"
#include "fex-drm/v3d_drm.h"
#include "fex-drm/panthor_drm.h"
#include "fex-drm/pvr_drm.h"
#include "fex-drm/virtgpu_drm.h"
#include "fex-drm/xe_drm.h"
Expand Down Expand Up @@ -1278,6 +1279,7 @@ namespace V3D {
#include "LinuxSyscalls/x32/Ioctl/radeon_drm.inl"
#include "LinuxSyscalls/x32/Ioctl/vc4_drm.inl"
#include "LinuxSyscalls/x32/Ioctl/v3d_drm.inl"
#include "LinuxSyscalls/x32/Ioctl/panthor_drm.inl"
#include "LinuxSyscalls/x32/Ioctl/pvr_drm.inl"
#include "LinuxSyscalls/x32/Ioctl/xe_drm.inl"
} // namespace FEX::HLE::x32
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
_BASIC_META(DRM_IOCTL_PANTHOR_DEV_QUERY)
_BASIC_META(DRM_IOCTL_PANTHOR_VM_CREATE)
_BASIC_META(DRM_IOCTL_PANTHOR_VM_DESTROY)
_BASIC_META(DRM_IOCTL_PANTHOR_VM_BIND)
_BASIC_META(DRM_IOCTL_PANTHOR_VM_GET_STATE)
_BASIC_META(DRM_IOCTL_PANTHOR_BO_CREATE)
_BASIC_META(DRM_IOCTL_PANTHOR_BO_MMAP_OFFSET)
_BASIC_META(DRM_IOCTL_PANTHOR_GROUP_CREATE)
_BASIC_META(DRM_IOCTL_PANTHOR_GROUP_DESTROY)
_BASIC_META(DRM_IOCTL_PANTHOR_GROUP_SUBMIT)
_BASIC_META(DRM_IOCTL_PANTHOR_GROUP_GET_STATE)
_BASIC_META(DRM_IOCTL_PANTHOR_TILER_HEAP_CREATE)
_BASIC_META(DRM_IOCTL_PANTHOR_TILER_HEAP_DESTROY)
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ _BASIC_META(DRM_IOCTL_V3D_PERFMON_CREATE)
_BASIC_META(DRM_IOCTL_V3D_PERFMON_DESTROY)
_BASIC_META(DRM_IOCTL_V3D_PERFMON_GET_VALUES)
_BASIC_META(DRM_IOCTL_V3D_SUBMIT_CPU)
_BASIC_META(DRM_IOCTL_V3D_PERFMON_GET_COUNTER)
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ _BASIC_META(DRM_IOCTL_XE_EXEC_QUEUE_DESTROY)
_BASIC_META(DRM_IOCTL_XE_EXEC_QUEUE_GET_PROPERTY)
_BASIC_META(DRM_IOCTL_XE_EXEC)
_BASIC_META(DRM_IOCTL_XE_WAIT_USER_FENCE)
_BASIC_META(DRM_IOCTL_XE_OBSERVATION)
27 changes: 16 additions & 11 deletions Source/Tools/LinuxEmulation/LinuxSyscalls/x32/IoctlEmulation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -577,28 +577,32 @@ namespace DRM {

void AssignDeviceTypeToFD(int fd, const drm_version& Version) {
if (Version.name) {
if (strncmp(Version.name, "amdgpu", Version.name_len) == 0) {
const std::string_view Name(Version.name, Version.name_len);
if (Name == "amdgpu") {
FDToHandler.SetFDHandler(fd, AMDGPU_Handler);
} else if (strncmp(Version.name, "radeon", Version.name_len) == 0) {
} else if (Name == "radeon") {
FDToHandler.SetFDHandler(fd, RADEON_Handler);
} else if (strncmp(Version.name, "msm", Version.name_len) == 0) {
} else if (Name == "msm") {
FDToHandler.SetFDHandler(fd, MSM_Handler);
} else if (strncmp(Version.name, "nouveau", Version.name_len) == 0) {
} else if (Name == "nouveau") {
FDToHandler.SetFDHandler(fd, Nouveau_Handler);
} else if (strncmp(Version.name, "i915", Version.name_len) == 0) {
} else if (Name == "i915") {
FDToHandler.SetFDHandler(fd, I915_Handler);
} else if (strncmp(Version.name, "panfrost", Version.name_len) == 0) {
} else if (Name == "panfrost") {
FDToHandler.SetFDHandler(fd, Panfrost_Handler);
} else if (strncmp(Version.name, "lima", Version.name_len) == 0) {
} else if (Name == "lima") {
FDToHandler.SetFDHandler(fd, Lima_Handler);
} else if (strncmp(Version.name, "vc4", Version.name_len) == 0) {
} else if (Name == "vc4") {
FDToHandler.SetFDHandler(fd, VC4_Handler);
} else if (strncmp(Version.name, "v3d", Version.name_len) == 0) {
} else if (Name == "v3d") {
FDToHandler.SetFDHandler(fd, V3D_Handler);
} else if (strncmp(Version.name, "virtio_gpu", Version.name_len) == 0) {
} else if (Name == "virtio_gpu") {
FDToHandler.SetFDHandler(fd, Virtio_Handler);
} else {
LogMan::Msg::IFmt("Unknown DRM device: '{}'. Using default passthrough", Version.name);
// Known safe drm drivers.
if (!(Name == "asahi" || Name == "panthor" || Name == "xe")) {
LogMan::Msg::IFmt("Unknown DRM device: '{}'. Using default passthrough", Version.name);
}
FDToHandler.SetFDHandler(fd, Default_Handler);
}
}
Expand Down Expand Up @@ -730,6 +734,7 @@ std::array<HandlerType, 1U << _IOC_TYPEBITS> Handlers = []() consteval {
#include "LinuxSyscalls/x32/Ioctl/vc4_drm.inl"
#include "LinuxSyscalls/x32/Ioctl/v3d_drm.inl"
#include "LinuxSyscalls/x32/Ioctl/virtio_drm.inl"
#include "LinuxSyscalls/x32/Ioctl/panthor_drm.inl"
#include "LinuxSyscalls/x32/Ioctl/pvr_drm.inl"
#include "LinuxSyscalls/x32/Ioctl/xe_drm.inl"

Expand Down

0 comments on commit c036868

Please sign in to comment.