Hi,
(..)
>>
>> I would like to confirm what is the envisioned way to have
>> service/ui's connector instance available to
>> OzonePlatform::InitiliazeForGPU .
>
> I'm still sorting this out but the high-level details are something like
> this:
>
> service/ui will be two processes (it isn't because we have been figuring out
> the details of the division):
>
> 1. the window server
> (
https://cs.chromium.org/chromium/src/services/ui/main.cc)
>
> 2. the gpu server (which doesn't have a mainline yet.) But when it does, it
> will look something like so:
>
> MojoResult ServiceMain(MojoHandle service_request_handle) {
> shell::ServiceRunner runner(new ui::GpuService);
> runner.set_message_loop_type(base::MessageLoop::TYPE_UI);
> return runner.Run(service_request_handle);
> }
>
> The ui::GpuService's shell::Service implementation will have a
> ui::GpuService::OnStart and that method will call
> OzonePlatform::InitiliazeForGPU like the window server (1) calls it now
> (
https://cs.chromium.org/chromium/src/services/ui/service.cc?rcl=0&l=159)
>
> At that point, Ozone will have a mojo connector() in both ws and gpu
> processes and they can establish connections to each other as mediated by
> the manifest files.
This is a good point.
If I understand things correctly, from a Mojo perspective, it would
not matter whether the Mus-Ws and Mus-GPU code are on different
*processes* or on different *threads* ; the communication through Mojo
happens transparently to it.
So, in order to prepare the GPU side in Ozone/Wayland for the future,
I was thinking if it would make things any easier if Mus-WS and
Must-GPU code run on different threads (my reading of the code is that
they are on the same process, same thread?).
For instance, DRM-GBM Ozone backend is able to "clone" Mus-WS's
connector and establish a communication channel just fine.
>> For instance, I see that for OzonePlatform::InitializeForUI, it is
>> called directly from Service::OnStart (services/ui/service.cc), with
>> the proper connector instance as parameter.
>>
>> In case of OzonePlatform::InitializeForGPU, though, it is called
>> indirectly with
>>
>> ui::Service::OnStart
>> ui::ws::WindowServer::WindowServer
>> ui::ws::GpuServiceProxy::GpuServiceProxy
>> ui::GpuMain::GpuMain
>> gpu::GpuInit::InitializeAndStartSandbox
>> gl::init::InitializeGLOneOff
>> OzonePlatform::InitiliazeForGPU
>
> Yeah. For a variety of reasons, I want to move that to where I talk about it
> above. And currently, it's not setup correctly at all in standard Chrome.
> (Standard Chrome doesn't use mojo in ozone so this doesn't matter yet.)
So Fred (CC'ed) have been experimenting with Mojo in Ozone/X11, on
ChromeOS builds of Chrome, launched --mash parameter, and make it
Mojo-capable.
This configuration was chosen because it is what the most functional
Ozone backend (X11) at the moment.
>>
>> Fred Wang (in cc) experimented with a CL where the "connector"
>> instance is passed through the code path, as parameter:
>>
https://codereview.chromium.org/2342003003/
>>
>> What do you guys think?
>
> I was still thinking about it. I don't think we know how we want it to be in
> a non-mus context. The mus approach (at least at some level of abstraction
> -- many details are undecided) is the broadly agreed to plan of record so my
> preference for wayland support would be to head towards where we're going
> and sort out how wayland can integrate with mus. Which probably requires
> some design discussion. But doing this does have one large advantage: mus
> (ws) mostly solves how to structure support for (I'll invent terminology
> here) internal-window vs external-window problem. [1]. I presume that our
> eventual goal is Chrome built ozone=true, cros=false to support both X11 and
> wayland. But it will take a while.
>
>
> [1] internal-window is a name that I just made up for how ChromeOS-Chrome
> manages windows: there is a single acceleratedWidget for a single physical
> display and all of Chrome's windows (popups, browsers, etc.) are (aura)
> windows inside of this single display. external-window is the converse: the
> way that {mac,linux,windows}-Chrome makes a new platform window (and hence
> acceleratedWidget) for each Chrome window.
Understood.
In Fred's CL above, the main goal was to make a Connector instance
available to Ozone/Wayland GPU side. As I said before it might still
be helpful thing to do, even before we have the WS / GPU process
separation.
In other words, if we run them on different thread, making using of
mojo to communicate them would be helpful, and should just work when
the split up happens.
--
--Antonio Gomes