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

Issue 786067 link

Starred by 4 users

Issue metadata

Status: Fixed
Owner:
Closed: Apr 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows
Pri: 2
Type: Bug

Blocked on:
issue 730660
issue 817364

Blocking:
issue 772524



Sign in to add a comment

viz: Make headless external BeginFrames work with --enable-viz.

Project Member Reported by kylec...@chromium.org, Nov 16 2017

Issue description

When running headless Chrome HeadlessWebContentsImpl provides signal to trigger BeginFrame messages. This signal is routed through the following callstack:

HeadlessWebContentsImpl::BeginFrame()
Compositor::IssueExternalBeginFrame()
GpuProcessTransportFactory::IssueExternalBeginFrame()
ExternalBeginFrameController::IssueExternalBeginFrame()
ExternalBeginFrameSource::OnBeginFrame()

When running with --enable-viz the ExternalBeginFrameSource will be located in the GPU process so HeadlessWebContentsImpl can't trigger it directly. It's possible to send the signal over IPC to the GPU, but that will introduce some extra delay. 

The headless BeginFrame signal is also closely linked to saving a screenshot, so this could add more requirements.
 
Cc: -fsammoura@chromium.org fsam...@chromium.org
Status: Available (was: Untriaged)
Delay isn't really an issue for headless. I chatted about this with Fady a little while back in the context of this patch [1]. I believe we were thinking of adding a Mojo interface dispensed by frame_sink_manager.mojom for enabling external BFC, issuing a BeginFrame, and receiving OnNeedsExternalBeginFrames, OnDisplayDidFinishFrame events.

Back then, the cc::Display was still being created outside viz so implementing this interface wasn't really possible yet. Has this changed now? :)

[1] https://chromium-review.googlesource.com/c/chromium/src/+/558252
With --enable-viz the display is created in the GPU process by FrameSinkManagerImpl now. I think that should totally be possible.
 Issue 771138  has been merged into this issue.
Owner: eseckler@chromium.org
Status: Started (was: Available)
Started looking into this now, first attempt here: https://crrev.com/c/856776.
Project Member

Comment 6 by bugdroid1@chromium.org, Jan 11 2018

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

commit 7cbb0434311955d3ea4aa4d3bf5980202efbf898
Author: Eric Seckler <eseckler@chromium.org>
Date: Thu Jan 11 20:48:35 2018

viz: Add support for external BeginFrames.

Adds an ExternalBeginFrameController mojo interface dispensed by the
FrameSinkManager / RootCompositorFrameSink.

No viz tests yet - We currently test this feature only via integration
tests in headless, but these tests require support for copy requests,
which is still WIP for viz.

Bug:  786067 
Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel
Change-Id: If52af408b0a7ebf2c9acd147e256d408d5fb7e46
Reviewed-on: https://chromium-review.googlesource.com/856776
Reviewed-by: Sadrul Chowdhury <sadrul@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Antoine Labour <piman@chromium.org>
Reviewed-by: kylechar <kylechar@chromium.org>
Commit-Queue: Eric Seckler <eseckler@chromium.org>
Cr-Commit-Position: refs/heads/master@{#528747}
[modify] https://crrev.com/7cbb0434311955d3ea4aa4d3bf5980202efbf898/components/viz/host/host_frame_sink_manager.cc
[modify] https://crrev.com/7cbb0434311955d3ea4aa4d3bf5980202efbf898/components/viz/host/host_frame_sink_manager.h
[modify] https://crrev.com/7cbb0434311955d3ea4aa4d3bf5980202efbf898/components/viz/host/host_frame_sink_manager_unittest.cc
[modify] https://crrev.com/7cbb0434311955d3ea4aa4d3bf5980202efbf898/components/viz/service/BUILD.gn
[modify] https://crrev.com/7cbb0434311955d3ea4aa4d3bf5980202efbf898/components/viz/service/display_embedder/display_provider.h
[add] https://crrev.com/7cbb0434311955d3ea4aa4d3bf5980202efbf898/components/viz/service/display_embedder/external_begin_frame_controller_impl.cc
[add] https://crrev.com/7cbb0434311955d3ea4aa4d3bf5980202efbf898/components/viz/service/display_embedder/external_begin_frame_controller_impl.h
[modify] https://crrev.com/7cbb0434311955d3ea4aa4d3bf5980202efbf898/components/viz/service/display_embedder/gl_output_surface.cc
[modify] https://crrev.com/7cbb0434311955d3ea4aa4d3bf5980202efbf898/components/viz/service/display_embedder/gpu_display_provider.cc
[modify] https://crrev.com/7cbb0434311955d3ea4aa4d3bf5980202efbf898/components/viz/service/display_embedder/gpu_display_provider.h
[modify] https://crrev.com/7cbb0434311955d3ea4aa4d3bf5980202efbf898/components/viz/service/frame_sinks/compositor_frame_sink_support.cc
[modify] https://crrev.com/7cbb0434311955d3ea4aa4d3bf5980202efbf898/components/viz/service/frame_sinks/frame_sink_manager_impl.cc
[modify] https://crrev.com/7cbb0434311955d3ea4aa4d3bf5980202efbf898/components/viz/service/frame_sinks/frame_sink_manager_impl.h
[modify] https://crrev.com/7cbb0434311955d3ea4aa4d3bf5980202efbf898/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc
[modify] https://crrev.com/7cbb0434311955d3ea4aa4d3bf5980202efbf898/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.h
[modify] https://crrev.com/7cbb0434311955d3ea4aa4d3bf5980202efbf898/components/viz/test/test_frame_sink_manager.h
[modify] https://crrev.com/7cbb0434311955d3ea4aa4d3bf5980202efbf898/content/browser/BUILD.gn
[add] https://crrev.com/7cbb0434311955d3ea4aa4d3bf5980202efbf898/content/browser/compositor/external_begin_frame_controller_client_impl.cc
[add] https://crrev.com/7cbb0434311955d3ea4aa4d3bf5980202efbf898/content/browser/compositor/external_begin_frame_controller_client_impl.h
[modify] https://crrev.com/7cbb0434311955d3ea4aa4d3bf5980202efbf898/content/browser/compositor/gpu_process_transport_factory.cc
[modify] https://crrev.com/7cbb0434311955d3ea4aa4d3bf5980202efbf898/content/browser/compositor/viz_process_transport_factory.cc
[modify] https://crrev.com/7cbb0434311955d3ea4aa4d3bf5980202efbf898/content/browser/compositor/viz_process_transport_factory.h
[modify] https://crrev.com/7cbb0434311955d3ea4aa4d3bf5980202efbf898/services/ui/ws/server_window.cc
[modify] https://crrev.com/7cbb0434311955d3ea4aa4d3bf5980202efbf898/services/ui/ws/server_window_delegate.h
[modify] https://crrev.com/7cbb0434311955d3ea4aa4d3bf5980202efbf898/services/ui/ws/window_server.cc
[modify] https://crrev.com/7cbb0434311955d3ea4aa4d3bf5980202efbf898/services/viz/privileged/interfaces/compositing/BUILD.gn
[add] https://crrev.com/7cbb0434311955d3ea4aa4d3bf5980202efbf898/services/viz/privileged/interfaces/compositing/external_begin_frame_controller.mojom
[modify] https://crrev.com/7cbb0434311955d3ea4aa4d3bf5980202efbf898/services/viz/privileged/interfaces/compositing/frame_sink_manager.mojom
[modify] https://crrev.com/7cbb0434311955d3ea4aa4d3bf5980202efbf898/services/viz/public/cpp/compositing/begin_frame_args_struct_traits.cc
[modify] https://crrev.com/7cbb0434311955d3ea4aa4d3bf5980202efbf898/services/viz/public/cpp/compositing/begin_frame_args_struct_traits.h
[modify] https://crrev.com/7cbb0434311955d3ea4aa4d3bf5980202efbf898/services/viz/public/cpp/compositing/struct_traits_unittest.cc
[modify] https://crrev.com/7cbb0434311955d3ea4aa4d3bf5980202efbf898/services/viz/public/interfaces/compositing/begin_frame_args.mojom

External BeginFrames per-se work now with viz, but headless also needs support for CopyOutputRequests and plumbing of WebContentsObserver::DidReceiveCompositorFrame().
Cc: jonr...@chromium.org
miu: What is the status of CopyOutputRequests under the new capture path? Will you be handling making CopyOutputRequests work or do you need help with that part?

jonross: I think you had started looking at plumbing some sort of did receive 
CompositorFrame signal back to the browser?
Yeah I have setup a way to send some metadata from the renderer to the browser, and then synchronizing this to the FrameToken associated with a compositor frame submission.

Right now you have to request this each time, but I'm looking at establishing a permanent observer model
Blockedon: 730660
Project Member

Comment 11 by bugdroid1@chromium.org, Mar 1 2018

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

commit 4f0eb9faaaf1468aa5e0ebed51f63966a6b09f07
Author: Eric Seckler <eseckler@chromium.org>
Date: Thu Mar 01 11:23:21 2018

headless/viz: Prepare headless for viz compatibility.

Viz doesn't really support WebContentsObserver::DidReceiveCompositorFrame. As our
use of this for headless isn't really necessary in full-pipe + surface-sync mode
(now our supported configuration), this patch removes this use along with related
DevTools parameters / events.

Also refactors CompositorController / VirtualTimeController's
StartDeferrer: CompositorController is now able to defer both start and
resume of virtual time. This way, it knows for certain that all other
tasks have completed the current virtual time pause and that virtual
time is about to resume.

Tests still fail with --enable-features=VizDisplayCompositor, probably because
viz's support for software compositing isn't fully ready yet.

Bug:  786067 
Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel
Change-Id: Iba775e4ef7ed77d7d7bf9837d6971be70a53cedb
Reviewed-on: https://chromium-review.googlesource.com/934723
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Reviewed-by: Sami Kyöstilä <skyostil@chromium.org>
Reviewed-by: Alex Clarke <alexclarke@chromium.org>
Commit-Queue: Eric Seckler <eseckler@chromium.org>
Cr-Commit-Position: refs/heads/master@{#540128}
[modify] https://crrev.com/4f0eb9faaaf1468aa5e0ebed51f63966a6b09f07/content/public/test/browser_test_utils.cc
[modify] https://crrev.com/4f0eb9faaaf1468aa5e0ebed51f63966a6b09f07/content/public/test/browser_test_utils.h
[modify] https://crrev.com/4f0eb9faaaf1468aa5e0ebed51f63966a6b09f07/headless/lib/DEPS
[modify] https://crrev.com/4f0eb9faaaf1468aa5e0ebed51f63966a6b09f07/headless/lib/browser/headless_devtools_manager_delegate.cc
[modify] https://crrev.com/4f0eb9faaaf1468aa5e0ebed51f63966a6b09f07/headless/lib/browser/headless_web_contents_impl.cc
[modify] https://crrev.com/4f0eb9faaaf1468aa5e0ebed51f63966a6b09f07/headless/lib/browser/headless_web_contents_impl.h
[modify] https://crrev.com/4f0eb9faaaf1468aa5e0ebed51f63966a6b09f07/headless/lib/headless_web_contents_browsertest.cc
[modify] https://crrev.com/4f0eb9faaaf1468aa5e0ebed51f63966a6b09f07/headless/public/util/compositor_controller.cc
[modify] https://crrev.com/4f0eb9faaaf1468aa5e0ebed51f63966a6b09f07/headless/public/util/compositor_controller.h
[modify] https://crrev.com/4f0eb9faaaf1468aa5e0ebed51f63966a6b09f07/headless/public/util/compositor_controller_browsertest.cc
[modify] https://crrev.com/4f0eb9faaaf1468aa5e0ebed51f63966a6b09f07/headless/public/util/compositor_controller_unittest.cc
[modify] https://crrev.com/4f0eb9faaaf1468aa5e0ebed51f63966a6b09f07/headless/public/util/virtual_time_controller.cc
[modify] https://crrev.com/4f0eb9faaaf1468aa5e0ebed51f63966a6b09f07/headless/public/util/virtual_time_controller.h
[modify] https://crrev.com/4f0eb9faaaf1468aa5e0ebed51f63966a6b09f07/headless/public/util/virtual_time_controller_test.cc
[modify] https://crrev.com/4f0eb9faaaf1468aa5e0ebed51f63966a6b09f07/third_party/WebKit/Source/core/inspector/browser_protocol.json
[modify] https://crrev.com/4f0eb9faaaf1468aa5e0ebed51f63966a6b09f07/third_party/WebKit/Source/core/inspector/browser_protocol.pdl

Blockedon: 817364
Another work item: I don't think that viz passes on --run-all-compositor-stages-before-draw to the DisplayScheduler (as wait_for_all_surfaces_before_draw) in GpuDisplayProvider yet.
Project Member

Comment 14 by bugdroid1@chromium.org, Mar 15 2018

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

commit ad1de109e5979edfb3e7544f70de7da2ad58bdb6
Author: Eric Seckler <eseckler@chromium.org>
Date: Thu Mar 15 14:51:56 2018

viz: Add support for headless + full-pipe mode flags.

Use SoftwareOutputDevice for headless and pass on the full-pipeline flag to the
viz process and its DisplayScheduler.

Bug:  786067 
Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel
Change-Id: Ief3a80777cf339b435724410f45ae64686c4beff
Reviewed-on: https://chromium-review.googlesource.com/960862
Commit-Queue: Eric Seckler <eseckler@chromium.org>
Reviewed-by: Antoine Labour <piman@chromium.org>
Reviewed-by: kylechar <kylechar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#543369}
[modify] https://crrev.com/ad1de109e5979edfb3e7544f70de7da2ad58bdb6/components/viz/service/display_embedder/gpu_display_provider.cc
[modify] https://crrev.com/ad1de109e5979edfb3e7544f70de7da2ad58bdb6/components/viz/service/display_embedder/gpu_display_provider.h
[modify] https://crrev.com/ad1de109e5979edfb3e7544f70de7da2ad58bdb6/components/viz/service/main/DEPS
[modify] https://crrev.com/ad1de109e5979edfb3e7544f70de7da2ad58bdb6/components/viz/service/main/viz_main_impl.cc
[modify] https://crrev.com/ad1de109e5979edfb3e7544f70de7da2ad58bdb6/content/browser/gpu/gpu_process_host.cc

Status: Fixed (was: Started)

Sign in to add a comment