[virglrenderer-devel] virgl_renderer_resource_import_eglimage

Chia-I Wu olvaffe at gmail.com
Wed Aug 19 22:40:38 UTC 2020


On Wed, Aug 19, 2020 at 3:12 PM Vasyl Vavrychuk <vvavrychuk at gmail.com> wrote:
>
> On Wed, Aug 19, 2020 at 10:02 PM Chia-I Wu <olvaffe at gmail.com> wrote:
> >
> > On Wed, Aug 19, 2020 at 1:42 AM Vasyl Vavrychuk <vvavrychuk at gmail.com> wrote:
> > >
> > > Commit message for commit that adds "virgl_renderer_resource_import_eglimage" says this function supposed to be used from CrosVM. But I have checked CrosVM source and did not find virgl_renderer_resource_import_eglimage usage. Same for QEMU.
> > >
> > > As I understand virgl_renderer_resource_import_eglimage is essential to achieve zero copy. So, why QEMU/CrosVM do not use it. Are they using some other methods to achieve zero copy?
> >
> > I think crosvm moved from import model to export model a while ago.
> > It probably uses virgl_renderer_export_query now (didn't verify).
>
> You are right, crosvm does export fd and then "RegisterFdAtPciBarOffset".
>
> But, as far as I understand, this means that resources are allocated
> from host memory. In embedded systems, usually video memory is the
> same as RAM, but here RAM accessible to the guest and video memory
> provided by virglrenderer/crosvm will be separate. So I will have to
> limit separately, that for example, my guest should have 2 GB of RAM
> and 1 GB of video memory. Kindly please confirm that my understanding
> is correct.

That is correct, but it has nothing to do with importing or exporting.
The difference is whether crosvm or virglrenderer allocates, but those
allocations are not from the guest memory no matter who allocates.  I
think at least virglrenderer does not put any limit.

For qemu 2D mode, there is indeed a property called max_hostmem to
limit total host allocation size.


More information about the virglrenderer-devel mailing list