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

Issue 654631 link

Starred by 7 users

Issue metadata

Status: Fixed
Owner:
not on Chrome anymore
Closed: May 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 3
Type: Bug

Blocking:
issue 678800


Show other hotlists

Hotlists containing this issue:
Hotlist-1


Sign in to add a comment

Use overlays to display video on Windows.

Project Member Reported by jbau...@chromium.org, Oct 11 2016

Issue description

It looks like with Windows 10 RS1 DWM is willing to assign overlay planes to Chrome. That means that on Canary the entire Chrome window will often be assigned an overlay, which helps to reduce power consumption. One complication is that the swap chain needs to have DXGI_ALPHA_MODE_PREMULTIPLIED, or else an overlay won't be assigned and power will be worse.

If possible, it would be nice to make the YUV video its own separate layer, so if only that's changing then the background won't need to be drawn. Also, if a smaller video is played on a larger monitor then scaling only happens on scanout, which would reduce power.

The main way to do this is to create a video swapchain using either CreateDecodeSwapChainForCompositionSurfaceHandle or CreateSwapChainForCompositionSurfaceHandle and position it using DirectComposition. One difficulty is that the only video format that's supported for overlays on my Kaby Lake system seems to be YUY2, and CreateDecodeSwapChainForCompositionSurfaceHandle fails unless it's given a YUY2 texture. However, the video decoder itself only can output NV12 so we'd need to process that into YUY2 before displaying that on the screen, which would hurt power consumption.

It also possible that we could hurt power consumption in fullscreen mode with large video, as the display would be forced to read from two textures. One would be YUY2 and not RGBA, but the extra NV12->YUY2 conversion would be expensive.




 
Is the YUV2 restriction because of the driver or DWM?
It's unclear. It doesn't look to me like the WDDM API allows the driver to specify which YUV formats it supports as overlays. 
Based on https://01.org/sites/default/files/documentation/intel-gfx-prm-osrc-skl-vol12-display.pdf it looks like skylake at least doesn't support YUV 4:2:0 scanout.
Cc: crouleau@chromium.org
http://www.anandtech.com/show/9562/intels-skylake-gpu-analyzing-the-media-capabilities claims skylake does support NV12, so who knows. But in practice it doesn't seem to support it.

I'm currently looking into the reason that DXGI_ALPHA_MODE_UNSPECIFIED causes the window not to be assigned to an overlay. It looks like I can make it be assigned if the first presents present the entire surface, rather than just a sub-rectangle. So we're probably hitting some weird heuristic.
Yeah, looks like they have two overlay modes.

a) Something similar to our OverlayStrategySingleOnTop, where they can put a transparent swapchain on top of the rest of the contents. This seems to be very easily triggered.
b) Something similar to our OverlayStrategyUnderlay, where they put an opaque swapchain underneath everything else. This is much harder to trigger. It seems like there needs to be a consistent pattern of full-swapchain updates - even missing 1 row of bottom pixels prevents it from happening. However once it's triggered updates can become much smaller and the overlay will continue to be allocated until the swapchain goes idle for a while.
Blocking: 678800
Project Member

Comment 8 by bugdroid1@chromium.org, Apr 20 2017

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

commit 9f7f53b565d1e42633ab47cc7d8f6fe692c4abf6
Author: jbauman <jbauman@chromium.org>
Date: Thu Apr 20 19:42:56 2017

Reset() instead of Receive() video_processor_enumerator_

BUG= 654631 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel

Review-Url: https://codereview.chromium.org/2831023002
Cr-Commit-Position: refs/heads/master@{#466093}

[modify] https://crrev.com/9f7f53b565d1e42633ab47cc7d8f6fe692c4abf6/gpu/ipc/service/direct_composition_surface_win.cc

Labels: Merge-Request-59
Want to merge r464842 and r466093 to M59.
Project Member

Comment 10 by sheriffbot@chromium.org, Apr 25 2017

Labels: -Merge-Request-59 Hotlist-Merge-Approved Merge-Approved-59
Your change meets the bar and is auto-approved for M59. Please go ahead and merge the CL to branch 3071 manually. Please contact milestone owner if you have questions.
Owners: amineer@(Android), cmasso@(iOS), gkihumba@(ChromeOS), Abdul Syed@(Desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Project Member

Comment 11 by bugdroid1@chromium.org, Apr 25 2017

Labels: -merge-approved-59 merge-merged-3071
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/8c7c9ee0fa4ca205dbb210d54774ef40746d0fd5

commit 8c7c9ee0fa4ca205dbb210d54774ef40746d0fd5
Author: John Bauman <jbauman@chromium.org>
Date: Tue Apr 25 20:25:18 2017

Report swap chain format histogram on every swap.

It's more useful to know what fraction of presents are using BGRA vs.
YUY2, rather than what fraction of swapchains, since some swapchains
could be doing very few presents and wouldn't matter for performance.

CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel

Review-Url: https://codereview.chromium.org/2819933003
Cr-Commit-Position: refs/heads/master@{#464842}
(cherry picked from commit 6e8419d3411ff8f7629e9bf200ecdd8310f03ad9)

BUG= 654631 

Review-Url: https://codereview.chromium.org/2838013004 .
Cr-Commit-Position: refs/branch-heads/3071@{#203}
Cr-Branched-From: a106f0abbf69dad349d4aaf4bcc4f5d376dd2377-refs/heads/master@{#464641}

[modify] https://crrev.com/8c7c9ee0fa4ca205dbb210d54774ef40746d0fd5/gpu/ipc/service/direct_composition_surface_win.cc

Project Member

Comment 12 by bugdroid1@chromium.org, Apr 25 2017

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

commit cd81163b1811d467baf68d0316cb163d22e320c1
Author: John Bauman <jbauman@chromium.org>
Date: Tue Apr 25 20:28:09 2017

Reset() instead of Receive() video_processor_enumerator_

BUG= 654631 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel

Review-Url: https://codereview.chromium.org/2831023002
Cr-Commit-Position: refs/heads/master@{#466093}
(cherry picked from commit 9f7f53b565d1e42633ab47cc7d8f6fe692c4abf6)

Review-Url: https://codereview.chromium.org/2838103003 .
Cr-Commit-Position: refs/branch-heads/3071@{#204}
Cr-Branched-From: a106f0abbf69dad349d4aaf4bcc4f5d376dd2377-refs/heads/master@{#464641}

[modify] https://crrev.com/cd81163b1811d467baf68d0316cb163d22e320c1/gpu/ipc/service/direct_composition_surface_win.cc

Status: Fixed (was: Assigned)
Working now for software and hardware decoding.
Project Member

Comment 14 by bugdroid1@chromium.org, May 19 2017

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

commit 7b6d8a3148e1279efa7fac40870557a5ca77d7dc
Author: jbauman <jbauman@chromium.org>
Date: Fri May 19 22:51:15 2017

Wait for GPU to finish before committing first video overlay frame.

The current code to do CopyResource helps in some cases, but with 4k
videos it still may flicker black before the first frame. Waiting for
the GPU commands to execute before the commit seems to help.

BUG= 654631 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel

Review-Url: https://codereview.chromium.org/2892123002
Cr-Commit-Position: refs/heads/master@{#473373}

[modify] https://crrev.com/7b6d8a3148e1279efa7fac40870557a5ca77d7dc/gpu/ipc/service/direct_composition_surface_win.cc

Project Member

Comment 15 by bugdroid1@chromium.org, May 19 2017

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

commit 027183a19bdc7fc48d75dd046e9c8ab8be1700d5
Author: jbauman <jbauman@chromium.org>
Date: Fri May 19 23:12:20 2017

Update scaling of video layers on every swap.

The scale factor can change even if the image itself doesn't change,
so the variables need to be updated before that early-out.

BUG= 654631 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel

Review-Url: https://codereview.chromium.org/2888783002
Cr-Commit-Position: refs/heads/master@{#473380}

[modify] https://crrev.com/027183a19bdc7fc48d75dd046e9c8ab8be1700d5/gpu/ipc/service/direct_composition_surface_win.cc
[modify] https://crrev.com/027183a19bdc7fc48d75dd046e9c8ab8be1700d5/gpu/ipc/service/direct_composition_surface_win_unittest.cc

Labels: -Hotlist-Merge-Approved -merge-merged-3071 Merge-Request-59
Also like to merge r473373 and r473880.
Project Member

Comment 17 by sheriffbot@chromium.org, May 22 2017

Labels: -Merge-Request-59 Hotlist-Merge-Approved Merge-Approved-59
Your change meets the bar and is auto-approved for M59. Please go ahead and merge the CL to branch 3071 manually. Please contact milestone owner if you have questions.
Owners: amineer@(Android), cmasso@(iOS), gkihumba@(ChromeOS), Abdul Syed@(Desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Project Member

Comment 18 by bugdroid1@chromium.org, May 22 2017

Labels: -merge-approved-59 merge-merged-3071
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/2624ec4524a408dafb8d13bb29a777f3bd03bd3d

commit 2624ec4524a408dafb8d13bb29a777f3bd03bd3d
Author: John Bauman <jbauman@chromium.org>
Date: Mon May 22 22:23:21 2017

Wait for GPU to finish before committing first video overlay frame.

The current code to do CopyResource helps in some cases, but with 4k
videos it still may flicker black before the first frame. Waiting for
the GPU commands to execute before the commit seems to help.

BUG= 654631 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel

Review-Url: https://codereview.chromium.org/2892123002
Cr-Original-Commit-Position: refs/heads/master@{#473373}
Review-Url: https://codereview.chromium.org/2896723004 .
Cr-Commit-Position: refs/branch-heads/3071@{#662}
Cr-Branched-From: a106f0abbf69dad349d4aaf4bcc4f5d376dd2377-refs/heads/master@{#464641}

[modify] https://crrev.com/2624ec4524a408dafb8d13bb29a777f3bd03bd3d/gpu/ipc/service/direct_composition_surface_win.cc

Project Member

Comment 19 by bugdroid1@chromium.org, May 22 2017

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

commit 454af80c0bde0e78ad0e7f4bd89bd966d1a1189e
Author: John Bauman <jbauman@chromium.org>
Date: Mon May 22 22:27:53 2017

Update scaling of video layers on every swap.

The scale factor can change even if the image itself doesn't change,
so the variables need to be updated before that early-out.

BUG= 654631 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel

Review-Url: https://codereview.chromium.org/2888783002
Cr-Original-Commit-Position: refs/heads/master@{#473380}
Review-Url: https://codereview.chromium.org/2900893002 .
Cr-Commit-Position: refs/branch-heads/3071@{#663}
Cr-Branched-From: a106f0abbf69dad349d4aaf4bcc4f5d376dd2377-refs/heads/master@{#464641}

[modify] https://crrev.com/454af80c0bde0e78ad0e7f4bd89bd966d1a1189e/gpu/ipc/service/direct_composition_surface_win.cc
[modify] https://crrev.com/454af80c0bde0e78ad0e7f4bd89bd966d1a1189e/gpu/ipc/service/direct_composition_surface_win_unittest.cc

Project Member

Comment 20 by bugdroid1@chromium.org, Jul 29 2017

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

commit 91f2d574f15aaa6032882a4376ddb90c3be7f953
Author: John Bauman <jbauman@chromium.org>
Date: Sat Jul 29 00:24:14 2017

Add glSetScanoutForColorSpaceCHROMIUM GL command.

This takes in a pointer to a gfx::ColorSpace, and determines what
colorspace is used when displaying the image as an overlay with
DirectComposition.

Bug:  654631 
Change-Id: I42f7f3721ebdb337d343071c3c6e860422486030

CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel

Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: I42f7f3721ebdb337d343071c3c6e860422486030
Reviewed-on: https://chromium-review.googlesource.com/567580
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Reviewed-by: Fredrik Hubinette <hubbe@chromium.org>
Commit-Queue: John Bauman <jbauman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#490555}
[modify] https://crrev.com/91f2d574f15aaa6032882a4376ddb90c3be7f953/cc/output/dc_layer_overlay.cc
[modify] https://crrev.com/91f2d574f15aaa6032882a4376ddb90c3be7f953/cc/output/dc_layer_overlay.h
[modify] https://crrev.com/91f2d574f15aaa6032882a4376ddb90c3be7f953/cc/output/gl_renderer.cc
[modify] https://crrev.com/91f2d574f15aaa6032882a4376ddb90c3be7f953/cc/output/gl_renderer_unittest.cc
[modify] https://crrev.com/91f2d574f15aaa6032882a4376ddb90c3be7f953/gpu/GLES2/gl2chromium_autogen.h
[modify] https://crrev.com/91f2d574f15aaa6032882a4376ddb90c3be7f953/gpu/command_buffer/build_gles2_cmd_buffer.py
[modify] https://crrev.com/91f2d574f15aaa6032882a4376ddb90c3be7f953/gpu/command_buffer/client/BUILD.gn
[modify] https://crrev.com/91f2d574f15aaa6032882a4376ddb90c3be7f953/gpu/command_buffer/client/gles2_c_lib_autogen.h
[modify] https://crrev.com/91f2d574f15aaa6032882a4376ddb90c3be7f953/gpu/command_buffer/client/gles2_cmd_helper_autogen.h
[modify] https://crrev.com/91f2d574f15aaa6032882a4376ddb90c3be7f953/gpu/command_buffer/client/gles2_implementation.cc
[modify] https://crrev.com/91f2d574f15aaa6032882a4376ddb90c3be7f953/gpu/command_buffer/client/gles2_implementation_autogen.h
[modify] https://crrev.com/91f2d574f15aaa6032882a4376ddb90c3be7f953/gpu/command_buffer/client/gles2_interface.h
[modify] https://crrev.com/91f2d574f15aaa6032882a4376ddb90c3be7f953/gpu/command_buffer/client/gles2_interface_autogen.h
[modify] https://crrev.com/91f2d574f15aaa6032882a4376ddb90c3be7f953/gpu/command_buffer/client/gles2_interface_stub_autogen.h
[modify] https://crrev.com/91f2d574f15aaa6032882a4376ddb90c3be7f953/gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h
[modify] https://crrev.com/91f2d574f15aaa6032882a4376ddb90c3be7f953/gpu/command_buffer/client/gles2_trace_implementation_autogen.h
[modify] https://crrev.com/91f2d574f15aaa6032882a4376ddb90c3be7f953/gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h
[modify] https://crrev.com/91f2d574f15aaa6032882a4376ddb90c3be7f953/gpu/command_buffer/cmd_buffer_functions.txt
[modify] https://crrev.com/91f2d574f15aaa6032882a4376ddb90c3be7f953/gpu/command_buffer/common/gles2_cmd_format_autogen.h
[modify] https://crrev.com/91f2d574f15aaa6032882a4376ddb90c3be7f953/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h
[modify] https://crrev.com/91f2d574f15aaa6032882a4376ddb90c3be7f953/gpu/command_buffer/common/gles2_cmd_ids_autogen.h
[modify] https://crrev.com/91f2d574f15aaa6032882a4376ddb90c3be7f953/gpu/command_buffer/service/BUILD.gn
[modify] https://crrev.com/91f2d574f15aaa6032882a4376ddb90c3be7f953/gpu/command_buffer/service/gles2_cmd_decoder.cc
[modify] https://crrev.com/91f2d574f15aaa6032882a4376ddb90c3be7f953/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_handlers.cc
[modify] https://crrev.com/91f2d574f15aaa6032882a4376ddb90c3be7f953/gpu/ipc/service/direct_composition_surface_win.cc
[modify] https://crrev.com/91f2d574f15aaa6032882a4376ddb90c3be7f953/gpu/ipc/service/direct_composition_surface_win_unittest.cc
[modify] https://crrev.com/91f2d574f15aaa6032882a4376ddb90c3be7f953/ui/gl/gl_image.h

Project Member

Comment 21 by bugdroid1@chromium.org, Aug 5

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

commit dba5d7b0a7e5d683e98eaec38bd0acf468f62214
Author: Christopher Cameron <ccameron@chromium.org>
Date: Sun Aug 05 21:18:24 2018

Don't log unallocated GpuMemoryBuffers in ZeroCopyRasterBufferProvider

Many blink layout tests take this path, resulting in lots of console
spam.

TBR=sunnyps

Bug:  871031 ,  654631 
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I683c42de3c9d956c3ea97f18027e4e1fbe3e5e8e
Reviewed-on: https://chromium-review.googlesource.com/1163179
Reviewed-by: ccameron <ccameron@chromium.org>
Commit-Queue: ccameron <ccameron@chromium.org>
Cr-Commit-Position: refs/heads/master@{#580783}
[modify] https://crrev.com/dba5d7b0a7e5d683e98eaec38bd0acf468f62214/cc/raster/zero_copy_raster_buffer_provider.cc

Sign in to add a comment