-
Notifications
You must be signed in to change notification settings - Fork 82
Simplify existing solution for IPC channel communication #93
Comments
Initial solution can be found here: https://github.com/kalyankondapally/ozone-wayland/commits/IPCHandShake |
This is how it would work after these changes: Single Process:
Multi-Process:
GPUProcess:
OutPutMode Synchronizaton: DelayedChannelInitialization ensures that any initial output size notification is sent to browser process. In case the event hasn't arrived yet, we force a synchronized wayland flush. |
per discussion on IRC with @kalyankondapally, I'll prepare a branch to be reviewed with the changes for clean up first before going with the discussions on the solution we're intending to do. I'll be posting here it. |
alright. I'd like to push to master the following. Please review it @kalyankondapally: https://github.com/01org/ozone-wayland/tree/ipc-cleanup |
this branch now contains the after-review changes: |
@kalyankondapally, I read the description you put in #93 (comment) and I think that's indeed a good approach to follow. Thank you for summarizing. I have two main worries though, so let's make sure we'll be covering them next:
finally, I've seen you pulled in master my "ipc-cleanup-v2" branch. Thanks. Maybe now you want to follow-up with your clean-ups before we go to code the solution for the biggest problem? |
@tiagovignatti I am bit concerned with this. This happens way before GPUProcessHost is created(i.e GPU process is forked). I would prefer one of the following solutions for this: Reg GPU process & Browser Process: Probably you meant 4 different threads: Yes, these changes ensure that all these threads are initialized before appropriate functions are called. It looks for me that there are two different things to solve: As dust has settled down, I am in no hurry to get my changes in as yet. We can take time and carefully go through this. I would like to have a concrete solution before starting to make any changes for the code. We would need to live with this for some time and thus would like to ensure both of us are happy with it. As of now the branch https://github.com/kalyankondapally/ozone-wayland/commits/IPCHandShake implements the proposal. |
alright, thanks for the explanation on those two points I was worried. I've liked that you separated the issues in different tasks. Let's follow now there instead. |
@kalyankondapally, can you please review this one: I think it pretty much summarizes a bunch of what we've been discussing lately. It doesn't deal directly with IPC channel handshake though -- I'd like to solve this anyway next so we won't have those ugly hacks in OzoneDisplay::RealizeAcceleratedWidget() and so on. Another thing is that Chrome browser now starts alright but gets a pretty small root window. We need to solve it and I think there's some changes that happened upstream that it went unnoticed. If you want/prefer, feel free to take over this series until I'll be online again hacking, next Monday (07.10). |
@tiagovignatti As we seem to be happy with the above mentioned proposal, and it is already implemented in the above mentioned branch. I will break that up for review. I will not hijack your OutMode fixes as my interest was only to get the IPC communication simplified. I am quite happy with it now. |
yes. I see that the order of patches go like this:
|
To be honest 2 and 3 are not related. I see what you mean though (merge conflicts :( ). As agreed in IRC: I will breakdown IPCHandShake branch now. |
k, Now changes related to IPC Simplification are here: For now, I have adopted your earlier approach of registering Listener in BrowserProcess side during GetAcceleratedWidget call. In GPU process side it will initiate the connection once GPU Child thread is created. I have created a separate task for initializing IPC communication on Browser Process side as this should also handle cases when GPU process is re-spawned. #102 |
I would actually like to propose to delay this task till #29 is handled, as this will greatly influence the solution. I will start with 29 and update any IPC related comments here. This would give us a complete picture and a better understanding of what we need. @tiagovignatti In the mean time, I think we can integrate your proposal with out the Establish Channel changes. I will try to separate your proposal and put it up for review. |
makes perfect sense for me. I'll be waiting the remaining patches for review then. Thanks. |
@tiagovignatti pls review here: kalyankondapally@aa5f1ec |
BrowserChildProcessHostConnected notification, that's executed by the runner loop, is too late as well to start the GPU and browser process handshaking. Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com> The patch was imported from https://github.com/tiagovignatti/ozone-wayland/ as of commit id 6922a29. 1)Revert changes related to EstablishChannel. 2)Ensure ChannelConnected flag is set properly. This would ensure that we don't add host as filter more than once. Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
I think we are able to close this now. |
IPC channel communication:
Background:
Gpu Process acts as the wayland client per browser instance. All realized widgets are created on GPU process side. Browser process needs to send any widget state change, e.g. Min, Max, FullScreen information to DisplayChannel. This information would be used to update wayland shell. Also, any output related information (e.g. output size) needs to be passed from GPU process to Browser process.
Current Solution:
DisplayChannelHost: Message filter on Browser process side.
DisplayChannel: Ipc listener on GPU process side.
On Browser Process Side:
We observe for any child process being forked by Browser process. If child process is GPU process, we add DisplayChannelHost as one of the BrowserMessageFilter. DisplayChannelHost listens to any messages specific to Wayland coming from GPU process side and handles them appropriately.
On GPU process side:
DisplayChannel is responsible for listening to any routed messages coming from Browser process and handles them appropriately. GPUChildThread needs to be created before DisplayChannel can be added as listener. InitializeHardware gets called very early (before GPUChildThread is created) and hence not the right place to set up DisplayChannel as listener. Thus, we use RealizeWidget to do this, which is wrong.
Issues:
1)In order to avoid changes in chromium, we have been adding work around's as to how and when listeners are installed. This has complicated the existing solution.
2)OutputSize notification is too late. The value returned by DefaultDisplaySpec is used by widget as the work area of current screen. This information needs to come from GPU side and is needed before any calculations related to widget bounds are done. With the current solutions, it's already too late as to when the listeners are setup and communication happens between them.
Proposal:
On Browser Process side:
Set DisplayChannelHost as message filter as soon as GPUProcesshost is created.
On GPU Process side:
Set DisplayChannel as IPC listener as soon as GPUChildThread is created.
Remove any un-necessary complication from the solution, even if it means having to maintain minor changes in Chromium.
Single and Multi Process should work.
Not part of this CL:
1)Handle GPU crash and re-launch. This is something we might need to handle in future.
The text was updated successfully, but these errors were encountered: