Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(88)

Issue 2626413002: Route D3D VSync signal to Compositor (Closed)

Created:
3 years, 11 months ago by stanisc
Modified:
3 years, 10 months ago
CC:
cc-bugs_chromium.org, chromium-reviews, danakj+watch_chromium.org, darin-cc_chromium.org, jam, jbauman+watch_chromium.org, kalyank, piman+watch_chromium.org, scheduler-bugs_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Route D3D VSync signal to Compositor This change introduces a new type of BeginFrameSource that listens to accurate VSync signals generated on GPU side and delivered via existing GpuCommandBufferMsg_UpdateVSyncParameters IPC. This provides noticeably less VSync timing variation and ~3x less latency than the existing delay based mechanism. List of included changes: 1) GpuVSyncBeginFrameSource - new type of BFS derives from from ExternalBeginFrameSource and triggers OnBeginFrame promptly when it receives an external signal. GpuVSyncBeginFrameSource also includes a VSync control mechanism to signal whether VSync production need to be started or stopped on GPU side. 2) GpuBrowserCompositorOutputSurface and CommandBufferProxyImpl get a new method to start / stop VSync production on GPU side. 3) GpuProcessTransportFactory decides which type of BeginFrameSource to create based on a combination of type of output surface, OS, OS version and whether or not D3D VSync feature is enabled. 4) Based on previous feedback PerCompositorData now supports either Synthetic BFS or GPU VSync which are mutually exclusive. VSync parameters used by Synthetic BSF and VSync signal used by Gpu VSync BFS are delivered using exactly the same codepath and initiated from the same IPC call. The payload is also the same in both cases - VSync timestamp and interval. 5) On GPU side this feature is activated by instantiating GpuVSyncProviderWin instead of VSyncProviderWin. The new provider is hosted exactly the same way as other providers but it uses a different mechanism to deliver VSync signal. See https://codereview.chromium.org/2681033011 for more details. This feature is disabled by default and might be turned on by --enable-features=D3DVsync switch or by configuring an experiment that enables D3DVsync feature. Please note that this feature is currently disabled on Win7 where the implementation of GpuVSyncProviderWin seems to be grabbing an internal D3D lock while waiting for VSync and that significantly slows down all other D3D calls. I plan to address this in a feature patch. BUG=467617 CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel Review-Url: https://codereview.chromium.org/2626413002 Cr-Commit-Position: refs/heads/master@{#452249} Committed: https://chromium.googlesource.com/chromium/src/+/4950173d4782941bd49f90be89c1d77422e8ca73

Patch Set 1 #

Total comments: 6

Patch Set 2 : Addressed CR feedback #

Total comments: 21

Patch Set 3 : Addressed CR feedback (on GPU side) #

Patch Set 4 : Implement GPU VSync provider as gl::VSyncProvider #

Total comments: 3

Patch Set 5 : Limit GPU VSync to Win8+ #

Total comments: 10

Patch Set 6 : Addressed CR feedback #

Patch Set 7 : Merged with recent BeginFrameSource changes #

Unified diffs Side-by-side diffs Delta from patch set Stats (+216 lines, -29 lines) Patch
M content/browser/BUILD.gn View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download
M content/browser/compositor/gpu_browser_compositor_output_surface.h View 1 2 3 4 5 3 chunks +6 lines, -2 lines 0 comments Download
M content/browser/compositor/gpu_browser_compositor_output_surface.cc View 1 2 3 4 1 chunk +8 lines, -0 lines 0 comments Download
M content/browser/compositor/gpu_process_transport_factory.cc View 1 2 3 4 5 6 11 chunks +62 lines, -25 lines 0 comments Download
A content/browser/compositor/gpu_vsync_begin_frame_source.h View 1 2 3 4 5 6 1 chunk +44 lines, -0 lines 0 comments Download
A content/browser/compositor/gpu_vsync_begin_frame_source.cc View 1 2 3 4 5 6 1 chunk +44 lines, -0 lines 0 comments Download
M gpu/ipc/client/command_buffer_proxy_impl.h View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M gpu/ipc/client/command_buffer_proxy_impl.cc View 1 2 3 4 1 chunk +9 lines, -0 lines 0 comments Download
M gpu/ipc/service/image_transport_surface_win.cc View 1 2 3 4 5 6 2 chunks +20 lines, -2 lines 0 comments Download
M ui/gl/gl_switches.h View 1 2 3 4 5 6 2 chunks +9 lines, -0 lines 0 comments Download
M ui/gl/gl_switches.cc View 1 2 3 4 5 6 1 chunk +10 lines, -0 lines 0 comments Download

Messages

Total messages: 60 (36 generated)
stanisc
sunnyps@chromium.org: Please review changes in begin_frame_source.h and the new BeginFrameSource type jbauman@chromium.org: Please review changes ...
3 years, 11 months ago (2017-01-13 01:43:52 UTC) #7
enne (OOO)
This seems fine in general to me, other than the begin frame source type issues ...
3 years, 11 months ago (2017-01-13 21:14:11 UTC) #12
stanisc
enne@, thank you for the review! I had this new BFS type derived from ExternalBeginFrameSource ...
3 years, 11 months ago (2017-01-14 00:32:20 UTC) #13
stanisc
The followed changes are included: 1) The new BeginFrameSource is now derived from ExternalBeginFrameSource. 2) ...
3 years, 11 months ago (2017-01-24 21:23:25 UTC) #19
enne (OOO)
Thanks. I like this a lot better. https://codereview.chromium.org/2626413002/diff/20001/content/browser/compositor/gpu_browser_compositor_output_surface.cc File content/browser/compositor/gpu_browser_compositor_output_surface.cc (right): https://codereview.chromium.org/2626413002/diff/20001/content/browser/compositor/gpu_browser_compositor_output_surface.cc#newcode47 content/browser/compositor/gpu_browser_compositor_output_surface.cc:47: void GpuBrowserCompositorOutputSurface::SetNeedsVSync(bool ...
3 years, 11 months ago (2017-01-24 21:32:07 UTC) #20
stanisc
https://codereview.chromium.org/2626413002/diff/20001/content/browser/compositor/gpu_browser_compositor_output_surface.cc File content/browser/compositor/gpu_browser_compositor_output_surface.cc (right): https://codereview.chromium.org/2626413002/diff/20001/content/browser/compositor/gpu_browser_compositor_output_surface.cc#newcode47 content/browser/compositor/gpu_browser_compositor_output_surface.cc:47: void GpuBrowserCompositorOutputSurface::SetNeedsVSync(bool needs_vsync) { On 2017/01/24 21:32:07, enne wrote: ...
3 years, 11 months ago (2017-01-24 22:22:40 UTC) #21
jbauman
Thanks, this is looking pretty good. https://codereview.chromium.org/2626413002/diff/20001/gpu/ipc/service/gpu_command_buffer_stub.cc File gpu/ipc/service/gpu_command_buffer_stub.cc (right): https://codereview.chromium.org/2626413002/diff/20001/gpu/ipc/service/gpu_command_buffer_stub.cc#newcode231 gpu/ipc/service/gpu_command_buffer_stub.cc:231: base::FieldTrialList::FindFullName("UseD3DVSync"); Could you ...
3 years, 11 months ago (2017-01-25 00:00:16 UTC) #22
sunnyps
I think there's a lot of confusion on the gpu process side because of two ...
3 years, 11 months ago (2017-01-25 01:36:41 UTC) #23
stanisc
@sunnyps, thank you for your feedback. I have certainly considered implementing this as a true ...
3 years, 11 months ago (2017-01-25 19:09:24 UTC) #24
stanisc
I've addressed some of CR feedback. I am still going to look whether it is ...
3 years, 11 months ago (2017-01-26 02:14:13 UTC) #25
stanisc
See updated issue description and remained issues. https://codereview.chromium.org/2626413002/diff/60001/gpu/ipc/service/gpu_vsync_provider_win.h File gpu/ipc/service/gpu_vsync_provider_win.h (right): https://codereview.chromium.org/2626413002/diff/60001/gpu/ipc/service/gpu_vsync_provider_win.h#newcode31 gpu/ipc/service/gpu_vsync_provider_win.h:31: // TODO: ...
3 years, 10 months ago (2017-02-02 22:01:23 UTC) #28
Fady Samuel
I'd like to better understand how this will work with Mus. Please don't add compositing ...
3 years, 10 months ago (2017-02-14 21:52:30 UTC) #31
stanisc
On 2017/02/14 21:52:30, Fady Samuel wrote: > I'd like to better understand how this will ...
3 years, 10 months ago (2017-02-14 22:29:15 UTC) #32
stanisc
I split off and landed some of the the previously reviewed changes as a part ...
3 years, 10 months ago (2017-02-16 01:39:27 UTC) #34
danakj
c/b/c/ LGTM just a few comments https://codereview.chromium.org/2626413002/diff/80001/content/browser/compositor/gpu_browser_compositor_output_surface.h File content/browser/compositor/gpu_browser_compositor_output_surface.h (right): https://codereview.chromium.org/2626413002/diff/80001/content/browser/compositor/gpu_browser_compositor_output_surface.h#newcode80 content/browser/compositor/gpu_browser_compositor_output_surface.h:80: // GpuVSyncControl Comments ...
3 years, 10 months ago (2017-02-16 15:56:02 UTC) #35
stanisc
Addressed CR feedback from danakj@ https://codereview.chromium.org/2626413002/diff/80001/content/browser/compositor/gpu_browser_compositor_output_surface.h File content/browser/compositor/gpu_browser_compositor_output_surface.h (right): https://codereview.chromium.org/2626413002/diff/80001/content/browser/compositor/gpu_browser_compositor_output_surface.h#newcode80 content/browser/compositor/gpu_browser_compositor_output_surface.h:80: // GpuVSyncControl On 2017/02/16 ...
3 years, 10 months ago (2017-02-16 21:43:19 UTC) #38
stanisc
jbauman@, could you review remaining files under gpu/ipc and ui/gl?
3 years, 10 months ago (2017-02-22 01:34:08 UTC) #42
jbauman
gpu/ and ui/gl lgtm
3 years, 10 months ago (2017-02-22 01:44:08 UTC) #43
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2626413002/120001
3 years, 10 months ago (2017-02-22 21:33:50 UTC) #50
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/370540)
3 years, 10 months ago (2017-02-22 21:43:38 UTC) #52
stanisc
avi@chromium.org: Need OWNER approval for content/browser/BUILD.gn
3 years, 10 months ago (2017-02-22 22:20:45 UTC) #54
Avi (use Gerrit)
build lgtm
3 years, 10 months ago (2017-02-22 22:35:32 UTC) #55
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2626413002/120001
3 years, 10 months ago (2017-02-22 22:45:01 UTC) #57
commit-bot: I haz the power
3 years, 10 months ago (2017-02-22 22:52:45 UTC) #60
Message was sent while issue was closed.
Committed patchset #7 (id:120001) as
https://chromium.googlesource.com/chromium/src/+/4950173d4782941bd49f90be89c1...

Powered by Google App Engine
This is Rietveld 408576698