From nobody Mon Feb 9 07:01:58 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1596375647; cv=none; d=zohomail.com; s=zohoarc; b=eY20r8mmflspOVGSbAdzHTykmgfOW96qcInW7BSozXJQd4JZ5KBAw277ILcuxQE3YKL88MD5dbtf6Dxs2Z6fYnjj2GRlr+mO5yx4ZIQpnmDVZePEGW518GXHiyIBkKuY1AtMfYLwyhp7Bl4cflCWKCX95ws1/c4vTU4HINmhjKE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1596375647; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=LpLB8fzORcNXO8v4NJpmbS1+CqIyZan1LYvVbt5Xetg=; b=HYl4z7VololDavGkGJhSkur63av97cnFLrwjSb6I7NucTZSt3iWnsYersgu8cTU2XdJ0BBf9uY8OPJe4hz4rZLIjB8Kpct3MPreVz3g5P13coJj+HjExxL8ALthDKiEXj9iJSdQU/qfhtUXC54ao5gVkMrnZzLM6JSSEFODBtkA= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1596375647276675.7006350686507; Sun, 2 Aug 2020 06:40:47 -0700 (PDT) Received: from localhost ([::1]:32974 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k2EEF-0000R8-Ur for importer@patchew.org; Sun, 02 Aug 2020 09:40:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46730) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k2EDe-0008RX-9E for qemu-devel@nongnu.org; Sun, 02 Aug 2020 09:40:06 -0400 Received: from lucky1.263xmail.com ([211.157.147.130]:44286) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k2EDb-0007kU-5a for qemu-devel@nongnu.org; Sun, 02 Aug 2020 09:40:06 -0400 Received: from localhost (unknown [192.168.167.32]) by lucky1.263xmail.com (Postfix) with ESMTP id 995BBCAC46 for ; Sun, 2 Aug 2020 21:39:45 +0800 (CST) Received: from localhost.localdomain (unknown [120.244.108.108]) by smtp.263.net (postfix) whith ESMTP id P31037T140065908971264S1596375579754136_; Sun, 02 Aug 2020 21:39:45 +0800 (CST) X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-ADDR-CHECKED4: 1 X-ANTISPAM-LEVEL: 2 X-ABS-CHECKED: 0 X-UNIQUE-TAG: <5e4d2f1d095839f4fa60745582fb3ea1> X-RL-SENDER: chengang@emindsoft.com.cn X-SENDER: chengang@emindsoft.com.cn X-LOGIN-NAME: chengang@emindsoft.com.cn X-FST-TO: laurent@vivier.eu X-SENDER-IP: 120.244.108.108 X-ATTACHMENT-NUM: 0 X-DNS-TYPE: 0 X-System-Flag: 0 From: chengang@emindsoft.com.cn To: laurent@vivier.eu Subject: [PATCH v2] linux-user: syscall: ioctls: support DRM_IOCTL_I915_GETPARAM Date: Sun, 2 Aug 2020 21:39:38 +0800 Message-Id: <20200802133938.12055-1-chengang@emindsoft.com.cn> X-Mailer: git-send-email 2.24.0.308.g228f53135a MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=211.157.147.130; envelope-from=chengang@emindsoft.com.cn; helo=lucky1.263xmail.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/02 09:39:50 X-ACL-Warn: Detected OS = ??? X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-1, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: chengang@emindsoft.com.cn, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Chen Gang Another DRM_IOCTL_I915 patches will be sent next. Signed-off-by: Chen Gang Reviewed-by: Laurent Vivier --- linux-user/ioctls.h | 3 +++ linux-user/syscall.c | 35 +++++++++++++++++++++++++++++++++++ linux-user/syscall_defs.h | 8 ++++++++ linux-user/syscall_types.h | 4 ++++ 4 files changed, 50 insertions(+) diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h index 0713ae1311..e2fc09b5a5 100644 --- a/linux-user/ioctls.h +++ b/linux-user/ioctls.h @@ -581,6 +581,9 @@ #ifdef HAVE_DRM_H IOCTL_SPECIAL(DRM_IOCTL_VERSION, IOC_RW, do_ioctl_drm, MK_PTR(MK_STRUCT(STRUCT_drm_version))) + + IOCTL_SPECIAL(DRM_IOCTL_I915_GETPARAM, IOC_RW, do_ioctl_drm_i915, + MK_PTR(MK_STRUCT(STRUCT_drm_i915_getparam))) #endif =20 #ifdef TARGET_TIOCSTART diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 945fc25279..b0e15f373c 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -114,6 +114,7 @@ #include #ifdef HAVE_DRM_H #include +#include #endif #include "linux_loop.h" #include "uname.h" @@ -5413,6 +5414,40 @@ static abi_long do_ioctl_drm(const IOCTLEntry *ie, u= int8_t *buf_temp, return -TARGET_ENOSYS; } =20 +static abi_long do_ioctl_drm_i915_getparam(const IOCTLEntry *ie, + struct drm_i915_getparam *gpara= m, + 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 =3D &value; + ret =3D 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 =20 IOCTLEntry ioctl_entries[] =3D { diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index 3c261cff0e..5a1692aa26 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -1170,6 +1170,9 @@ struct target_rtc_pll_info { /* drm ioctls */ #define TARGET_DRM_IOCTL_VERSION TARGET_IOWRU('d', 0x00) =20 +/* drm i915 ioctls */ +#define TARGET_DRM_IOCTL_I915_GETPARAM TARGET_IOWRU('d', 0x46) + /* from asm/termbits.h */ =20 #define TARGET_NCC 8 @@ -2613,6 +2616,11 @@ struct target_drm_version { abi_ulong desc; }; =20 +struct target_drm_i915_getparam { + int param; + abi_ulong value; +}; + #include "socket.h" =20 #include "errno_defs.h" diff --git a/linux-user/syscall_types.h b/linux-user/syscall_types.h index 3f1f033464..12bf3484e2 100644 --- a/linux-user/syscall_types.h +++ b/linux-user/syscall_types.h @@ -325,6 +325,10 @@ STRUCT(drm_version, TYPE_ULONG, /* desc_len */ TYPE_PTRVOID) /* desc */ =20 +STRUCT(drm_i915_getparam, + TYPE_INT, /* param */ + TYPE_PTRVOID) /* value */ + STRUCT(file_clone_range, TYPE_LONGLONG, /* src_fd */ TYPE_ULONGLONG, /* src_offset */ --=20 2.24.0.308.g228f53135a