New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 772524 link

Starred by 5 users

Issue metadata

Status: Fixed
Owner: ----
Closed: Sep 12
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug

Blocked on:
issue 782268
issue 786067
issue 787814

Blocking:
issue 730193



Sign in to add a comment

Detangle VSync/BeginFrames from browser process when running viz

Project Member Reported by kylec...@chromium.org, Oct 6 2017

Issue description

There is a lot of code in GpuProcessTransportFactory and ui::Compositor that deals with vsync. GpuProcessTransportFactory won't be used and ui::Compositor won't be in the same process as the viz::Display anymore. The vsync code needs to be audited and some of it will move to the viz process (probably).
 
There are three methods in ContextFactoryPrivate related to vsync plus the CompositorVSyncManager class.

ContextFactoryPrivate::SetAuthoritativeVSyncInterval()
It looks like this is only used on Chrome OS to set the vsync interval based on the display refresh rate. This is reported to CompositorVSyncManager.

ContextFactoryPrivate::SetDisplayVSyncParameters()
This is provided to the ContextProvider as an UpdateVSyncParametersCallback. The vsync parameters come from the GPU process. It's also called directly in BrowserCompositorMac::UpdateVSyncParameters. This is reported to CompositorVSyncManager.

ContextFactoryPrivate::IssueExternalBeginFrame
This is used by headless to issue begin frames from the BeginFrameSource associated with a particular ui::Compositor.

CompositorVSyncManager
This is owned by a ui::Compositor. It keeps track of the parameters mentioned above and notifies a list of observers when they change. The observers are in exo and DelegatedFrameHost.
GpuVSyncBeginFrameSource will also need to change. Since the display compositor is in the GPU process there is no need to send a vsync signal from GPU to browser that then triggers a GpuVSyncBeginFrameSource.
Labels: -Pri-3 Pri-2
Owner: kylec...@chromium.org
Status: Assigned (was: Available)
I'll take this on, at least in the context of getting --enable-viz working with Linux desktop and possibly Chrome OS.
Cc: enne@chromium.org
On Linux and Chrome OS it looks like we use a synthetic BeginFrameSource (it ticks based on a timer) and we update the timer based on periodic vsync timing information. The vsync timing updates come from the GPU process so this is pretty simple. It (mostly) works correctly with --enable-viz already.

On Windows the actual BeginFrame signal can come from the GPU process (from D3D to be exact). This is because of problems with timer resolution. This uses GpuVSyncBeginFrameSource and GpuVSyncProviderWin. This can be greatly simplified with the display compositor in the GPU. This is closer to a normal ExternalBeginFrame source again. Windows works similar to Linux otherwise with a synthetic BeginFrameSource.

For Mac and Android an external BeginFrameSource is used with the signal coming from the system in the browser process. I'm not sure if the GPU process is allowed to receive the system vsync signal. If not, I think we need to do the opposite of the Windows D3D case today, basically sending the BeginFrame signal from browser to GPU for each frame.
Cc: briander...@chromium.org sunn...@chromium.org
Blockedon: 782268

Comment 8 by laforge@google.com, Nov 8 2017

Components: -Internals>Viz Internals>Services>Viz
Migrating from Internals>Viz to Internals>Services>Viz.
Summary: Detangle VSync/BeginFrames from browser process when running viz (was: Detangle vsync from browser process when running viz)
Blockedon: 441577
Blockedon: 786067
Project Member

Comment 12 by bugdroid1@chromium.org, Nov 18 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/14e8a9bb81b244d39909a0f5897489fed3652365

commit 14e8a9bb81b244d39909a0f5897489fed3652365
Author: kylechar <kylechar@chromium.org>
Date: Sat Nov 18 00:44:00 2017

viz: Add IPC to set authoritative vsync inteval.

This call originates in the browser process and is passed back to a
SyntheticBeginFrameSource in the GPU process. This is pretty simple
plumbing.

The change requires RootCompositorFrameSinkImpl knowing it has a
SyntheticBeginFrameSource. Wrap up the results of DisplayProvider into a
struct so that we can handle the ExternalBeginFrameSource case too
without adding more output parameters.

Bug:  772524 
Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel
Change-Id: I9af43d4278475d07d19aefe7a03b6ee2426b536d
Reviewed-on: https://chromium-review.googlesource.com/767352
Commit-Queue: kylechar <kylechar@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Cr-Commit-Position: refs/heads/master@{#517637}
[modify] https://crrev.com/14e8a9bb81b244d39909a0f5897489fed3652365/components/viz/service/display_embedder/display_provider.h
[modify] https://crrev.com/14e8a9bb81b244d39909a0f5897489fed3652365/components/viz/service/display_embedder/gpu_display_provider.cc
[modify] https://crrev.com/14e8a9bb81b244d39909a0f5897489fed3652365/components/viz/service/display_embedder/gpu_display_provider.h
[modify] https://crrev.com/14e8a9bb81b244d39909a0f5897489fed3652365/components/viz/service/frame_sinks/frame_sink_manager_impl.cc
[modify] https://crrev.com/14e8a9bb81b244d39909a0f5897489fed3652365/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc
[modify] https://crrev.com/14e8a9bb81b244d39909a0f5897489fed3652365/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.h
[modify] https://crrev.com/14e8a9bb81b244d39909a0f5897489fed3652365/content/browser/compositor/viz_process_transport_factory.cc
[modify] https://crrev.com/14e8a9bb81b244d39909a0f5897489fed3652365/services/viz/privileged/interfaces/compositing/display_private.mojom

Blocking: -730193 787097
Blockedon: 787814
Project Member

Comment 15 by bugdroid1@chromium.org, Feb 8 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e086c175bea7923d7e85e7ae1fa581a3ce7225e8

commit e086c175bea7923d7e85e7ae1fa581a3ce7225e8
Author: kylechar <kylechar@chromium.org>
Date: Thu Feb 08 18:36:20 2018

viz: Send vsync parameters from browser to gpu.

On macOS the vsync signal is received in the browser process. When
running with VizDisplayCompositor send IPC with vsync paramaters to the
BeginFrameSource in the GPU process.

Bug:  772524 , 772576
Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel
Change-Id: I22d2036bdfb6589ba3342fa4972b670d105376ec
Reviewed-on: https://chromium-review.googlesource.com/907597
Reviewed-by: ccameron <ccameron@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: kylechar <kylechar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#535451}
[modify] https://crrev.com/e086c175bea7923d7e85e7ae1fa581a3ce7225e8/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc
[modify] https://crrev.com/e086c175bea7923d7e85e7ae1fa581a3ce7225e8/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.h
[modify] https://crrev.com/e086c175bea7923d7e85e7ae1fa581a3ce7225e8/content/browser/compositor/viz_process_transport_factory.cc
[modify] https://crrev.com/e086c175bea7923d7e85e7ae1fa581a3ce7225e8/services/viz/privileged/interfaces/compositing/display_private.mojom

Blocking: -787097 730193
There shouldn't be anything here left blocking a finch trial on Windows/Linux/Mac.
Owner: ----
Status: Available (was: Assigned)
Blockedon: -441577
Status: Fixed (was: Available)

Sign in to add a comment