Re: [Qemu-devel] [PATCH v4 0/7] vfio: add display support

2018-02-26 Thread Alex Williamson
On Mon, 26 Feb 2018 09:35:51 +0100
Gerd Hoffmann  wrote:

> On Fri, Feb 23, 2018 at 10:05:17AM +0100, Gerd Hoffmann wrote:
> > > Hi Gerd,
> > > 
> > > It's a little bit concerning that the only way we can test the
> > > region-based display support is with proprietary drivers that nobody
> > > but NVIDIA has at this point.  Have you considered adding region-based
> > > display support to the mdev sample tty driver?  I know it sounds
> > > ridiculous for a serial device to have a display, but the vfio display
> > > region support isn't really tied to the functionality of the base mdev
> > > device.  We could have it simply display a static test pattern, just so
> > > we can test the end to end code path without a dependency on a closed
> > > vendor driver.  
> > 
> > Hmm, have to think about that.  Some way to change the display content
> > would be nice as you can see whenever display updates are working then.  
> 
> https://www.kraxel.org/cgit/linux/log/?h=vfio-sample-display
> 
> Comes with host mdev driver and guest framebuffer driver.

Awesome!



Re: [Qemu-devel] [PATCH v4 0/7] vfio: add display support

2018-02-26 Thread Gerd Hoffmann
On Fri, Feb 23, 2018 at 10:05:17AM +0100, Gerd Hoffmann wrote:
> > Hi Gerd,
> > 
> > It's a little bit concerning that the only way we can test the
> > region-based display support is with proprietary drivers that nobody
> > but NVIDIA has at this point.  Have you considered adding region-based
> > display support to the mdev sample tty driver?  I know it sounds
> > ridiculous for a serial device to have a display, but the vfio display
> > region support isn't really tied to the functionality of the base mdev
> > device.  We could have it simply display a static test pattern, just so
> > we can test the end to end code path without a dependency on a closed
> > vendor driver.
> 
> Hmm, have to think about that.  Some way to change the display content
> would be nice as you can see whenever display updates are working then.

https://www.kraxel.org/cgit/linux/log/?h=vfio-sample-display

Comes with host mdev driver and guest framebuffer driver.

enjoy,
  Gerd




Re: [Qemu-devel] [PATCH v4 0/7] vfio: add display support

2018-02-23 Thread Gerd Hoffmann
> Hi Gerd,
> 
> It's a little bit concerning that the only way we can test the
> region-based display support is with proprietary drivers that nobody
> but NVIDIA has at this point.  Have you considered adding region-based
> display support to the mdev sample tty driver?  I know it sounds
> ridiculous for a serial device to have a display, but the vfio display
> region support isn't really tied to the functionality of the base mdev
> device.  We could have it simply display a static test pattern, just so
> we can test the end to end code path without a dependency on a closed
> vendor driver.

Hmm, have to think about that.  Some way to change the display content
would be nice as you can see whenever display updates are working then.

Maybe the fbcon text rendering code can be used to send the serial
console output from the guest to the display ...

cheers,
  Gerd




Re: [Qemu-devel] [PATCH v4 0/7] vfio: add display support

2018-02-22 Thread Zhang, Tina


> -Original Message-
> From: Zhenyu Wang [mailto:zhen...@linux.intel.com]
> Sent: Friday, February 23, 2018 10:43 AM
> To: Gerd Hoffmann 
> Cc: Alex Williamson ; Kirti Wankhede
> ; intel-gvt-...@lists.freedesktop.org; qemu-
> de...@nongnu.org; Zhang, Tina 
> Subject: Re: [Qemu-devel] [PATCH v4 0/7] vfio: add display support
> 
> On 2018.02.22 10:30:55 +0100, Gerd Hoffmann wrote:
> >   Hi,
> >
> > > Nice! Seems to be the last missing gap for local spice with cursor
> > > dmabuf support, we'll do more testing on that for sure. Btw, another
> > > method might be to add direct cursor dmabuf passing for spice as gl
> > > output, is that correct way?
> >
> > Passing on the cursor sprite needs the hotspot information, so spice
> > client can position the cursor correctly.  I didn't got hotspot
> > information in my testing yet, but maybe the guest kernel was too old.
> > Is that supported meanwhile?  If so, which kernel version is needed?
> >
> 
> Current gvt dmabuf doesn't support true hotspot info yet which requires some
> pv info update as we can't get it from hw state. Tina is pursuing that.
Indeed. Guest OS needs to use pv info to deliver the hotspot info to host. And 
so far, only Windows igfx driver can support it.
With the following patch, host userspace can get the valid hotspot info if it 
is supported by guest driver (e.g. Windows), or invalid hotspot info when 
unsupported.
https://lists.freedesktop.org/archives/intel-gvt-dev/2018-February/003169.html

BR,
Tina
> 
> > Spice already has support for setting pointers, we can simply use
> > that, at least initially.  Doesn't use dma-bufs.  If it turns out to
> > be a performance issue we can add support for using dma-bufs instead,
> > but that needs spice server changes.
> >
> > > And really like to see dmabuf support could be in upstream soon. Do
> > > you have any predict for which qemu version?
> >
> > I want have this in 2.12, at least the current, initial version.
> > Improved cursor support might take a little longer.
> >
> 
> Good to know. Thanks!
> 
> --
> Open Source Technology Center, Intel ltd.
> 
> $gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827



Re: [Qemu-devel] [PATCH v4 0/7] vfio: add display support

2018-02-22 Thread Zhenyu Wang
On 2018.02.22 10:30:55 +0100, Gerd Hoffmann wrote:
>   Hi,
> 
> > Nice! Seems to be the last missing gap for local spice with cursor
> > dmabuf support, we'll do more testing on that for sure. Btw, another
> > method might be to add direct cursor dmabuf passing for spice as gl
> > output, is that correct way?
> 
> Passing on the cursor sprite needs the hotspot information, so spice
> client can position the cursor correctly.  I didn't got hotspot
> information in my testing yet, but maybe the guest kernel was too old.
> Is that supported meanwhile?  If so, which kernel version is needed?
>

Current gvt dmabuf doesn't support true hotspot info yet which requires
some pv info update as we can't get it from hw state. Tina is pursuing that.

> Spice already has support for setting pointers, we can simply use
> that, at least initially.  Doesn't use dma-bufs.  If it turns out to be
> a performance issue we can add support for using dma-bufs instead, but
> that needs spice server changes.
> 
> > And really like to see dmabuf support could be in upstream soon. Do
> > you have any predict for which qemu version?
> 
> I want have this in 2.12, at least the current, initial version.
> Improved cursor support might take a little longer.
> 

Good to know. Thanks!

-- 
Open Source Technology Center, Intel ltd.

$gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827


signature.asc
Description: PGP signature


Re: [Qemu-devel] [PATCH v4 0/7] vfio: add display support

2018-02-22 Thread Alex Williamson
On Tue, 20 Feb 2018 11:28:14 +0100
Gerd Hoffmann  wrote:

> On Mon, Feb 19, 2018 at 03:16:49PM -0700, Alex Williamson wrote:
> > On Mon, 19 Feb 2018 12:14:51 +0100
> > Gerd Hoffmann  wrote:
> >   
> > > This series adds support for a vgpu display to the qemu vfio code.
> > > For now only regions are supported, dmabufs will follow later.
> > > 
> > > This version adds a patch to allow devices disable hotplugging, which
> > > will be used by vfio display support.  Also fixed issues Alex found in
> > > review.  
> > 
> > Looks ok to me, if this is to go through my tree I'll need a qdev ack
> > for 4/7.  If you want to go a different route, for 5-7:
> > 
> > Acked-by: Alex Williamson 
> > 
> > I'm still a bit confused though, what's preventing us from adding
> > dmabuf support now?  It's strange to provide the implementation for the
> > proprietary, unavailable vendor driver implementation first.  Is GVT-g
> > broken, lagging?  Thanks,  
> 
> A bit more complicated because it depends on user interface changes ...
> 
> Sneak preview at https://www.kraxel.org/cgit/qemu/log/?h=work/intel-vgpu
> Note: branch is a moving target ;)
> 
> State:
>   vfio:  Working, needs some cleanups though (drop debug logging, ...).
>   gtk:   Working, needs some minor cleanups too.
>   spice: Partly working (no mouse ptr yet).
>   sdl:   Not working.  Need to figure how I get a egl context (instead
>  of glx).  Possibly requires SDL 2.2.  Tina looked at this a
>  while back, need to look at some old mails ...
> 
> Current plan:
>   (1) fix/complete spice support.
>   (2) cleanup patches, send them out.
>   (3) look at the SDL issues.

Hi Gerd,

It's a little bit concerning that the only way we can test the
region-based display support is with proprietary drivers that nobody
but NVIDIA has at this point.  Have you considered adding region-based
display support to the mdev sample tty driver?  I know it sounds
ridiculous for a serial device to have a display, but the vfio display
region support isn't really tied to the functionality of the base mdev
device.  We could have it simply display a static test pattern, just so
we can test the end to end code path without a dependency on a closed
vendor driver.  Thanks,

Alex



Re: [Qemu-devel] [PATCH v4 0/7] vfio: add display support

2018-02-22 Thread Gerd Hoffmann
  Hi,

> Nice! Seems to be the last missing gap for local spice with cursor
> dmabuf support, we'll do more testing on that for sure. Btw, another
> method might be to add direct cursor dmabuf passing for spice as gl
> output, is that correct way?

Passing on the cursor sprite needs the hotspot information, so spice
client can position the cursor correctly.  I didn't got hotspot
information in my testing yet, but maybe the guest kernel was too old.
Is that supported meanwhile?  If so, which kernel version is needed?

Spice already has support for setting pointers, we can simply use
that, at least initially.  Doesn't use dma-bufs.  If it turns out to be
a performance issue we can add support for using dma-bufs instead, but
that needs spice server changes.

> And really like to see dmabuf support could be in upstream soon. Do
> you have any predict for which qemu version?

I want have this in 2.12, at least the current, initial version.
Improved cursor support might take a little longer.

cheers,
  Gerd




Re: [Qemu-devel] [PATCH v4 0/7] vfio: add display support

2018-02-21 Thread Zhenyu Wang
On 2018.02.20 18:04:17 +0100, Gerd Hoffmann wrote:
>   Hi,
> 
> > Sneak preview at https://www.kraxel.org/cgit/qemu/log/?h=work/intel-vgpu
> > Note: branch is a moving target ;)
> > 
> > State:
> >   spice: Partly working (no mouse ptr yet).
> 
> Working now, in case anyone wants play.
> 
> Must turn on opengl and use a unix socket, i.e. this:
> 
>   qemu -spice disable-ticketing,gl=on,unix,addr=/tmp/spice-vgpu
> 
> and this:
> 
>   remote-viewer spice+unix:tmp/spice-vgpu
> 
> Host needs a 4.16-rc kernel.
> 
> Guest can be older, most of the time I'm testing with the Fedora 27 live
> iso (4.13) which works ok.
> 

Nice! Seems to be the last missing gap for local spice with cursor
dmabuf support, we'll do more testing on that for sure. Btw, another
method might be to add direct cursor dmabuf passing for spice as gl
output, is that correct way?

And really like to see dmabuf support could be in upstream soon. Do
you have any predict for which qemu version?

Thanks!

-- 
Open Source Technology Center, Intel ltd.

$gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827


signature.asc
Description: PGP signature


Re: [Qemu-devel] [PATCH v4 0/7] vfio: add display support

2018-02-20 Thread Gerd Hoffmann
  Hi,

> Sneak preview at https://www.kraxel.org/cgit/qemu/log/?h=work/intel-vgpu
> Note: branch is a moving target ;)
> 
> State:
>   spice: Partly working (no mouse ptr yet).

Working now, in case anyone wants play.

Must turn on opengl and use a unix socket, i.e. this:

  qemu -spice disable-ticketing,gl=on,unix,addr=/tmp/spice-vgpu

and this:

  remote-viewer spice+unix:tmp/spice-vgpu

Host needs a 4.16-rc kernel.

Guest can be older, most of the time I'm testing with the Fedora 27 live
iso (4.13) which works ok.

cheers,
  Gerd




Re: [Qemu-devel] [PATCH v4 0/7] vfio: add display support

2018-02-20 Thread Gerd Hoffmann
On Mon, Feb 19, 2018 at 03:16:49PM -0700, Alex Williamson wrote:
> On Mon, 19 Feb 2018 12:14:51 +0100
> Gerd Hoffmann  wrote:
> 
> > This series adds support for a vgpu display to the qemu vfio code.
> > For now only regions are supported, dmabufs will follow later.
> > 
> > This version adds a patch to allow devices disable hotplugging, which
> > will be used by vfio display support.  Also fixed issues Alex found in
> > review.
> 
> Looks ok to me, if this is to go through my tree I'll need a qdev ack
> for 4/7.  If you want to go a different route, for 5-7:
> 
> Acked-by: Alex Williamson 
> 
> I'm still a bit confused though, what's preventing us from adding
> dmabuf support now?  It's strange to provide the implementation for the
> proprietary, unavailable vendor driver implementation first.  Is GVT-g
> broken, lagging?  Thanks,

A bit more complicated because it depends on user interface changes ...

Sneak preview at https://www.kraxel.org/cgit/qemu/log/?h=work/intel-vgpu
Note: branch is a moving target ;)

State:
  vfio:  Working, needs some cleanups though (drop debug logging, ...).
  gtk:   Working, needs some minor cleanups too.
  spice: Partly working (no mouse ptr yet).
  sdl:   Not working.  Need to figure how I get a egl context (instead
 of glx).  Possibly requires SDL 2.2.  Tina looked at this a
 while back, need to look at some old mails ...

Current plan:
  (1) fix/complete spice support.
  (2) cleanup patches, send them out.
  (3) look at the SDL issues.



Re: [Qemu-devel] [PATCH v4 0/7] vfio: add display support

2018-02-19 Thread Alex Williamson
On Mon, 19 Feb 2018 12:14:51 +0100
Gerd Hoffmann  wrote:

> This series adds support for a vgpu display to the qemu vfio code.
> For now only regions are supported, dmabufs will follow later.
> 
> This version adds a patch to allow devices disable hotplugging, which
> will be used by vfio display support.  Also fixed issues Alex found in
> review.

Looks ok to me, if this is to go through my tree I'll need a qdev ack
for 4/7.  If you want to go a different route, for 5-7:

Acked-by: Alex Williamson 

I'm still a bit confused though, what's preventing us from adding
dmabuf support now?  It's strange to provide the implementation for the
proprietary, unavailable vendor driver implementation first.  Is GVT-g
broken, lagging?  Thanks,

Alex


> Gerd Hoffmann (7):
>   linux-headers: update to 4.16-rc1
>   standard-headers: add drm/drm_fourcc.h
>   ui/pixman: add qemu_drm_format_to_pixman()
>   qdev: add hotpluggable to DeviceState
>   vfio/common: cleanup in vfio_region_finalize
>   vfio/display: core & wireup
>   vfio/display: adding region support
> 
>  hw/vfio/pci.h  |   4 +
>  include/hw/qdev-core.h |   1 +
>  include/hw/vfio/vfio-common.h  |   8 +
>  include/standard-headers/drm/drm_fourcc.h  | 411 
> +
>  include/standard-headers/linux/input-event-codes.h |   1 +
>  include/standard-headers/linux/input.h |  11 +
>  include/standard-headers/linux/pci_regs.h  |  30 +-
>  include/standard-headers/linux/virtio_net.h|  13 +
>  include/ui/qemu-pixman.h   |   5 +
>  linux-headers/asm-powerpc/kvm.h|   2 +
>  linux-headers/asm-powerpc/unistd.h |   3 +
>  linux-headers/asm-s390/unistd.h| 401 +---
>  linux-headers/asm-s390/unistd_32.h | 364 ++
>  linux-headers/asm-s390/unistd_64.h | 331 +
>  linux-headers/asm-x86/kvm_para.h   |   4 +
>  linux-headers/linux/kvm.h  |  90 +
>  linux-headers/linux/psci.h |   3 +
>  linux-headers/linux/vfio.h |  72 
>  hw/core/qdev.c |   5 +-
>  hw/vfio/common.c   |   7 +
>  hw/vfio/display.c  | 152 
>  hw/vfio/pci.c  |   9 +
>  ui/qemu-pixman.c   |  22 ++
>  hw/vfio/Makefile.objs  |   2 +-
>  scripts/update-linux-headers.sh|   7 +
>  25 files changed, 1545 insertions(+), 413 deletions(-)
>  create mode 100644 include/standard-headers/drm/drm_fourcc.h
>  create mode 100644 linux-headers/asm-s390/unistd_32.h
>  create mode 100644 linux-headers/asm-s390/unistd_64.h
>  create mode 100644 hw/vfio/display.c
> 




[Qemu-devel] [PATCH v4 0/7] vfio: add display support

2018-02-19 Thread Gerd Hoffmann
This series adds support for a vgpu display to the qemu vfio code.
For now only regions are supported, dmabufs will follow later.

This version adds a patch to allow devices disable hotplugging, which
will be used by vfio display support.  Also fixed issues Alex found in
review.

cheers,
  Gerd

Gerd Hoffmann (7):
  linux-headers: update to 4.16-rc1
  standard-headers: add drm/drm_fourcc.h
  ui/pixman: add qemu_drm_format_to_pixman()
  qdev: add hotpluggable to DeviceState
  vfio/common: cleanup in vfio_region_finalize
  vfio/display: core & wireup
  vfio/display: adding region support

 hw/vfio/pci.h  |   4 +
 include/hw/qdev-core.h |   1 +
 include/hw/vfio/vfio-common.h  |   8 +
 include/standard-headers/drm/drm_fourcc.h  | 411 +
 include/standard-headers/linux/input-event-codes.h |   1 +
 include/standard-headers/linux/input.h |  11 +
 include/standard-headers/linux/pci_regs.h  |  30 +-
 include/standard-headers/linux/virtio_net.h|  13 +
 include/ui/qemu-pixman.h   |   5 +
 linux-headers/asm-powerpc/kvm.h|   2 +
 linux-headers/asm-powerpc/unistd.h |   3 +
 linux-headers/asm-s390/unistd.h| 401 +---
 linux-headers/asm-s390/unistd_32.h | 364 ++
 linux-headers/asm-s390/unistd_64.h | 331 +
 linux-headers/asm-x86/kvm_para.h   |   4 +
 linux-headers/linux/kvm.h  |  90 +
 linux-headers/linux/psci.h |   3 +
 linux-headers/linux/vfio.h |  72 
 hw/core/qdev.c |   5 +-
 hw/vfio/common.c   |   7 +
 hw/vfio/display.c  | 152 
 hw/vfio/pci.c  |   9 +
 ui/qemu-pixman.c   |  22 ++
 hw/vfio/Makefile.objs  |   2 +-
 scripts/update-linux-headers.sh|   7 +
 25 files changed, 1545 insertions(+), 413 deletions(-)
 create mode 100644 include/standard-headers/drm/drm_fourcc.h
 create mode 100644 linux-headers/asm-s390/unistd_32.h
 create mode 100644 linux-headers/asm-s390/unistd_64.h
 create mode 100644 hw/vfio/display.c

-- 
2.9.3