New issue
Advanced search Search tips

Issue 880911 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Oct 31
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Task

Blocking:
issue 757605



Sign in to add a comment

Enable raster decoder by default for raster worker context.

Project Member Reported by khushals...@chromium.org, Sep 5

Issue description

RasterDecoder is currently being whenever oop is enabled, which means in some cases it also ends up being used with software raster (see issue 879823). This in effect means that we have 2 software raster paths, with GL and raster decoder, being used in production. And the raster one has limited testing on the waterfall since it is triggered only in the few cases where we have to fallback to software raster.

Since the goal eventually is to use raster decoder everywhere, except WebGL, and its feature complete for the compositor worker context use-cases, should we just turn it on by default for this context? Is there any other staging plan?
 
I think turning it on by default is a much better plan than trying to test two paths.  I suspect that WebGL conformance tests handle gles2 decoder pretty thoroughly, and so having the raster decoder by default for raster cases would let us test that with most of our existing tests on bots.
I took a quick look at this. This is easy to do when GPU raster has been blacklisted. But in addition to the blacklist, we also try to create a GrContext client side (https://cs.chromium.org/chromium/src/cc/trees/layer_tree_host_impl.cc?rcl=5954a8c7e1ca96917d1315b39adf9dc53fb358dc&l=2291). If that fails, we fallback to CPU raster.

This is a bit of a chicken-and-the-egg problem. You have to have a GLES2Decoder service side to check if GrContext is supported client side, but you want to make the decoder decision before that.

I can think of two simple ways forward:
- still use GLES2Decoder for CPU raster when GPU raster not blacklisted but we fail to create a GrContext
- punt on this until we OOP-R everywhere instead of GPU raster

Preferences?
Ah, I see.  Maybe we just need to punt on this and just keep shipping OOP-R.
Cc: penghuang@chromium.org
+cc penghuang who would like to use RasterDecoder for browser UI raster (OneCopyRasterProvider) as way of bypassing GL for Vulkan prototyping.

First step would be this bug. Next step would be to modify RasterInterface backed by RasterDecoder to remove GLisms and support Vulkan. Specifically, need to upload to VkImage or SkImage wrapping a VkImage. OCRP currently calls CopyTexSubImage to upload a tile in segments; we may want something less GL like.
Project Member

Comment 5 by bugdroid1@chromium.org, Oct 11

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

commit d77817c513627eb0d7a4f365f8b19a21acd57925
Author: Jonathan Backer <backer@chromium.org>
Date: Thu Oct 11 16:45:06 2018

Use RasterDecoder for CPU raster

This CL uses RasterDecoder for CPU rasterization (one-copy and
zero-copy) on worker background raster threads in two cases:

(1) in renderers whenever GPU raster is blacklisted or cannot create
    GrContext (similar to
    LayerTreeHostImpl::GetGpuRasterizationCapabilities)

(2) in browser whenever GPU raster is not requested

This CL copies some of the logic in LTHI::GetGpuRasterizationCapabilities
to RenderThreadImpl::SharedCompositorWorkerContextProvider.
I copied it so that if we fail GPU rasterization using GLES2Decoder, we
can fallback to CPU raster using a RasterDecoder.

This change should be safe because we have been fuzzing all
RasterDecoder entry points for about 1 quarter.

When testing this CL, I noticed that chrome://gpu was reporting
rasterization status incorrectly with --force-gpu-rasterization flag,
so I fixed that too.

Bug:  880911 
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: I8d93b9d0bfe30e9ee0d5e522be0d9f8155a28726
Reviewed-on: https://chromium-review.googlesource.com/c/1258206
Commit-Queue: Jonathan Backer <backer@chromium.org>
Reviewed-by: Antoine Labour <piman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#598801}
[modify] https://crrev.com/d77817c513627eb0d7a4f365f8b19a21acd57925/content/renderer/render_thread_impl.cc
[modify] https://crrev.com/d77817c513627eb0d7a4f365f8b19a21acd57925/content/renderer/render_thread_impl.h
[modify] https://crrev.com/d77817c513627eb0d7a4f365f8b19a21acd57925/gpu/command_buffer/service/raster_decoder.cc
[modify] https://crrev.com/d77817c513627eb0d7a4f365f8b19a21acd57925/gpu/ipc/client/raster_in_process_context_tests.cc
[modify] https://crrev.com/d77817c513627eb0d7a4f365f8b19a21acd57925/gpu/ipc/in_process_command_buffer.cc
[modify] https://crrev.com/d77817c513627eb0d7a4f365f8b19a21acd57925/gpu/ipc/raster_in_process_context.cc
[modify] https://crrev.com/d77817c513627eb0d7a4f365f8b19a21acd57925/gpu/ipc/raster_in_process_context.h
[modify] https://crrev.com/d77817c513627eb0d7a4f365f8b19a21acd57925/gpu/ipc/service/gpu_channel.cc
[modify] https://crrev.com/d77817c513627eb0d7a4f365f8b19a21acd57925/services/ws/public/cpp/gpu/context_provider_command_buffer.cc

RasterDecoder is disabled when passthrough is enabled because RasterDecoder does not yet support passthrough.
Could we land #5 after M71 branches instead (scheduled to branch today)?
Project Member

Comment 8 by bugdroid1@chromium.org, Oct 11

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

commit 1bd8fc3c4f8f4a2c2ca71dadc2a82d0b9fb50f0d
Author: Jonathan Backer <backer@chromium.org>
Date: Thu Oct 11 17:28:05 2018

Revert "Use RasterDecoder for CPU raster"

This reverts commit d77817c513627eb0d7a4f365f8b19a21acd57925.

Reason for revert: Land change after M71 branch point to mitigate risk.

Original change's description:
> Use RasterDecoder for CPU raster
> 
> This CL uses RasterDecoder for CPU rasterization (one-copy and
> zero-copy) on worker background raster threads in two cases:
> 
> (1) in renderers whenever GPU raster is blacklisted or cannot create
>     GrContext (similar to
>     LayerTreeHostImpl::GetGpuRasterizationCapabilities)
> 
> (2) in browser whenever GPU raster is not requested
> 
> This CL copies some of the logic in LTHI::GetGpuRasterizationCapabilities
> to RenderThreadImpl::SharedCompositorWorkerContextProvider.
> I copied it so that if we fail GPU rasterization using GLES2Decoder, we
> can fallback to CPU raster using a RasterDecoder.
> 
> This change should be safe because we have been fuzzing all
> RasterDecoder entry points for about 1 quarter.
> 
> When testing this CL, I noticed that chrome://gpu was reporting
> rasterization status incorrectly with --force-gpu-rasterization flag,
> so I fixed that too.
> 
> Bug:  880911 
> Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
> Change-Id: I8d93b9d0bfe30e9ee0d5e522be0d9f8155a28726
> Reviewed-on: https://chromium-review.googlesource.com/c/1258206
> Commit-Queue: Jonathan Backer <backer@chromium.org>
> Reviewed-by: Antoine Labour <piman@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#598801}

TBR=backer@chromium.org,piman@chromium.org

Change-Id: Icd39538a7c98d9d9bb5fff13ddfda12dd46fa05a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug:  880911 
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Reviewed-on: https://chromium-review.googlesource.com/c/1277267
Reviewed-by: Jonathan Backer <backer@chromium.org>
Commit-Queue: Jonathan Backer <backer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#598818}
[modify] https://crrev.com/1bd8fc3c4f8f4a2c2ca71dadc2a82d0b9fb50f0d/content/renderer/render_thread_impl.cc
[modify] https://crrev.com/1bd8fc3c4f8f4a2c2ca71dadc2a82d0b9fb50f0d/content/renderer/render_thread_impl.h
[modify] https://crrev.com/1bd8fc3c4f8f4a2c2ca71dadc2a82d0b9fb50f0d/gpu/command_buffer/service/raster_decoder.cc
[modify] https://crrev.com/1bd8fc3c4f8f4a2c2ca71dadc2a82d0b9fb50f0d/gpu/ipc/client/raster_in_process_context_tests.cc
[modify] https://crrev.com/1bd8fc3c4f8f4a2c2ca71dadc2a82d0b9fb50f0d/gpu/ipc/in_process_command_buffer.cc
[modify] https://crrev.com/1bd8fc3c4f8f4a2c2ca71dadc2a82d0b9fb50f0d/gpu/ipc/raster_in_process_context.cc
[modify] https://crrev.com/1bd8fc3c4f8f4a2c2ca71dadc2a82d0b9fb50f0d/gpu/ipc/raster_in_process_context.h
[modify] https://crrev.com/1bd8fc3c4f8f4a2c2ca71dadc2a82d0b9fb50f0d/gpu/ipc/service/gpu_channel.cc
[modify] https://crrev.com/1bd8fc3c4f8f4a2c2ca71dadc2a82d0b9fb50f0d/services/ws/public/cpp/gpu/context_provider_command_buffer.cc

Project Member

Comment 9 by bugdroid1@chromium.org, Oct 15

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

commit 8e4f35d1fe31c1b0b8f0123a10d498f0139b9097
Author: Jonathan Backer <backer@chromium.org>
Date: Mon Oct 15 20:56:42 2018

Use RasterDecoder for CPU raster

Reland of https://crrev.com/c/1258206. Revert of that CL was to defer
until after M71 branchpoint to avoid unnecessary risk. Zero code change
in this reland.

This CL uses RasterDecoder for CPU rasterization (one-copy and
zero-copy) on worker background raster threads in two cases:

(1) in renderers whenever GPU raster is blacklisted or cannot create
    GrContext (similar to
    LayerTreeHostImpl::GetGpuRasterizationCapabilities)

(2) in browser whenever GPU raster is not requested

This CL copies some of the logic in LTHI::GetGpuRasterizationCapabilities
to RenderThreadImpl::SharedCompositorWorkerContextProvider.
I copied it so that if we fail GPU rasterization using GLES2Decoder, we
can fallback to CPU raster using a RasterDecoder.

TBR=piman

Bug:  880911 
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: I097ede2266c9ddc4c6f6c777b34419399eb21bf8
Reviewed-on: https://chromium-review.googlesource.com/c/1281084
Commit-Queue: Jonathan Backer <backer@chromium.org>
Reviewed-by: Jonathan Backer <backer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#599744}
[modify] https://crrev.com/8e4f35d1fe31c1b0b8f0123a10d498f0139b9097/content/renderer/render_thread_impl.cc
[modify] https://crrev.com/8e4f35d1fe31c1b0b8f0123a10d498f0139b9097/content/renderer/render_thread_impl.h
[modify] https://crrev.com/8e4f35d1fe31c1b0b8f0123a10d498f0139b9097/gpu/command_buffer/service/raster_decoder.cc
[modify] https://crrev.com/8e4f35d1fe31c1b0b8f0123a10d498f0139b9097/gpu/ipc/client/raster_in_process_context_tests.cc
[modify] https://crrev.com/8e4f35d1fe31c1b0b8f0123a10d498f0139b9097/gpu/ipc/in_process_command_buffer.cc
[modify] https://crrev.com/8e4f35d1fe31c1b0b8f0123a10d498f0139b9097/gpu/ipc/raster_in_process_context.cc
[modify] https://crrev.com/8e4f35d1fe31c1b0b8f0123a10d498f0139b9097/gpu/ipc/raster_in_process_context.h
[modify] https://crrev.com/8e4f35d1fe31c1b0b8f0123a10d498f0139b9097/gpu/ipc/service/gpu_channel.cc
[modify] https://crrev.com/8e4f35d1fe31c1b0b8f0123a10d498f0139b9097/services/ws/public/cpp/gpu/context_provider_command_buffer.cc

Blocking: 757605
Labels: vulkanize
Labels: -vulkanize Proj-Vulkanize
Status: Fixed (was: Assigned)
I'm going to call this done. It doesn't work for passthrough, but I've got a separate bug to making RasterDecoder work with passthrough (https://crbug.com/829435).

Sign in to add a comment