Closed Bug 1889757 (gpu-process-macos) Opened 1 year ago Closed 21 days ago

Implement GPU process on macOS

Categories

(Core :: Graphics, enhancement, P2)

Unspecified
macOS
enhancement

Tracking

()

RESOLVED FIXED
143 Branch
Tracking Status
firefox143 --- fixed

People

(Reporter: bradwerth, Assigned: bradwerth)

References

(Blocks 13 open bugs, Regressed 1 open bug)

Details

Attachments

(8 files, 6 obsolete files)

48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review

This bug covers an initial implementation of the GPU process on macOS.

Blocks: 1838649
Blocks: 1711804
Blocks: 1713230
Blocks: 1711802
Blocks: 1714235
Blocks: 1711801
Blocks: 1783212
Blocks: 1535120
See Also: → 1904174

Current WIP patches spin up a GPU Process (with pref layers.gpu-process.enabled set to true), which doesn't render any surfaces. Work continues.

This attempts to do the following things:

  1. Make nsCocoaWindow override and store a platform compositor widget
    delegate, overriding nsBaseWidget to do so. The delegate is
    the CompositorBridgeChild.
  2. Actually set the delegate -- this part is still missing I think.
  3. Make nsCocoaWindow::DoResize update the size of the widget delegate,
    which should allow the child to offer up its CocoaCompositorWidget and
    receive rendering calls on the GPU.
Attachment #9476396 - Attachment description: WIP: Bug 1889757 Part 3: Make nsCocoaWindow hold a PlatformCompositorWidgetDelegate pointer, as nsWindow does. → WIP: Bug 1889757 Part 3: Make nsChildView hold a PlatformCompositorWidgetDelegate pointer.
See Also: → 1919165
Depends on: 1962217
Attachment #9438126 - Attachment is obsolete: true
Attachment #9476396 - Attachment is obsolete: true
Attachment #9473751 - Attachment is obsolete: true
Attachment #9485167 - Attachment description: WIP: Bug 1889757 Part 2: Define the NativeLayerRemote parent and child to send layers from gpu to parent. → WIP: Bug 1889757 Part 2: Define the NativeLayerRemoteMac parent and child to send layers from gpu to parent.
Attachment #9485169 - Attachment is obsolete: true

Comment on attachment 9486323 [details]
WIP: Bug 1889757 Part 4: Create the NativeLayerRemoteMac peers.

Revision D248437 was moved to bug 1885451. Setting attachment 9486323 [details] to obsolete.

Attachment #9486323 - Attachment is obsolete: true
Attachment #9486323 - Attachment is obsolete: false

This handles the NativeLayerRoot methods to turn them into messages sent
to the NativeLayerRemoteMacParent. The layers are identified by their
GPU-side (client) pointers, which are turned into flavorless u64 values.
When layers are created, they we send creation messages noting the size
and other params of the layer creation. Later, when we CommitToScreen,
we pull properties from each of the layers, not knowing which of those
properties might have changed. Together, it should be enough for the
parent to reconstruct its layers and whatever new properties they should
have.

This patch probably has unneeded parts that should be moved into other
parts of this patch stack.

Comment on attachment 9486323 [details]
WIP: Bug 1889757 Part 4: Create the NativeLayerRemoteMac peers.

Revision D248437 was moved to bug 1885451. Setting attachment 9486323 [details] to obsolete.

Attachment #9486323 - Attachment is obsolete: true

This also incidentally removes the unused NativeLayerCA::NextSurface
method. That method was made redundant in the refactoring of Bug
1962217.

Attachment #9490722 - Attachment description: WIP: Bug 1889757 Part 5: Pass messages from NativeLayerRemoteMacChild to NativeLayerRemoteMacParent. → WIP: Bug 1889757 Part 6: Pass messages from NativeLayerRemoteMacChild to NativeLayerRemoteMacParent.
Attachment #9491414 - Attachment description: WIP: Bug 1889757 Part 6: Interpret messages in NativeLayerRemoteParent. → WIP: Bug 1889757 Part 7: Interpret messages in NativeLayerRemoteParent.

This supports a later part in this patch where a NativeLayerRoot
subclass is added, which needs to define its own AddRef and Release
implementations.

Attachment #9485167 - Attachment description: WIP: Bug 1889757 Part 2: Define the NativeLayerRemoteMac parent and child to send layers from gpu to parent. → WIP: Bug 1889757 Part 3: Define the NativeLayerRemoteMac parent and child to send layers from gpu to parent.
Attachment #9485168 - Attachment description: WIP: Bug 1889757 Part 3: Make nsCocoaWindow hold a PlatformCompositorWidgetDelegate pointer. → WIP: Bug 1889757 Part 4: Make nsCocoaWindow hold a PlatformCompositorWidgetDelegate pointer.
Attachment #9491413 - Attachment description: WIP: Bug 1889757 Part 4: Create the NativeLayerRemoteMac peers. → WIP: Bug 1889757 Part 5: Create the NativeLayerRemoteMac peers.
Attachment #9491872 - Attachment description: WIP: Bug 1889757 Part 5: Define a NativeLayerCA variant that receive an IOSurfaceRef directly. → WIP: Bug 1889757 Part 6: Define a NativeLayerCA variant that receive an IOSurfaceRef directly.
Attachment #9490722 - Attachment description: WIP: Bug 1889757 Part 6: Pass messages from NativeLayerRemoteMacChild to NativeLayerRemoteMacParent. → WIP: Bug 1889757 Part 7: Pass messages from NativeLayerRemoteMacChild to NativeLayerRemoteMacParent.
Attachment #9491414 - Attachment description: WIP: Bug 1889757 Part 7: Interpret messages in NativeLayerRemoteParent. → WIP: Bug 1889757 Part 8: Interpret messages in NativeLayerRemoteParent.

This change allows NativeLayerRemoteMac::AttachExternalImage to use the
surface injection system in NativeLayerCA::SetSurfaceToUse to handle
video surfaces.

Attachment #9495055 - Attachment description: WIP: Bug 1889757 Part 2: Change NativeLayer to use pure virtual AddRef counting. → Bug 1889757 Part 2: Change NativeLayer to use pure virtual AddRef counting.
Attachment #9485167 - Attachment description: WIP: Bug 1889757 Part 3: Define the NativeLayerRemoteMac parent and child to send layers from gpu to parent. → Bug 1889757 Part 3: Define the NativeLayerRemoteMac parent and child to send layers from gpu to parent.
Attachment #9485168 - Attachment description: WIP: Bug 1889757 Part 4: Make nsCocoaWindow hold a PlatformCompositorWidgetDelegate pointer. → Bug 1889757 Part 4: Make nsCocoaWindow hold a PlatformCompositorWidgetDelegate pointer.
Attachment #9491413 - Attachment description: WIP: Bug 1889757 Part 5: Create the NativeLayerRemoteMac peers. → Bug 1889757 Part 5: Create the NativeLayerRemoteMac peers.
Attachment #9491872 - Attachment description: WIP: Bug 1889757 Part 6: Define a NativeLayerCA variant that receive an IOSurfaceRef directly. → Bug 1889757 Part 6: Define a NativeLayerCA variant that receive an IOSurfaceRef directly.
Attachment #9490722 - Attachment description: WIP: Bug 1889757 Part 7: Pass messages from NativeLayerRemoteMacChild to NativeLayerRemoteMacParent. → Bug 1889757 Part 7: Pass messages from NativeLayerRemoteMacChild to NativeLayerRemoteMacParent.
Attachment #9491414 - Attachment description: WIP: Bug 1889757 Part 8: Interpret messages in NativeLayerRemoteParent. → Bug 1889757 Part 8: Interpret messages in NativeLayerRemoteParent.
Attachment #9495056 - Attachment description: WIP: Bug 1889757 Part 9: Make NativeLayerRemoteMac handle video. → Bug 1889757 Part 9: Make NativeLayerRemoteMac handle video.
Attachment #9428150 - Attachment description: WIP: Bug 1889757 Part 1: Stub in CocoaCompositorWidget. → Bug 1889757 Part 1: Stub in CocoaCompositorWidget.
Blocks: 1974545
Blocks: 1974546
Attachment #9485167 - Attachment description: Bug 1889757 Part 3: Define the NativeLayerRemoteMac parent and child to send layers from gpu to parent. → Bug 1889757 Part 3: Define the NativeLayerRootRemoteMac parent and child to send layers from gpu to parent.
Attachment #9491413 - Attachment description: Bug 1889757 Part 5: Create the NativeLayerRemoteMac peers. → Bug 1889757 Part 5: Create the NativeLayerRootRemoteMac peers.
Attachment #9491872 - Attachment description: Bug 1889757 Part 6: Define a NativeLayerCA variant that receive an IOSurfaceRef directly. → Bug 1889757 Part 3: Define a NativeLayerCA variant that receive an IOSurfaceRef directly.
Attachment #9485167 - Attachment description: Bug 1889757 Part 3: Define the NativeLayerRootRemoteMac parent and child to send layers from gpu to parent. → Bug 1889757 Part 4: Define the NativeLayerRootRemoteMac parent and child to send layers from gpu to parent.
Attachment #9485168 - Attachment description: Bug 1889757 Part 4: Make nsCocoaWindow hold a PlatformCompositorWidgetDelegate pointer. → Bug 1889757 Part 5: Make nsCocoaWindow hold a PlatformCompositorWidgetDelegate pointer.
Attachment #9491413 - Attachment description: Bug 1889757 Part 5: Create the NativeLayerRootRemoteMac peers. → Bug 1889757 Part 6: Create the NativeLayerRootRemoteMac peers.
Attachment #9491413 - Attachment description: Bug 1889757 Part 6: Create the NativeLayerRootRemoteMac peers. → Bug 1889757 Part 6: Create the NativeLayerRemote peers.
Attachment #9490722 - Attachment description: Bug 1889757 Part 7: Pass messages from NativeLayerRemoteMacChild to NativeLayerRemoteMacParent. → Bug 1889757 Part 7: Pass messages from NativeLayerRootRemoteMacChild to NativeLayerRootRemoteMacParent.
Attachment #9491414 - Attachment description: Bug 1889757 Part 8: Interpret messages in NativeLayerRemoteParent. → Bug 1889757 Part 8: Interpret messages in NativeLayerRootRemoteMacParent.
Attachment #9495056 - Attachment description: Bug 1889757 Part 9: Make NativeLayerRemoteMac handle video. → Bug 1889757 Part 9: Make NativeLayerRootRemoteMacParent handle video.
Blocks: 1978431
Blocks: 1978432
Attachment #9491872 - Attachment description: Bug 1889757 Part 3: Define a NativeLayerCA variant that receive an IOSurfaceRef directly. → Bug 1889757 Part 2: Define a NativeLayerCA variant that receive an IOSurfaceRef directly.
Attachment #9485167 - Attachment description: Bug 1889757 Part 4: Define the NativeLayerRootRemoteMac parent and child to send layers from gpu to parent. → Bug 1889757 Part 3: Define the NativeLayerRootRemoteMac parent and child to send layers from gpu to parent.
Attachment #9485168 - Attachment description: Bug 1889757 Part 5: Make nsCocoaWindow hold a PlatformCompositorWidgetDelegate pointer. → Bug 1889757 Part 4: Make nsCocoaWindow hold a PlatformCompositorWidgetDelegate pointer.
Attachment #9491413 - Attachment description: Bug 1889757 Part 6: Create the NativeLayerRemote peers. → Bug 1889757 Part 5: Create the NativeLayerRemote peers.
Attachment #9490722 - Attachment description: Bug 1889757 Part 7: Pass messages from NativeLayerRootRemoteMacChild to NativeLayerRootRemoteMacParent. → Bug 1889757 Part 6: Pass messages from NativeLayerRootRemoteMacChild to NativeLayerRootRemoteMacParent.
Attachment #9491414 - Attachment description: Bug 1889757 Part 8: Interpret messages in NativeLayerRootRemoteMacParent. → Bug 1889757 Part 7: Interpret messages in NativeLayerRootRemoteMacParent.
Attachment #9495056 - Attachment description: Bug 1889757 Part 9: Make NativeLayerRootRemoteMacParent handle video. → Bug 1889757 Part 8: Make NativeLayerRootRemoteMacParent handle video.
Attachment #9495055 - Attachment is obsolete: true
Blocks: 1979743
Pushed by bwerth@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/f84fb51ac4a3 https://hg.mozilla.org/integration/autoland/rev/006491ab8f8c Part 1: Stub in CocoaCompositorWidget. r=mstange,gfx-reviewers,aosmond https://github.com/mozilla-firefox/firefox/commit/35caef7d5fe5 https://hg.mozilla.org/integration/autoland/rev/2b177ac64eae Part 2: Define a NativeLayerCA variant that receive an IOSurfaceRef directly. r=mstange https://github.com/mozilla-firefox/firefox/commit/a18f63c00eb0 https://hg.mozilla.org/integration/autoland/rev/495b4cb12198 Part 3: Define the NativeLayerRootRemoteMac parent and child to send layers from gpu to parent. r=mstange,gfx-reviewers,aosmond https://github.com/mozilla-firefox/firefox/commit/669eed57edbb https://hg.mozilla.org/integration/autoland/rev/e95cd86566eb Part 4: Make nsCocoaWindow hold a PlatformCompositorWidgetDelegate pointer. r=mstange https://github.com/mozilla-firefox/firefox/commit/a5766481e715 https://hg.mozilla.org/integration/autoland/rev/6c51147c45fe Part 5: Create the NativeLayerRemote peers. r=mstange,gfx-reviewers,aosmond https://github.com/mozilla-firefox/firefox/commit/3431bc5e7957 https://hg.mozilla.org/integration/autoland/rev/58524d6fab76 Part 6: Pass messages from NativeLayerRootRemoteMacChild to NativeLayerRootRemoteMacParent. r=mstange,gfx-reviewers,nical https://github.com/mozilla-firefox/firefox/commit/b729f0560594 https://hg.mozilla.org/integration/autoland/rev/cd06b32b9cb2 Part 7: Interpret messages in NativeLayerRootRemoteMacParent. r=gfx-reviewers,nical,mstange https://github.com/mozilla-firefox/firefox/commit/a250c7ffd5b7 https://hg.mozilla.org/integration/autoland/rev/3f09cedb0a5b Part 8: Make NativeLayerRootRemoteMacParent handle video. r=mstange,gfx-reviewers,aosmond
Pushed by abutkovits@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/95d61f82d1f3 https://hg.mozilla.org/integration/autoland/rev/27e1121f32ea Revert "Bug 1889757 Part 8: Make NativeLayerRootRemoteMacParent handle video. r=mstange,gfx-reviewers,aosmond" for causing build bustages at NativeLayerCommandQueue.h.

Ugh, looks like I failed to push the rest of the patch stack. I'll clean up as best I can after I see what happens with this landing.

Pushed by bwerth@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/3d5d68787872 https://hg.mozilla.org/integration/autoland/rev/4d4289d80060 Part 2: Define a NativeLayerCA variant that receive an IOSurfaceRef directly. r=mstange https://github.com/mozilla-firefox/firefox/commit/8943764cde12 https://hg.mozilla.org/integration/autoland/rev/ce38d08e7549 Part 3: Define the NativeLayerRootRemoteMac parent and child to send layers from gpu to parent. r=mstange,gfx-reviewers,aosmond https://github.com/mozilla-firefox/firefox/commit/9c1d5f957150 https://hg.mozilla.org/integration/autoland/rev/7dfefdaa4dfc Part 4: Make nsCocoaWindow hold a PlatformCompositorWidgetDelegate pointer. r=mstange https://github.com/mozilla-firefox/firefox/commit/2b8e1ef9deea https://hg.mozilla.org/integration/autoland/rev/a43156231b6d Part 5: Create the NativeLayerRemote peers. r=mstange,gfx-reviewers,aosmond https://github.com/mozilla-firefox/firefox/commit/dd038cf45d3b https://hg.mozilla.org/integration/autoland/rev/239d4ebbb302 Part 6: Pass messages from NativeLayerRootRemoteMacChild to NativeLayerRootRemoteMacParent. r=mstange,gfx-reviewers,nical https://github.com/mozilla-firefox/firefox/commit/7c31ca1c9eec https://hg.mozilla.org/integration/autoland/rev/36a9f3531b90 Part 7: Interpret messages in NativeLayerRootRemoteMacParent. r=gfx-reviewers,nical,mstange https://github.com/mozilla-firefox/firefox/commit/dc8d321ba8ba https://hg.mozilla.org/integration/autoland/rev/22daba702372 Part 8: Make NativeLayerRootRemoteMacParent handle video. r=mstange,gfx-reviewers,aosmond
Flags: needinfo?(bwerth)
Blocks: 1981068
Regressions: 1981793
Depends on: 1983330
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: