aboutsummaryrefslogtreecommitdiff
path: root/linux-user/syscall.c
diff options
context:
space:
mode:
authorChen Gang <chengang@emindsoft.com.cn>2020-08-02 21:39:38 +0800
committerLaurent Vivier <laurent@vivier.eu>2020-08-27 12:29:49 +0200
commit913b03c2640bcf62c978386aa69a8c6099fa9424 (patch)
tree70a0d7d6c5deb2f786df6eb2cf867499853f3f91 /linux-user/syscall.c
parentb09d64064bd1ea5e5c37b2d5089e1cc3f65801b2 (diff)
downloadqemu-913b03c2640bcf62c978386aa69a8c6099fa9424.zip
qemu-913b03c2640bcf62c978386aa69a8c6099fa9424.tar.gz
qemu-913b03c2640bcf62c978386aa69a8c6099fa9424.tar.bz2
linux-user: syscall: ioctls: support DRM_IOCTL_I915_GETPARAM
Another DRM_IOCTL_I915 patches will be sent next. Signed-off-by: Chen Gang <chengang@emindsoft.com.cn> Reviewed-by: Laurent Vivier <laurent@vivier.eu> Message-Id: <20200802133938.12055-1-chengang@emindsoft.com.cn> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Diffstat (limited to 'linux-user/syscall.c')
-rw-r--r--linux-user/syscall.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index e387246..efaa0a7 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -114,6 +114,7 @@
#include <sound/asound.h>
#ifdef HAVE_DRM_H
#include <libdrm/drm.h>
+#include <libdrm/i915_drm.h>
#endif
#include "linux_loop.h"
#include "uname.h"
@@ -5426,6 +5427,40 @@ static abi_long do_ioctl_drm(const IOCTLEntry *ie, uint8_t *buf_temp,
return -TARGET_ENOSYS;
}
+static abi_long do_ioctl_drm_i915_getparam(const IOCTLEntry *ie,
+ struct drm_i915_getparam *gparam,
+ int fd, abi_long arg)
+{
+ abi_long ret;
+ int value;
+ struct target_drm_i915_getparam *target_gparam;
+
+ if (!lock_user_struct(VERIFY_READ, target_gparam, arg, 0)) {
+ return -TARGET_EFAULT;
+ }
+
+ __get_user(gparam->param, &target_gparam->param);
+ gparam->value = &value;
+ ret = get_errno(safe_ioctl(fd, ie->host_cmd, gparam));
+ put_user_s32(value, target_gparam->value);
+
+ unlock_user_struct(target_gparam, arg, 0);
+ return ret;
+}
+
+static abi_long do_ioctl_drm_i915(const IOCTLEntry *ie, uint8_t *buf_temp,
+ int fd, int cmd, abi_long arg)
+{
+ switch (ie->host_cmd) {
+ case DRM_IOCTL_I915_GETPARAM:
+ return do_ioctl_drm_i915_getparam(ie,
+ (struct drm_i915_getparam *)buf_temp,
+ fd, arg);
+ default:
+ return -TARGET_ENOSYS;
+ }
+}
+
#endif
IOCTLEntry ioctl_entries[] = {