lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Tue, 06 Jun 2017 09:59:10 +0200
From:   Gerd Hoffmann <kraxel@...hat.com>
To:     Kirti Wankhede <kwankhede@...dia.com>,
        Alex Williamson <alex.williamson@...hat.com>,
        "Chen, Xiaoguang" <xiaoguang.chen@...el.com>
Cc:     "chris@...is-wilson.co.uk" <chris@...is-wilson.co.uk>,
        "intel-gfx@...ts.freedesktop.org" <intel-gfx@...ts.freedesktop.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "zhenyuw@...ux.intel.com" <zhenyuw@...ux.intel.com>,
        "Lv, Zhiyuan" <zhiyuan.lv@...el.com>,
        "intel-gvt-dev@...ts.freedesktop.org" 
        <intel-gvt-dev@...ts.freedesktop.org>,
        "Wang, Zhi A" <zhi.a.wang@...el.com>,
        "Tian, Kevin" <kevin.tian@...el.com>
Subject: Re: [PATCH v6 4/6] vfio: Define vfio based vgpu's dma-buf operations

On Mon, 2017-06-05 at 13:56 +0530, Kirti Wankhede wrote:
> 
> On 6/2/2017 2:08 PM, Gerd Hoffmann wrote:
> > 
> > > struct vfio_vgpu_surface_info {
> > >         __u64 start;
> > >         __u32 width;
> > >         __u32 height;
> > >         __u32 stride;
> > >         __u32 size;
> > >         __u32 x_pos;
> > >         __u32 y_pos;
> > >         __u32 padding;
> > >         /* Only used when VFIO_VGPU_SURFACE_DMABUF_* flags set */
> > >         __u64 drm_format_mod;
> > >         __u32 drm_format;
> > 
> > Why for dmabufs only?  Shouldn't the region specify the format
> > too? 
> > Even in case you are using a fixed one (say
> > DRM_FORMAT_XRGB8888) you
> > can explicitly say so in drm_format (and set drm_format_mod to
> > zero).
> > 
> 
> Definitions for PIXMAN formats and DRM formats are different. I think
> we need a flag to specify the format of surface that vendor driver is
> going to provide, PIXMAN or DRM.

No need to put that into the ioctl interface.  First, the kernel should
not worry about what userspace uses to process the data.  Second (most)
drm formats can trivially be mapped into pixman formats.

For example: PIXMAN_x8r8g8b8 (little endian) == DRM_FORMAT_XRGB8888

> If surface is provided through region in PIXMAN format, existing
> functions in QEMU can be used to get format from bpp value,
> qemu_default_pixman_format(). Similarly, display surface can be
> updated
> by QEMU using qemu_create_displaysurface_from() from mmaped region.

A thin wrapper which accepts a struct vfio_vgpu_surface_info and
translates that into a qemu_create_displaysurface_from() call should be
pretty small.

cheers,
  Gerd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ