Mir in a virtual machine

Rian Quinn rianquinn at gmail.com
Fri Jan 24 12:21:13 UTC 2014


No problem. For now, I have enough to get going. 


Another issue that I noticed is that when I attempt to allocate a hardware buffer using mir_connection_create_surface, it fails on VMWare, but software buffers work fine. I traced the code to the mmap function failing, and noticed that it is basically the same problem I was having when trying to write the DRM code manually. 


So that brings me to a compositor question, that I have had a hard time finding good information on. My “clients” need to render into a buffer with an ARGB format. From there, each client has fullscreen access. In some cases, we “cut” holes in each of the fullscreen clients, so that when the clients are layered, other client’s data comes through (actually, the cuts we make are mutually exclusive, so when we are cutting holes, no two clients share the same pixels, and when all of the layers are combined, all pixels are accounted for). 


I’m struggling trying to figure out the best way to implement this. Should each client be rendering into RAM or VRAM? What is the best way to composite these fullscreen windows using Mir?


Thanks,
- Rian


> On Jan 23, 2014, at 9:35 PM, Daniel van Vugt <daniel.van.vugt at canonical.com> wrote:
> 
> 
> Rian,
> 
> 
> Both of the issues you describe /had/ simple solutions, documented under
> "Running Mir natively":
> http://unity.ubuntu.com/mir/using_mir_on_pc.html
> or: $SRC/doc/using_mir_on_pc.md
> 
> 
> Though I just retested non-root clients with a root server, and it
> doesn't work as documented. So that's a bug, sorry;
> https://bugs.launchpad.net/mir/+bug/1272143
> 
> 
> - Daniel
> 
> 
> 
> 
> On 23/01/14 20:48, Rian Quinn wrote:
> 
> 
>> I would prefer to run the server as non-root, but if I attempt to do
>> that, it complains about not being able to open the DRM device. If I run
>> the fingerprint demo as non-root, and the server as root, the client
>> complains about not being able to make a connection to the server. And
>> some of the clients I cannot get to connect at all regardless of root or
>> not (like all of the EGL examples).
>> 
>> 
>> I am a little confused though. If Mir is to replace X someday, clients
>> will have to be able to be run as non-root. The ideal solution is where
>> both the server/compositor, and clients are running as non-root which is
>> one of the things that X doesn’t do today. Are there plans to fixing the
>> privilege issue (everything needing root), or am I not understanding
>> something.
>> 
>> 
>> Thanks
>> - Rian
>> 
>> 
>>> On Jan 22, 2014, at 9:35 PM, Daniel van Vugt
>>> <daniel.van.vugt at canonical.com> wrote:
>>> 
>>> 
>>> Q: Does Mir support multiple monitors? If so, do you have any examples
>>> or at least a starting point on how to set that up.
>>> A: Yes... The API for affecting the multi-monitor config is
>>> mir_connection_create_display_config
>>> mir_connection_apply_display_config
>>> etc.. http://unity.ubuntu.com/mir/group__mir__toolkit.html
>>> To enable basic multi-monitor testing you can:
>>> mir_demo_server_shell --display-config sidebyside
>>> Mir's multi-monitor configuration is already used in detail by XMir.
>>> That's how you can configure displays from X under XMir.
>>> 
>>> 
>>> Q: How does Mir handle surfaces with shapes cut out of them. For
>>> example, a smiley face where the background is shown through the eyes
>>> and mouth.
>>> A: Create your surface with an alpha channel (e.g.
>>> mir_pixel_format_abgr_8888) and then any pixels with alpha==0 will be
>>> transparent. As an example of a free-form shape, you can run:
>>> mir_demo_client_egltriangle -b 0.0
>>> 
>>> 
>>> Q: Do clients need to have root access. For the fingerprint test, I
>>> could not get it to run without a sudo.
>>> A: Yes and no. A client can run as the same user as the server,
>>> including non-root. This works perfectly for touch (Android) devices
>>> however desktop has the problem of requiring root to access input
>>> devices. You can run mir server and client on desktop as non-root but
>>> you won't be able to interact with it.
>>> 
>>> 
>>> 
>>> 
>>> 
>>> On 23/01/14 01:21, Rian Quinn wrote:
>>> 
>>> 
>>> Daniel,
>>> 
>>> 
>>> I was able to update my system, and my sources and was able to get Mir
>>> up and running.
>>> 
>>> 
>>> I am actually really impressed with the Mir source code. We were
>>> considering writing a lot of this ourselves, but I think that Mir has
>>> everything that we need already.
>>> 
>>> 
>>> I do have a couple of questions.
>>> - Does Mir support multiple monitors? If so, do you have any
>>> examples or
>>> at least a starting point on how to set that up.
>>> - How does Mir handle surfaces with shapes cut out of them. For
>>> example,
>>> a smiley face where the background is shown through the eyes and
>>> mouth.
>>> - Do clients need to have root access. For the fingerprint test, I
>>> could
>>> not get it to run without a sudo.
>>> 
>>> 
>>> Thanks,
>>> - Rian
>>> 
>>> 
>>> For others interested in how I got Mir up and running, here were
>>> my steps:
>>> 
>>> 
>>> 1:
>>> Install the 3.13 linux kernel. Here is what I used for that:
>>> http://linuxg.net/how-to-install-kernel-3-13-rc-7-on-ubuntu-linux-mint-pear-os-and-elementary-os/
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 2:
>>> Install libDRM from the following PPA:
>>> https://launchpad.net/~oibaf/+archive/graphics-drivers/
>>> 
>>> 
>>> 3:
>>> run sudo apt-get build-dep mir
>>> 
>>> 
>>> 4:
>>> Download and compile Mir form the following:
>>> http://unity.ubuntu.com/mir/building_source_for_pc.html
>>> 
>>> 
>>> 5:
>>> Download and compile Mir's version of Mesa and here are the
>>> compilation
>>> steps:
>>> http://www.mesa3d.org/install.html
>>> 
>>> 
>>> I had to add --disable-dri3 to get it to compile, plus the
>>> --with-egl-platform=mir,drm
>>> 
>>> 
>>> Once I was done with that, I could get the examples to execute.
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> On Tue, Jan 21, 2014 at 8:44 PM, Daniel van Vugt
>>> <daniel.van.vugt at canonical.com <mailto:daniel.van.vugt at canonical.com>>
>>> wrote:
>>> 
>>> 
>>> Rian,
>>> 
>>> 
>>> VMware (Thomas Hellstrom) has implemented Mir support. Apparently
>>> you need kernel 3.13 for the requisite graphics driver DRM changes.
>>> And you need a newish Mesa.
>>> 
>>> 
>>> I don't think anyone has documented the particulars yet. But we
>>> certainly should at least by the time regular Ubuntu (trusty?) has
>>> all the prerequisites in place.
>>> 
>>> 
>>> - Daniel
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> On 22/01/14 05:08, Rian Quinn wrote:
>>> 
>>> 
>>> Is it possible to get Mir up and running in a Virtual Machine. I
>>> have
>>> both VMWare and VirtualBox. Currently, under VMWare, you get an
>>> error
>>> about open_drm_device. Basically, I am working with Mir for some
>>> client
>>> / server development, and would like to do testing in a virtual
>>> machine
>>> to start.
>>> 
>>> 
>>> Thanks,
>>> - Rian
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/mir-devel/attachments/20140124/b3538675/attachment.html>


More information about the Mir-devel mailing list