@@ -836,6 +836,8 @@ for opt do
;;
--enable-linux-user) linux_user="yes"
;;
+ --enable-linux-user-drm-amdgpu) meson_option_add "-Ddrm_amdgpu=true"
+ ;;
--disable-bsd-user) bsd_user="no"
;;
--enable-bsd-user) bsd_user="yes"
@@ -686,8 +686,12 @@
IOCTL_SPECIAL(DRM_IOCTL_VERSION, IOC_RW, do_ioctl_drm,
MK_PTR(MK_STRUCT(STRUCT_drm_version)))
+#ifdef CONFIG_DRM_AMDGPU
+#else
IOCTL_SPECIAL(DRM_IOCTL_I915_GETPARAM, IOC_RW, do_ioctl_drm_i915,
MK_PTR(MK_STRUCT(STRUCT_drm_i915_getparam)))
+#endif /* CONFIG_DRM_AMDGPU */
+
#endif
#ifdef TARGET_TIOCSTART
@@ -123,8 +123,12 @@
#endif
#ifdef HAVE_DRM_H
#include <libdrm/drm.h>
+#ifdef CONFIG_DRM_AMDGPU
+#include <libdrm/amdgpu_drm.h>
+#else
#include <libdrm/i915_drm.h>
#endif
+#endif
#include "linux_loop.h"
#include "uname.h"
@@ -5648,6 +5652,10 @@ static abi_long do_ioctl_drm(const IOCTLEntry *ie, uint8_t *buf_temp,
return -TARGET_ENOSYS;
}
+#ifdef CONFIG_DRM_AMDGPU
+
+#else
+
static abi_long do_ioctl_drm_i915_getparam(const IOCTLEntry *ie,
struct drm_i915_getparam *gparam,
int fd, abi_long arg)
@@ -5682,6 +5690,8 @@ static abi_long do_ioctl_drm_i915(const IOCTLEntry *ie, uint8_t *buf_temp,
}
}
+#endif /* CONFIG_DRM_AMDGPU */
+
#endif
static abi_long do_ioctl_TUNSETTXFILTER(const IOCTLEntry *ie, uint8_t *buf_temp,
@@ -1227,9 +1227,14 @@ struct target_rtc_pll_info {
/* drm ioctls */
#define TARGET_DRM_IOCTL_VERSION TARGET_IOWRU('d', 0x00)
+#ifdef CONFIG_DRM_AMDGPU
+
+#else
/* drm i915 ioctls */
#define TARGET_DRM_IOCTL_I915_GETPARAM TARGET_IOWRU('d', 0x46)
+#endif /* CONFIG_DRM_AMDGPU */
+
/* from asm/termbits.h */
#define TARGET_NCC 8
@@ -1962,6 +1962,7 @@ config_host_data.set('CONFIG_GPROF', get_option('gprof'))
config_host_data.set('CONFIG_LIVE_BLOCK_MIGRATION', get_option('live_block_migration').allowed())
config_host_data.set('CONFIG_QOM_CAST_DEBUG', get_option('qom_cast_debug'))
config_host_data.set('CONFIG_REPLICATION', get_option('replication').allowed())
+config_host_data.set('CONFIG_DRM_AMDGPU', get_option('drm_amdgpu'))
# has_header
config_host_data.set('CONFIG_EPOLL', cc.has_header('sys/epoll.h'))
@@ -327,3 +327,6 @@ option('slirp_smbd', type : 'feature', value : 'auto',
option('hexagon_idef_parser', type : 'boolean', value : true,
description: 'use idef-parser to automatically generate TCG code for the Hexagon frontend')
+
+option('drm_amdgpu', type : 'boolean', value: false,
+ description: 'drm amdgpu ioctl support')
\ No newline at end of file
Signed-off-by: Xiongchuan Tan <tanxiongchuan@isrc.iscas.ac.cn> --- configure | 2 ++ linux-user/ioctls.h | 4 ++++ linux-user/syscall.c | 10 ++++++++++ linux-user/syscall_defs.h | 5 +++++ meson.build | 1 + meson_options.txt | 3 +++ 6 files changed, 25 insertions(+)