diff --git a/External/drm-headers b/External/drm-headers index 34a20394f7..8efb6dc03f 160000 --- a/External/drm-headers +++ b/External/drm-headers @@ -1 +1 @@ -Subproject commit 34a20394f712bfa8eaacafa01b27759e246ee1d7 +Subproject commit 8efb6dc03fef5dacec1aab989f067ce6f82f0710 diff --git a/Scripts/StructPackVerifier.py b/Scripts/StructPackVerifier.py index 4716e79763..c8c534b29a 100755 --- a/Scripts/StructPackVerifier.py +++ b/Scripts/StructPackVerifier.py @@ -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: diff --git a/Source/Tools/LinuxEmulation/LinuxSyscalls/x32/Ioctl/drm.h b/Source/Tools/LinuxEmulation/LinuxSyscalls/x32/Ioctl/drm.h index 521179b6f5..478b27fdd0 100644 --- a/Source/Tools/LinuxEmulation/LinuxSyscalls/x32/Ioctl/drm.h +++ b/Source/Tools/LinuxEmulation/LinuxSyscalls/x32/Ioctl/drm.h @@ -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" @@ -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 diff --git a/Source/Tools/LinuxEmulation/LinuxSyscalls/x32/Ioctl/panthor_drm.inl b/Source/Tools/LinuxEmulation/LinuxSyscalls/x32/Ioctl/panthor_drm.inl new file mode 100644 index 0000000000..8953ffdf09 --- /dev/null +++ b/Source/Tools/LinuxEmulation/LinuxSyscalls/x32/Ioctl/panthor_drm.inl @@ -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) diff --git a/Source/Tools/LinuxEmulation/LinuxSyscalls/x32/Ioctl/v3d_drm.inl b/Source/Tools/LinuxEmulation/LinuxSyscalls/x32/Ioctl/v3d_drm.inl index fbbf19f7e6..193cc1ed2e 100644 --- a/Source/Tools/LinuxEmulation/LinuxSyscalls/x32/Ioctl/v3d_drm.inl +++ b/Source/Tools/LinuxEmulation/LinuxSyscalls/x32/Ioctl/v3d_drm.inl @@ -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) diff --git a/Source/Tools/LinuxEmulation/LinuxSyscalls/x32/Ioctl/xe_drm.inl b/Source/Tools/LinuxEmulation/LinuxSyscalls/x32/Ioctl/xe_drm.inl index 5fb38c217f..6d48cbfc61 100644 --- a/Source/Tools/LinuxEmulation/LinuxSyscalls/x32/Ioctl/xe_drm.inl +++ b/Source/Tools/LinuxEmulation/LinuxSyscalls/x32/Ioctl/xe_drm.inl @@ -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) diff --git a/Source/Tools/LinuxEmulation/LinuxSyscalls/x32/IoctlEmulation.cpp b/Source/Tools/LinuxEmulation/LinuxSyscalls/x32/IoctlEmulation.cpp index 7c89605f00..a05d65d026 100644 --- a/Source/Tools/LinuxEmulation/LinuxSyscalls/x32/IoctlEmulation.cpp +++ b/Source/Tools/LinuxEmulation/LinuxSyscalls/x32/IoctlEmulation.cpp @@ -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); } } @@ -730,6 +734,7 @@ std::array 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"