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

Issue 1951193002: cc: Add mailbox support to ResourceProvider write locks. (Closed)

Created:
4 years, 7 months ago by sunnyps
Modified:
4 years, 6 months ago
Reviewers:
piman, reveman, vmpstr, vmiura, ericrk
CC:
chromium-reviews, cc-bugs_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@worker_context_stream
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

cc: Add mailbox support to ResourceProvider write locks. This adds support for mailboxes to ScopedWriteLockGL. Using the mailbox requires using ScopedTextureProvider/ScopedSkSurfaceProvider which ensures that the texture id for the mailbox is destroyed after use on the worker context. This CL also includes the following cleanup: 1. ResourceProvider locks don't keep resource pointers around. 2. ScopedSamplerGL does not inherit from ScopedReadLockGL. 3. GpuRasterizer is folded back into GpuRasterBufferProvider. 4. TileTaskManager does not own RasterBufferProvider. BUG=525259 R=piman@chromium.org CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Committed: https://crrev.com/5fa5dbdf25bbec21b84f752d3f0642cd184467e2 Committed: https://crrev.com/3b0f0b8d3db0a9f66864d5b7da87c82f49e74a29 Cr-Original-Commit-Position: refs/heads/master@{#398204} Cr-Commit-Position: refs/heads/master@{#399983}

Patch Set 1 #

Patch Set 2 : add mailbox mode to write locks #

Patch Set 3 : fix gpu #

Total comments: 10

Patch Set 4 : #

Patch Set 5 : rebase #

Patch Set 6 : compile error fix #

Total comments: 2

Patch Set 7 : sync token indirection #

Patch Set 8 : rebase #

Patch Set 9 : rebase #

Patch Set 10 : keep track of pending raster buffers #

Patch Set 11 : rebase #

Total comments: 2

Patch Set 12 : address piman's review #

Patch Set 13 : strict sync token check #

Total comments: 4

Patch Set 14 : rebase #

Patch Set 15 : #

Patch Set 16 : invalid mailbox fixes #

Patch Set 17 : piman's review #

Patch Set 18 : #

Total comments: 8

Patch Set 19 : piman's review 2 #

Patch Set 20 : rebase #

Patch Set 21 : more SetSynchronized #

Patch Set 22 : cleanup tasks if ordering barrier fails #

Total comments: 4

Patch Set 23 : ericrk's review #

Total comments: 3

Patch Set 24 : vmpstr's review #

Unified diffs Side-by-side diffs Delta from patch set Stats (+809 lines, -699 lines) Patch
M cc/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +0 lines, -2 lines 0 comments Download
M cc/cc.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +0 lines, -2 lines 0 comments Download
M cc/output/gl_renderer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 8 chunks +11 lines, -11 lines 0 comments Download
M cc/raster/bitmap_raster_buffer_provider.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -1 line 0 comments Download
M cc/raster/bitmap_raster_buffer_provider.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +2 lines, -1 line 0 comments Download
M cc/raster/gpu_raster_buffer_provider.h View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +55 lines, -5 lines 0 comments Download
M cc/raster/gpu_raster_buffer_provider.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 4 chunks +159 lines, -69 lines 0 comments Download
D cc/raster/gpu_rasterizer.h View 1 2 3 4 1 chunk +0 lines, -57 lines 0 comments Download
D cc/raster/gpu_rasterizer.cc View 1 2 3 4 1 chunk +0 lines, -87 lines 0 comments Download
M cc/raster/one_copy_raster_buffer_provider.h View 1 2 3 4 5 6 7 8 9 10 11 12 7 chunks +45 lines, -5 lines 0 comments Download
M cc/raster/one_copy_raster_buffer_provider.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 8 chunks +156 lines, -135 lines 0 comments Download
M cc/raster/raster_buffer_provider.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +3 lines, -2 lines 0 comments Download
M cc/raster/raster_buffer_provider_perftest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 10 chunks +30 lines, -17 lines 0 comments Download
M cc/raster/raster_buffer_provider_unittest.cc View 1 2 3 4 5 6 7 8 9 7 chunks +16 lines, -17 lines 0 comments Download
M cc/raster/zero_copy_raster_buffer_provider.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -1 line 0 comments Download
M cc/raster/zero_copy_raster_buffer_provider.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +2 lines, -1 line 0 comments Download
M cc/resources/resource_provider.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 6 chunks +77 lines, -54 lines 0 comments Download
M cc/resources/resource_provider.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 15 chunks +168 lines, -139 lines 0 comments Download
M cc/resources/resource_provider_unittest.cc View 1 2 3 4 5 6 7 8 9 10 3 chunks +4 lines, -4 lines 0 comments Download
M cc/resources/video_resource_updater.cc View 1 2 3 4 5 6 7 8 9 10 3 chunks +4 lines, -5 lines 0 comments Download
M cc/test/fake_raster_buffer_provider.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -1 line 0 comments Download
M cc/test/fake_raster_buffer_provider.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +3 lines, -1 line 0 comments Download
M cc/test/fake_tile_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +5 lines, -0 lines 0 comments Download
M cc/test/fake_tile_task_manager.h View 1 2 3 4 5 6 7 8 9 1 chunk +0 lines, -5 lines 0 comments Download
M cc/test/fake_tile_task_manager.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +1 line, -11 lines 0 comments Download
M cc/test/layer_tree_pixel_resource_test.cc View 1 2 3 4 3 chunks +3 lines, -4 lines 0 comments Download
M cc/tiles/tile_manager.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 4 chunks +6 lines, -2 lines 0 comments Download
M cc/tiles/tile_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 9 chunks +36 lines, -14 lines 0 comments Download
M cc/tiles/tile_manager_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 2 chunks +7 lines, -12 lines 0 comments Download
M cc/tiles/tile_task_manager.h View 1 2 3 4 5 6 7 8 9 2 chunks +1 line, -9 lines 0 comments Download
M cc/tiles/tile_task_manager.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +4 lines, -16 lines 0 comments Download
M cc/trees/layer_tree_host_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -0 lines 0 comments Download
M cc/trees/layer_tree_host_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 5 chunks +6 lines, -8 lines 0 comments Download
M cc/trees/layer_tree_host_unittest_context.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 72 (25 generated)
sunnyps
This is a follow-up to https://codereview.chromium.org/1949023005/ which just adds the flag for async worker context. ...
4 years, 7 months ago (2016-05-06 01:12:25 UTC) #3
piman
https://codereview.chromium.org/1951193002/diff/40001/cc/resources/resource_provider.cc File cc/resources/resource_provider.cc (right): https://codereview.chromium.org/1951193002/diff/40001/cc/resources/resource_provider.cc#newcode1021 cc/resources/resource_provider.cc:1021: ->ContextGL(); This path is taken in ResourceProvider::CopyToResource, which is ...
4 years, 7 months ago (2016-05-06 01:55:30 UTC) #4
sunnyps
PTAL As discussed previously accessing Resource pointers into ResourceProvider's map from the worker threads is ...
4 years, 7 months ago (2016-05-25 02:18:43 UTC) #5
piman
https://codereview.chromium.org/1951193002/diff/100001/cc/raster/gpu_raster_buffer_provider.cc File cc/raster/gpu_raster_buffer_provider.cc (right): https://codereview.chromium.org/1951193002/diff/100001/cc/raster/gpu_raster_buffer_provider.cc#newcode184 cc/raster/gpu_raster_buffer_provider.cc:184: DCHECK(sync_token_.HasData()); If I understand correctly, OrderingBarrier() is called on ...
4 years, 7 months ago (2016-05-26 00:01:10 UTC) #8
sunnyps
PTAL https://codereview.chromium.org/1951193002/diff/100001/cc/raster/gpu_raster_buffer_provider.cc File cc/raster/gpu_raster_buffer_provider.cc (right): https://codereview.chromium.org/1951193002/diff/100001/cc/raster/gpu_raster_buffer_provider.cc#newcode184 cc/raster/gpu_raster_buffer_provider.cc:184: DCHECK(sync_token_.HasData()); On 2016/05/26 00:01:10, piman wrote: > If ...
4 years, 7 months ago (2016-05-26 01:39:27 UTC) #9
piman
lgtm
4 years, 7 months ago (2016-05-26 01:46:25 UTC) #10
sunnyps
On 2016/05/26 01:46:25, piman wrote: > lgtm Looks like it should be possible to move ...
4 years, 7 months ago (2016-05-26 02:15:36 UTC) #11
piman
On Wed, May 25, 2016 at 7:15 PM, <sunnyps@chromium.org> wrote: > On 2016/05/26 01:46:25, piman ...
4 years, 7 months ago (2016-05-26 03:37:26 UTC) #12
sunnyps
On 2016/05/26 03:37:26, piman wrote: > On Wed, May 25, 2016 at 7:15 PM, <mailto:sunnyps@chromium.org> ...
4 years, 7 months ago (2016-05-26 17:12:20 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1951193002/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1951193002/120001
4 years, 7 months ago (2016-05-26 17:13:01 UTC) #15
commit-bot: I haz the power
Failed to apply patch for cc/tiles/tile_task_manager.cc: While running git apply --index -3 -p1; error: patch ...
4 years, 7 months ago (2016-05-26 17:44:43 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1951193002/140001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1951193002/140001
4 years, 7 months ago (2016-05-26 21:18:21 UTC) #20
commit-bot: I haz the power
Try jobs failed on following builders: android_compile_dbg on tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_compile_dbg/builds/72691) ios-device-gn on tryserver.chromium.mac (JOB_FAILED, ...
4 years, 7 months ago (2016-05-26 21:22:29 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1951193002/160001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1951193002/160001
4 years, 6 months ago (2016-05-26 21:53:32 UTC) #25
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_chromeos_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_rel_ng/builds/219233)
4 years, 6 months ago (2016-05-26 22:19:55 UTC) #27
sunnyps
So a lot changed while this CL was in review. Now we don't do the ...
4 years, 6 months ago (2016-06-04 02:44:06 UTC) #28
sunnyps
PTAL I had to change quite a bit from the previous version: 1. Instead of ...
4 years, 6 months ago (2016-06-06 22:21:49 UTC) #30
piman
https://codereview.chromium.org/1951193002/diff/200001/cc/raster/raster_buffer.h File cc/raster/raster_buffer.h (right): https://codereview.chromium.org/1951193002/diff/200001/cc/raster/raster_buffer.h#newcode30 cc/raster/raster_buffer.h:30: virtual void SetSyncToken(const gpu::SyncToken& sync_token) = 0; Does this ...
4 years, 6 months ago (2016-06-06 23:22:45 UTC) #31
sunnyps
Needed to make sure that pending_raster_buffers_ doesn't have dangling pointers - made the RasterBufferImpl ctor/dtor ...
4 years, 6 months ago (2016-06-07 01:11:31 UTC) #32
piman
LGTM, yeah I like this better re: dangling pointers.
4 years, 6 months ago (2016-06-07 01:20:16 UTC) #33
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1951193002/220001
4 years, 6 months ago (2016-06-07 01:33:53 UTC) #35
commit-bot: I haz the power
Committed patchset #12 (id:220001)
4 years, 6 months ago (2016-06-07 02:39:24 UTC) #37
commit-bot: I haz the power
Patchset 12 (id:??) landed as https://crrev.com/5fa5dbdf25bbec21b84f752d3f0642cd184467e2 Cr-Commit-Position: refs/heads/master@{#398204}
4 years, 6 months ago (2016-06-07 02:40:46 UTC) #39
Geoff Lang
A revert of this CL (patchset #12 id:220001) has been created in https://codereview.chromium.org/2046033002/ by geofflang@chromium.org. ...
4 years, 6 months ago (2016-06-07 17:38:51 UTC) #40
sunnyps
PTAL No more scheduling tasks if sync token creation fails.
4 years, 6 months ago (2016-06-09 23:48:26 UTC) #42
piman
lgtm https://codereview.chromium.org/1951193002/diff/240001/cc/raster/gpu_raster_buffer_provider.cc File cc/raster/gpu_raster_buffer_provider.cc (right): https://codereview.chromium.org/1951193002/diff/240001/cc/raster/gpu_raster_buffer_provider.cc#newcode162 cc/raster/gpu_raster_buffer_provider.cc:162: // Do not proceed with ScheduleTasks if sync ...
4 years, 6 months ago (2016-06-10 01:02:47 UTC) #43
sunnyps
Fixed the invalid mailbox bug due to consuming the mailbox on the worker thread without ...
4 years, 6 months ago (2016-06-10 22:13:55 UTC) #44
sunnyps
Fixed the invalid mailbox bug due to consuming the mailbox on the worker thread without ...
4 years, 6 months ago (2016-06-10 22:13:56 UTC) #45
piman
https://codereview.chromium.org/1951193002/diff/340001/cc/resources/resource_provider.cc File cc/resources/resource_provider.cc (right): https://codereview.chromium.org/1951193002/diff/340001/cc/resources/resource_provider.cc#newcode920 cc/resources/resource_provider.cc:920: // DCHECK_NE(Resource::NEEDS_WAIT, resource->synchronization_state()); nit: I think you should leave ...
4 years, 6 months ago (2016-06-10 22:57:01 UTC) #46
sunnyps
Addressed the comments and also added a synchronized flag to ScopedWriteLockGL so that we don't ...
4 years, 6 months ago (2016-06-11 01:29:52 UTC) #47
piman
lgtm
4 years, 6 months ago (2016-06-11 01:51:36 UTC) #48
sunnyps
Made software/GMB write locks set the resource to synchronized to appease the DCHECKS in PrepareSendToParent. ...
4 years, 6 months ago (2016-06-13 22:02:07 UTC) #49
piman
lgtm
4 years, 6 months ago (2016-06-14 00:32:21 UTC) #50
sunnyps
I've made raster/decode tasks cleanup properly if we choose to not schedule them. Also adding ...
4 years, 6 months ago (2016-06-14 21:37:02 UTC) #51
ericrk
LGTM - canceling the tile tasks makes sense to me. https://codereview.chromium.org/1951193002/diff/420001/cc/resources/resource_provider.cc File cc/resources/resource_provider.cc (right): https://codereview.chromium.org/1951193002/diff/420001/cc/resources/resource_provider.cc#newcode702 ...
4 years, 6 months ago (2016-06-14 22:36:05 UTC) #53
sunnyps
Thanks! piman@ Can you please take a final look at this? https://codereview.chromium.org/1951193002/diff/420001/cc/resources/resource_provider.cc File cc/resources/resource_provider.cc (right): ...
4 years, 6 months ago (2016-06-14 23:22:52 UTC) #54
piman
lgtm
4 years, 6 months ago (2016-06-15 00:30:22 UTC) #55
vmpstr
lgtm with nit https://codereview.chromium.org/1951193002/diff/440001/cc/tiles/tile_manager.cc File cc/tiles/tile_manager.cc (right): https://codereview.chromium.org/1951193002/diff/440001/cc/tiles/tile_manager.cc#newcode889 cc/tiles/tile_manager.cc:889: // Synchronize worker with compositor. If ...
4 years, 6 months ago (2016-06-15 00:39:34 UTC) #57
sunnyps
https://codereview.chromium.org/1951193002/diff/440001/cc/tiles/tile_manager.cc File cc/tiles/tile_manager.cc (right): https://codereview.chromium.org/1951193002/diff/440001/cc/tiles/tile_manager.cc#newcode889 cc/tiles/tile_manager.cc:889: // Synchronize worker with compositor. If that fails do ...
4 years, 6 months ago (2016-06-15 00:42:00 UTC) #58
sunnyps
Thanks for all the reviews! https://codereview.chromium.org/1951193002/diff/440001/cc/tiles/tile_manager.cc File cc/tiles/tile_manager.cc (right): https://codereview.chromium.org/1951193002/diff/440001/cc/tiles/tile_manager.cc#newcode889 cc/tiles/tile_manager.cc:889: // Synchronize worker with ...
4 years, 6 months ago (2016-06-15 01:56:58 UTC) #59
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1951193002/460001
4 years, 6 months ago (2016-06-15 01:57:24 UTC) #62
commit-bot: I haz the power
Try jobs failed on following builders: linux_android_rel_ng on tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/linux_android_rel_ng/builds/87783)
4 years, 6 months ago (2016-06-15 03:09:17 UTC) #64
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1951193002/460001
4 years, 6 months ago (2016-06-15 18:31:38 UTC) #66
commit-bot: I haz the power
Committed patchset #24 (id:460001)
4 years, 6 months ago (2016-06-15 19:07:21 UTC) #68
commit-bot: I haz the power
CQ bit was unchecked
4 years, 6 months ago (2016-06-15 19:07:35 UTC) #69
commit-bot: I haz the power
Patchset 24 (id:??) landed as https://crrev.com/3b0f0b8d3db0a9f66864d5b7da87c82f49e74a29 Cr-Commit-Position: refs/heads/master@{#399983}
4 years, 6 months ago (2016-06-15 19:10:07 UTC) #71
sunnyps
4 years, 6 months ago (2016-06-21 00:10:49 UTC) #72
Message was sent while issue was closed.
A revert of this CL (patchset #24 id:460001) has been created in
https://codereview.chromium.org/2081863002/ by sunnyps@chromium.org.

The reason for reverting is: Bug 621422, 621130

Some tasks can be completed twice which leads to crashes..

Powered by Google App Engine
This is Rietveld 408576698