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

Issue 727775 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Sep 26
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocked on:
issue 776877



Sign in to add a comment

Provide a presentation feedback for a CompositorFrame

Project Member Reported by penghuang@chromium.org, May 30 2017

Issue description

To implement exo wp_presentation interface, we need a presentation feedback for every compositor frame. The feedback info includes an accurate timestamp to indicate when a frame was presented to user and a refresh to indicate when the next frame will be presented to user.
 
WillDrawSurface basically does this but it's a very chatty API: it gets called for every display frame that embeds the given surface ID.

I would suggest the following API:

interface MojoCompostiorFrameSink {
...
  SetNeedsDrawCallback(bool needs_callback);
...
};

interface MojoCompositorFrameSinkClient {
...
  WillDrawSurface(SurfaceId surface_id);
...
};

WillDrawSurface would only be called if the clients needs the draw callback. If the client no longer needs the draw callback then viz stops calling WillDrawSurface. WDYT?
Note that the time stamps can't be from when we draw the buffer. They need to be the exact time stamp for the page flip that presented the buffer.
Blocking: 601863
Cc: piman@chromium.org
Components: Internals>Compositing
Labels: displaycompositor
Here's where it's propagated now...I think? https://cs.chromium.org/chromium/src/gpu/ipc/service/pass_through_image_transport_surface.cc?l=184
WillDrawSurface doesn't provide the information which exo needs. I think we need add two new IPC for it. They will look like:

struct FrameMetaData {
..
  // A token for presentation feedback. If it is not zero,
  // the presentation feedback will be provided via
  // DidPresentCompositorFrame or DidDiscardCompositorFrame.
  uint32 presentation_token;
...
};

interface MojoCompositorFrameSinkClient {
...
  DidPresentCompositorFrame(uint32 presentation_token, TimeTicks timestamp, TimeDelta refresh);
  DidDiscardCompositorFrame(uint32 presentation_token);
...
};
Blocking: -601863 672961
Components: -Internals>MUS
Status: Assigned (was: Started)
Blocking: -672961
Labels: -Pri-2 Pri-3
The presentation API doesn't work on both cash and mus, and ARC++ are not using it right now. It should not block mus+ash.
Fyi, we're moving arc++ over to this protocol asap as it's needed to implement the display timing extension that Android supports.
Blockedon: 776877
Project Member

Comment 11 by bugdroid1@chromium.org, Oct 26 2017

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

commit 5207a6e364274527bae9374d41c9b85d147bc07a
Author: Peng Huang <penghuang@chromium.org>
Date: Thu Oct 26 00:39:30 2017

Support presentation feedback for CompositorFrameSink.

This CL adds presentation_token in a CompositorFrame's meta data.
If the presentation_token is not zero, a presentation feedback will be
provided with time, refresh and flags.

exo uses this API to implement wayland wp_presentation API for measure
frame latency.


Bug:  727775 
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
Change-Id: Ia206fa555d246b65d54dd1d70b4645bdf052375c
Reviewed-on: https://chromium-review.googlesource.com/728705
Commit-Queue: Peng Huang <penghuang@chromium.org>
Reviewed-by: Ted Choc <tedchoc@chromium.org>
Reviewed-by: Ken Buchanan <kenrb@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Fady Samuel <fsamuel@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Reviewed-by: Richard Coles <torne@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: David Reveman <reveman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#511666}
[modify] https://crrev.com/5207a6e364274527bae9374d41c9b85d147bc07a/android_webview/browser/hardware_renderer.cc
[modify] https://crrev.com/5207a6e364274527bae9374d41c9b85d147bc07a/android_webview/browser/hardware_renderer.h
[modify] https://crrev.com/5207a6e364274527bae9374d41c9b85d147bc07a/android_webview/browser/surfaces_instance.cc
[modify] https://crrev.com/5207a6e364274527bae9374d41c9b85d147bc07a/android_webview/browser/surfaces_instance.h
[modify] https://crrev.com/5207a6e364274527bae9374d41c9b85d147bc07a/ash/fast_ink/fast_ink_view.cc
[modify] https://crrev.com/5207a6e364274527bae9374d41c9b85d147bc07a/cc/test/fake_layer_tree_frame_sink_client.h
[modify] https://crrev.com/5207a6e364274527bae9374d41c9b85d147bc07a/cc/trees/layer_tree_frame_sink_client.h
[modify] https://crrev.com/5207a6e364274527bae9374d41c9b85d147bc07a/cc/trees/layer_tree_host_impl.cc
[modify] https://crrev.com/5207a6e364274527bae9374d41c9b85d147bc07a/cc/trees/layer_tree_host_impl.h
[modify] https://crrev.com/5207a6e364274527bae9374d41c9b85d147bc07a/components/exo/layer_tree_frame_sink_holder.cc
[modify] https://crrev.com/5207a6e364274527bae9374d41c9b85d147bc07a/components/exo/layer_tree_frame_sink_holder.h
[modify] https://crrev.com/5207a6e364274527bae9374d41c9b85d147bc07a/components/exo/shell_surface.cc
[modify] https://crrev.com/5207a6e364274527bae9374d41c9b85d147bc07a/components/exo/shell_surface.h
[modify] https://crrev.com/5207a6e364274527bae9374d41c9b85d147bc07a/components/exo/surface.cc
[modify] https://crrev.com/5207a6e364274527bae9374d41c9b85d147bc07a/components/exo/surface.h
[modify] https://crrev.com/5207a6e364274527bae9374d41c9b85d147bc07a/components/exo/surface_tree_host.cc
[modify] https://crrev.com/5207a6e364274527bae9374d41c9b85d147bc07a/components/exo/surface_tree_host.h
[modify] https://crrev.com/5207a6e364274527bae9374d41c9b85d147bc07a/components/exo/wayland/BUILD.gn
[modify] https://crrev.com/5207a6e364274527bae9374d41c9b85d147bc07a/components/exo/wayland/DEPS
[modify] https://crrev.com/5207a6e364274527bae9374d41c9b85d147bc07a/components/exo/wayland/server.cc
[modify] https://crrev.com/5207a6e364274527bae9374d41c9b85d147bc07a/components/viz/client/client_layer_tree_frame_sink.cc
[modify] https://crrev.com/5207a6e364274527bae9374d41c9b85d147bc07a/components/viz/client/client_layer_tree_frame_sink.h
[modify] https://crrev.com/5207a6e364274527bae9374d41c9b85d147bc07a/components/viz/common/quads/compositor_frame_metadata.h
[modify] https://crrev.com/5207a6e364274527bae9374d41c9b85d147bc07a/components/viz/service/display/display.cc
[modify] https://crrev.com/5207a6e364274527bae9374d41c9b85d147bc07a/components/viz/service/display/display.h
[modify] https://crrev.com/5207a6e364274527bae9374d41c9b85d147bc07a/components/viz/service/display/output_surface_client.h
[modify] https://crrev.com/5207a6e364274527bae9374d41c9b85d147bc07a/components/viz/service/display_embedder/display_output_surface.cc
[modify] https://crrev.com/5207a6e364274527bae9374d41c9b85d147bc07a/components/viz/service/frame_sinks/compositor_frame_sink_support.cc
[modify] https://crrev.com/5207a6e364274527bae9374d41c9b85d147bc07a/components/viz/service/frame_sinks/compositor_frame_sink_support.h
[modify] https://crrev.com/5207a6e364274527bae9374d41c9b85d147bc07a/components/viz/service/frame_sinks/direct_layer_tree_frame_sink.cc
[modify] https://crrev.com/5207a6e364274527bae9374d41c9b85d147bc07a/components/viz/service/frame_sinks/direct_layer_tree_frame_sink.h
[modify] https://crrev.com/5207a6e364274527bae9374d41c9b85d147bc07a/components/viz/service/surfaces/surface.cc
[modify] https://crrev.com/5207a6e364274527bae9374d41c9b85d147bc07a/components/viz/service/surfaces/surface.h
[modify] https://crrev.com/5207a6e364274527bae9374d41c9b85d147bc07a/components/viz/test/fake_compositor_frame_sink_client.cc
[modify] https://crrev.com/5207a6e364274527bae9374d41c9b85d147bc07a/components/viz/test/fake_compositor_frame_sink_client.h
[modify] https://crrev.com/5207a6e364274527bae9374d41c9b85d147bc07a/components/viz/test/mock_compositor_frame_sink_client.h
[modify] https://crrev.com/5207a6e364274527bae9374d41c9b85d147bc07a/components/viz/test/test_layer_tree_frame_sink.cc
[modify] https://crrev.com/5207a6e364274527bae9374d41c9b85d147bc07a/components/viz/test/test_layer_tree_frame_sink.h
[modify] https://crrev.com/5207a6e364274527bae9374d41c9b85d147bc07a/content/browser/compositor/gpu_browser_compositor_output_surface.cc
[modify] https://crrev.com/5207a6e364274527bae9374d41c9b85d147bc07a/content/browser/compositor/gpu_browser_compositor_output_surface.h
[modify] https://crrev.com/5207a6e364274527bae9374d41c9b85d147bc07a/content/browser/renderer_host/delegated_frame_host.cc
[modify] https://crrev.com/5207a6e364274527bae9374d41c9b85d147bc07a/content/browser/renderer_host/delegated_frame_host.h
[modify] https://crrev.com/5207a6e364274527bae9374d41c9b85d147bc07a/content/browser/renderer_host/render_widget_host_view_child_frame.cc
[modify] https://crrev.com/5207a6e364274527bae9374d41c9b85d147bc07a/content/browser/renderer_host/render_widget_host_view_child_frame.h
[modify] https://crrev.com/5207a6e364274527bae9374d41c9b85d147bc07a/content/renderer/android/synchronous_layer_tree_frame_sink.cc
[modify] https://crrev.com/5207a6e364274527bae9374d41c9b85d147bc07a/content/renderer/android/synchronous_layer_tree_frame_sink.h
[modify] https://crrev.com/5207a6e364274527bae9374d41c9b85d147bc07a/content/test/fake_renderer_compositor_frame_sink.h
[modify] https://crrev.com/5207a6e364274527bae9374d41c9b85d147bc07a/services/ui/ws/frame_generator.cc
[modify] https://crrev.com/5207a6e364274527bae9374d41c9b85d147bc07a/services/ui/ws/frame_generator.h
[modify] https://crrev.com/5207a6e364274527bae9374d41c9b85d147bc07a/services/viz/public/cpp/compositing/compositor_frame_metadata_struct_traits.cc
[modify] https://crrev.com/5207a6e364274527bae9374d41c9b85d147bc07a/services/viz/public/cpp/compositing/compositor_frame_metadata_struct_traits.h
[modify] https://crrev.com/5207a6e364274527bae9374d41c9b85d147bc07a/services/viz/public/interfaces/compositing/compositor_frame_metadata.mojom
[modify] https://crrev.com/5207a6e364274527bae9374d41c9b85d147bc07a/services/viz/public/interfaces/compositing/compositor_frame_sink.mojom
[modify] https://crrev.com/5207a6e364274527bae9374d41c9b85d147bc07a/third_party/WebKit/Source/platform/graphics/OffscreenCanvasFrameDispatcherImpl.cpp
[modify] https://crrev.com/5207a6e364274527bae9374d41c9b85d147bc07a/third_party/WebKit/Source/platform/graphics/OffscreenCanvasFrameDispatcherImpl.h
[modify] https://crrev.com/5207a6e364274527bae9374d41c9b85d147bc07a/third_party/WebKit/Source/platform/graphics/VideoFrameSubmitter.cpp
[modify] https://crrev.com/5207a6e364274527bae9374d41c9b85d147bc07a/third_party/WebKit/Source/platform/graphics/VideoFrameSubmitter.h
[modify] https://crrev.com/5207a6e364274527bae9374d41c9b85d147bc07a/ui/android/delegated_frame_host_android.cc
[modify] https://crrev.com/5207a6e364274527bae9374d41c9b85d147bc07a/ui/android/delegated_frame_host_android.h
[modify] https://crrev.com/5207a6e364274527bae9374d41c9b85d147bc07a/ui/aura/local/layer_tree_frame_sink_local.cc
[modify] https://crrev.com/5207a6e364274527bae9374d41c9b85d147bc07a/ui/aura/local/layer_tree_frame_sink_local.h

Project Member

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

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

commit 726d5a2414c2f2986e19f5fab6a1262781a8ac94
Author: Peng Huang <penghuang@chromium.org>
Date: Wed Nov 15 19:43:34 2017

viz: always run presented_callback for a compositor frame

In some case, a frame can be replaced by a new frame before reaching the
sreen. We need run presented_callback for those frames.

Bug:  727775 
Change-Id: I5b5bc6614b233b8a1f8517fd662aff91455a6e51
Reviewed-on: https://chromium-review.googlesource.com/762218
Commit-Queue: Peng Huang <penghuang@chromium.org>
Reviewed-by: Fady Samuel <fsamuel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#516790}
[modify] https://crrev.com/726d5a2414c2f2986e19f5fab6a1262781a8ac94/components/viz/service/display/display.cc
[modify] https://crrev.com/726d5a2414c2f2986e19f5fab6a1262781a8ac94/components/viz/service/display/display_unittest.cc
[modify] https://crrev.com/726d5a2414c2f2986e19f5fab6a1262781a8ac94/components/viz/service/surfaces/surface.cc
[modify] https://crrev.com/726d5a2414c2f2986e19f5fab6a1262781a8ac94/components/viz/service/surfaces/surface.h
[modify] https://crrev.com/726d5a2414c2f2986e19f5fab6a1262781a8ac94/components/viz/service/surfaces/surface_unittest.cc

Project Member

Comment 13 by bugdroid1@chromium.org, Dec 1 2017

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

commit f12286c963ae6dbf2abf2fa7497bb6a12b34798a
Author: Peng Huang <penghuang@chromium.org>
Date: Fri Dec 01 02:49:09 2017

Wire up presentation feedback for DirectLayerTreeFrameSink & DelegatedFrameHost

Bug:  727775 
Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel
Change-Id: I9a6f9c87cf7dcaddea526c79880b649d39c47492
Reviewed-on: https://chromium-review.googlesource.com/801455
Reviewed-by: Sadrul Chowdhury <sadrul@chromium.org>
Commit-Queue: Peng Huang <penghuang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#520816}
[modify] https://crrev.com/f12286c963ae6dbf2abf2fa7497bb6a12b34798a/components/viz/service/frame_sinks/direct_layer_tree_frame_sink.cc
[modify] https://crrev.com/f12286c963ae6dbf2abf2fa7497bb6a12b34798a/content/browser/renderer_host/delegated_frame_host.cc

Project Member

Comment 14 by bugdroid1@chromium.org, Jun 7 2018

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

commit fecdf6686aa73e4fc3d1f6335e1ca7ab931654ce
Author: Peng Huang <penghuang@chromium.org>
Date: Thu Jun 07 16:34:58 2018

SkiaOutputSurface: Fix a crash related to presnetation feedback

Bug:  824382 ,  727775 
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel
Change-Id: If75f42895bfc2a41ec3c4cf1bbe0e24b37743c36
Reviewed-on: https://chromium-review.googlesource.com/1089041
Reviewed-by: Sadrul Chowdhury <sadrul@chromium.org>
Commit-Queue: Peng Huang <penghuang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#565292}
[modify] https://crrev.com/fecdf6686aa73e4fc3d1f6335e1ca7ab931654ce/components/viz/service/display_embedder/skia_output_surface_impl_on_gpu.cc

Labels: -Proj-Mustash
I believe we have enough of this working for mash that it isn't an issue. Removing mash for the labels.
Status: Fixed (was: Assigned)

Sign in to add a comment