qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] qemu+virgl on systems without dmabuf and/or GBM
@ 2017-11-14  0:15 Joe Kniss
  2017-11-14  2:37 ` David Airlie
  2017-11-14  7:05 ` Gerd Hoffmann
  0 siblings, 2 replies; 3+ messages in thread
From: Joe Kniss @ 2017-11-14  0:15 UTC (permalink / raw)
  To: qemu-devel; +Cc: Dave Airlie, Gerd Hoffmann

Hi,

  I am developing using qemu with virglrenderer on linux systems that
do not support dmabufs or GBM.   I have been successful making this
work using glx and ignoring egl/dmabuf/gbm use in qemu.
Unfortunately, there is currently no way to configure qemu to use
opengl but disable egl/dmabuf/gbm.  This use case could be handled
with a straight-forward configure fix, but I am not sure what the
preferred approach would be.  Here are some options for example:

1) Check for gbm in configure, if it is unavailable disable ui/egl*
since this egl implementation depends on gbm.
2) Check for gbm in configure, modify ui/egl* to work when gbm is missing.
3) Add disable-egl flag to configure, ignore gbm package when egl is disabled.

For our use case, option 3 is the simplest, since we don't need either
egl or gbm and gbm is only used with egl in qemu.  We also encountered
an additional issue with either gtk or qemu (I forget which)
attempting to share glx and egl contexts.

Naturally, we want to come up with a solution that is most generally
useful,  feedback is greatly appreciated.

Cheers,
-Joe Kniss

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] qemu+virgl on systems without dmabuf and/or GBM
  2017-11-14  0:15 [Qemu-devel] qemu+virgl on systems without dmabuf and/or GBM Joe Kniss
@ 2017-11-14  2:37 ` David Airlie
  2017-11-14  7:05 ` Gerd Hoffmann
  1 sibling, 0 replies; 3+ messages in thread
From: David Airlie @ 2017-11-14  2:37 UTC (permalink / raw)
  To: Joe Kniss; +Cc: qemu-devel, Gerd Hoffmann


Hi Joe,

> 
>   I am developing using qemu with virglrenderer on linux systems that
> do not support dmabufs or GBM.   I have been successful making this
> work using glx and ignoring egl/dmabuf/gbm use in qemu.
> Unfortunately, there is currently no way to configure qemu to use
> opengl but disable egl/dmabuf/gbm.  This use case could be handled
> with a straight-forward configure fix, but I am not sure what the
> preferred approach would be.  Here are some options for example:

I did originally write the renderer on the nvidia binary driver, but
never really continued to test it.

> 
> 1) Check for gbm in configure, if it is unavailable disable ui/egl*
> since this egl implementation depends on gbm.
> 2) Check for gbm in configure, modify ui/egl* to work when gbm is missing.
> 3) Add disable-egl flag to configure, ignore gbm package when egl is
> disabled.
> 
> For our use case, option 3 is the simplest, since we don't need either
> egl or gbm and gbm is only used with egl in qemu.  We also encountered
> an additional issue with either gtk or qemu (I forget which)
> attempting to share glx and egl contexts.
> 
> Naturally, we want to come up with a solution that is most generally
> useful,  feedback is greatly appreciated.

I'd like to make EGL work without GBM if possible, I realise you can't
do buffer sharing etc, but you should be able to get EGL contexts to
work in place of GLX contexts.

However if there are issues interoperating between SDL2/EGL/GLX, then
I think whatever approach works best. I'd rather it not be a build time
thing if at all possible, if we can detect at runtime what the installed
driver can do it would be much better.

i.e. if you build qemu+SDL2+virglrenderer against mesa, but run it against
nvidia it should work if at all possible.

Dave.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] qemu+virgl on systems without dmabuf and/or GBM
  2017-11-14  0:15 [Qemu-devel] qemu+virgl on systems without dmabuf and/or GBM Joe Kniss
  2017-11-14  2:37 ` David Airlie
@ 2017-11-14  7:05 ` Gerd Hoffmann
  1 sibling, 0 replies; 3+ messages in thread
From: Gerd Hoffmann @ 2017-11-14  7:05 UTC (permalink / raw)
  To: Joe Kniss; +Cc: qemu-devel, Dave Airlie

On Mon, Nov 13, 2017 at 04:15:30PM -0800, Joe Kniss wrote:
> Hi,
> 
>   I am developing using qemu with virglrenderer on linux systems that
> do not support dmabufs or GBM.   I have been successful making this
> work using glx and ignoring egl/dmabuf/gbm use in qemu.

nvidia?
Which user interface?

> Unfortunately, there is currently no way to configure qemu to use
> opengl but disable egl/dmabuf/gbm.

Wrong.  dmabuf support is purely optional.  And egl is required (at
runtime) only in case qemu creates the opengl context by itself.  qemu
happily uses opengl contexts created by sdl2 or gtk (3.16+ GtkGlArea)
even if they are glx contexts.  dmabuf sharing obviously doesn't work
then, but you don't need that for virgl + local display.

> 1) Check for gbm in configure, if it is unavailable disable ui/egl*
> since this egl implementation depends on gbm.
> 2) Check for gbm in configure, modify ui/egl* to work when gbm is missing.
> 3) Add disable-egl flag to configure, ignore gbm package when egl is disabled.

I don't think any of this is needed.  Also this should be decided at
runtime not compile time.

cheers,
  Gerd

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-11-14  7:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-14  0:15 [Qemu-devel] qemu+virgl on systems without dmabuf and/or GBM Joe Kniss
2017-11-14  2:37 ` David Airlie
2017-11-14  7:05 ` Gerd Hoffmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).