Bug 219007 - [GPU Process] Clean up recreating the ImageBufferBackend because of GPU crashing
Summary: [GPU Process] Clean up recreating the ImageBufferBackend because of GPU crashing
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Canvas (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Said Abou-Hallawa
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-11-16 15:20 PST by Said Abou-Hallawa
Modified: 2020-12-07 19:22 PST (History)
13 users (show)

See Also:


Attachments
Patch (27.39 KB, patch)
2020-11-16 16:41 PST, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (85.72 KB, patch)
2020-11-25 02:09 PST, Said Abou-Hallawa
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (96.21 KB, patch)
2020-11-25 21:49 PST, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (96.95 KB, patch)
2020-11-25 22:00 PST, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (99.01 KB, patch)
2020-11-26 00:47 PST, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (102.57 KB, patch)
2020-11-26 19:06 PST, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (103.05 KB, patch)
2020-11-27 03:08 PST, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (103.49 KB, patch)
2020-11-30 12:34 PST, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (103.44 KB, patch)
2020-11-30 12:43 PST, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (102.46 KB, patch)
2020-11-30 12:49 PST, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (99.65 KB, patch)
2020-11-30 13:30 PST, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (109.98 KB, patch)
2020-12-04 01:48 PST, Said Abou-Hallawa
simon.fraser: review+
Details | Formatted Diff | Diff
Patch (109.94 KB, patch)
2020-12-04 11:21 PST, Said Abou-Hallawa
sabouhallawa: commit-queue-
Details | Formatted Diff | Diff
Patch (110.13 KB, patch)
2020-12-04 12:31 PST, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Said Abou-Hallawa 2020-11-16 15:20:26 PST
No need to store the backend parameters in RemoteImageBufferProxy. They can be accessed from the current ImageBufferBackend via the ImageBuffer before the backend is cleared.
Comment 1 Said Abou-Hallawa 2020-11-16 16:41:54 PST
Created attachment 414293 [details]
Patch
Comment 2 Simon Fraser (smfr) 2020-11-16 17:57:10 PST
Comment on attachment 414293 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=414293&action=review

> Source/WebKit/WebProcess/GPU/graphics/RemoteImageBufferProxy.h:187
> +    void commitFlushDisplayList(WebCore::DisplayList::FlushIdentifier flushIdentifier) override

We need to stop using "commit" and "flush" in ways we don't all understand.
Comment 3 Tim Horton 2020-11-16 18:40:09 PST
IMO (but obv. up for discussion):

"submit" for "send display list/work to GPUP", like Wenson fixed elsewhere
"flush" is "wait till all submitted work has actually been completed"
"commit" should be just for the layer tree transactions (but is effectively the same as "submit" for a transaction)

and no combination of the above means anything so we shouldn't see them adjacent to each other :)
Comment 4 Said Abou-Hallawa 2020-11-25 02:09:42 PST
Created attachment 414861 [details]
Patch
Comment 5 Said Abou-Hallawa 2020-11-25 21:49:34 PST
Created attachment 414879 [details]
Patch
Comment 6 Said Abou-Hallawa 2020-11-25 22:00:02 PST
Created attachment 414880 [details]
Patch
Comment 7 Said Abou-Hallawa 2020-11-26 00:47:26 PST
Created attachment 414885 [details]
Patch
Comment 8 Radar WebKit Bug Importer 2020-11-26 03:22:02 PST
<rdar://problem/71747762>
Comment 9 Said Abou-Hallawa 2020-11-26 19:06:21 PST
Created attachment 414912 [details]
Patch
Comment 10 Said Abou-Hallawa 2020-11-27 03:08:05 PST
Created attachment 414935 [details]
Patch
Comment 11 Simon Fraser (smfr) 2020-11-30 10:50:10 PST
Comment on attachment 414935 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=414935&action=review

> Source/WebCore/platform/graphics/ConcreteImageBuffer.h:297
> +    std::unique_ptr<ImageBufferBackend::Parameters> m_parameters;

Why not just store a copy of the tiny struct? Much simpler.

> Source/WebCore/platform/graphics/ImageBufferBackend.h:166
> +    const Parameters& m_parameters;

Who owns the original data? Would be safer to just store by value.
Comment 12 Said Abou-Hallawa 2020-11-30 12:34:53 PST
Created attachment 415043 [details]
Patch
Comment 13 Said Abou-Hallawa 2020-11-30 12:43:17 PST
Created attachment 415045 [details]
Patch
Comment 14 Said Abou-Hallawa 2020-11-30 12:49:24 PST
Created attachment 415046 [details]
Patch
Comment 15 Said Abou-Hallawa 2020-11-30 13:30:29 PST
Created attachment 415050 [details]
Patch
Comment 16 Said Abou-Hallawa 2020-11-30 13:34:37 PST
ImageBufferBackend::Parameters are saved by value in ImageBufferBackend and ConcreteImageBuffer. Renaming the flush/commit/flush functions was removed from this patch and will be addressed in a different patch.
Comment 17 Said Abou-Hallawa 2020-12-04 01:48:59 PST
Created attachment 415395 [details]
Patch
Comment 18 Simon Fraser (smfr) 2020-12-04 10:54:41 PST
Comment on attachment 415395 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=415395&action=review

> Source/WebCore/platform/graphics/cg/ImageBufferCGBackend.cpp:124
> +    auto backendSize = this->backendSize();

Doesn't seem worthwhile storing this in a local.

> Source/WebCore/platform/graphics/cg/ImageBufferCGBitmapBackend.cpp:108
> +    return { static_cast<int>(CGBitmapContextGetWidth(context().platformContext())), static_cast<int>(CGBitmapContextGetHeight(context().platformContext())) };

Let's not fetch context().platformContext() twice.
Comment 19 Said Abou-Hallawa 2020-12-04 11:21:40 PST
Created attachment 415434 [details]
Patch
Comment 20 Said Abou-Hallawa 2020-12-04 12:31:04 PST
Created attachment 415445 [details]
Patch
Comment 21 Said Abou-Hallawa 2020-12-04 12:33:32 PST
Comment on attachment 415395 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=415395&action=review

>> Source/WebCore/platform/graphics/cg/ImageBufferCGBackend.cpp:124
>> +    auto backendSize = this->backendSize();
> 
> Doesn't seem worthwhile storing this in a local.

Actually it is worthy. sinkIntoNativeImage() destroys the backend. So we can't call backendSize() after calling sinkIntoNativeImage(). I put it back and I added a comment.
Comment 22 EWS 2020-12-04 14:30:50 PST
Committed r270458: <https://trac.webkit.org/changeset/270458>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 415445 [details].