qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 4/7] This patch adds initial user-virtualization


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH 4/7] This patch adds initial user-virtualization support for the DRM (type 'd') IOCTLs in linux. With it and a corresponding architecture chroot (say aarch64), I am able to successfully run a few 2D and 3D applications with native graphics acceleration. Some notes/caveats are:
Date: Mon, 20 Jun 2016 14:37:33 +0100

On 19 June 2016 at 01:11, Timothy Pearson
<address@hidden> wrote:
> 1. It will only work with open drivers as their IOCTLs are documented.
> 2. i965+ is only supported. That is any haswell, ivybridge, etc. GPU
> will work.
> 3. X doesn't start yet, though this patch eliminates all the visible
> unsupported DRM IOCTL calls as observed by setting QEMU_STRACE=1.
> 4. Intel open drivers components except for Beignet are architecture
> independent AFAICT and compile cleanly in foreign architecture
> environments.
> 5. The DRM table provided is current as of linux-3.17-rc2, however,
> compiling it with older kernel headers might require conditional
> guards that this patch doesn't provide yet.
> 6. syscalls.c now includes <drm/*.h> files, which should be available
> in any valid linux-user build environment.
>
> Using a Debian aarch64 chroot on ubuntu amd64, I have successfully run
> nexuiz and
> compiled and run qemu-system-i386 with SDL emulation (+ patch for
> forcing OpenGL).

Could you fix up the formatting on this commit message, please?
The first line should be a brief summary subject.

You're also missing a signed-off-by line.

> ---
>  linux-user/ioctls.h        | 137 ++++++++++
>  linux-user/syscall.c       |   2 +
>  linux-user/syscall_defs.h  | 139 ++++++++++
>  linux-user/syscall_types.h | 651
> +++++++++++++++++++++++++++++++++++++++++++++
>  4 files changed, 929 insertions(+)

There's a lot of stuff being added to some of these files,
I think they're worth splitting out into subfiles rather
than having them get really huge.

> MK_PTR(MK_STRUCT(STRUCT_drm_i915_gem_userptr)))
> \ No newline at end of file

Make sure files end with a newline...

> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index 644a490..96d285a 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -82,6 +82,8 @@ int __clone2(int (*fn)(void *), void *child_stack_base,
>  #define tchars host_tchars /* same as target */
>  #define ltchars host_ltchars /* same as target */
>  +#include <libdrm/drm.h>
> +#include <libdrm/i915_drm.h>

We can't rely on /usr/include/libdrm being present so we should
probably probe for this in configure if we need it.

>  #include <linux/termios.h>
>  #include <linux/unistd.h>
>  #include <linux/cdrom.h>
> diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h
> index 6ee9251..275583a 100644
> --- a/linux-user/syscall_defs.h
> +++ b/linux-user/syscall_defs.h
> @@ -2604,3 +2604,142 @@ struct target_user_cap_data {
>      uint32_t permitted;
>      uint32_t inheritable;
>  };
> +
> +/* drm defines */
> +#define TARGET_DRM_IOCTL_VERSION                      TARGET_IOWR('d',
> 0x00, struct drm_version)

Structs like drm_version will differ in size between architectures
(they include pointers or types like "long"), so the target ioctl
number calculation needs to use the target's idea of the struct
size, not the host's.

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]