Mir in a virtual machine
jakob at vmware.com
Sun Jan 26 02:42:21 UTC 2014
----- Ursprungligt meddelande -----
> At the moment I am trying to better understand how buffers are used and
> shared in Mir. I have spent the past couple of days doing nothing but
> reading the Mir source code, the DRM source code, and portions of the Mesa
> source code. Here is what I think I have learned so far, which will lead me
> to a question:
> - The server creates the buffers. It can create either a hardware buffer,
> which is a gbm allocated “dumb” buffer, or a software buffer, which is
> nothing more than shared memory (in RAM).
> - When a hardware buffer is created, it uses DRM prime (drmPrimeHandleToFD)
> to create an FD for the “dumb" buffer.
> - The server then provides the client with a “ClientBuffer” which is an
> abstraction of the hardware / software buffer containing the information
> about the buffer (like format, stride, etc…) and its FD.
> - To draw into this buffer, you need to call mir_surface_get_graphics_region
> which through some indirection, mmaps the buffer to a vaddr that can be
> written into.
> If you look at the basic.c demo, it creates a hardware buffer, and if you
> look at the fingerpaint.c demo, it creates a software buffer. If I modify
> the basic.c demo to call mir_surface_get_graphics_region, it fails on
> VMWare, saying that it could not mmap the buffer. It works fine if I change
> the basic.c to use a software buffer.
> Is this an issue with VMWare? Or am I fundamentally not understanding
> something about how hardware buffer’s are used? If I am… why would a client
> use hardware buffers if it cannot map the buffer to use it?
First of, its great that you have been able to get mir up and running
the vmwgfx driver. The bring up work was done by Thomas Hellström.
The vwmgfx driver doesn't support mmapping, this is mostly due to
the way the virtual hardware isn't able to map textures (called
surfaces in vmwgfx speak) which are different to memory buffers
(called dma buffers).
More information about the Mir-devel