Closed Bug 1934497 Opened 2 months ago Closed 2 months ago

[Wayland] Implement WaylandSurface to render to screen on Linux

Categories

(Core :: Widget: Gtk, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
135 Branch
Tracking Status
firefox135 --- fixed

People

(Reporter: stransky, Assigned: stransky)

References

(Blocks 3 open bugs)

Details

Attachments

(18 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
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
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review

Implement WaylandSurface to provide unified way to render on screen on Linux. That will be used by Webrender/GL, SW rendering and Webrender compositor (native layers). Unified rendering ensures we use the same codepath and will fix bugs in Wayland native layers implementation.

Type: defect → enhancement
Priority: -- → P3
  • Change VSync modile logging name from WidgetVsync to WidgetVSync
  • Add WidgetCompositor logging module
Assignee: nobody → stransky
Status: NEW → ASSIGNED

Allow to lock WaylandSurface and does wl_surface commit if requested on unlock.

Use persistent WaylandSurface frame callback to fire VSync events.

  • Make nsWindow own WaylandSurface which makes sure we don't release it too early as is reffed
  • Always get scale factor from parent nsWindow for popups, don't try to guess
  • Simplify VSync management
  • Use Verbose logging level for extra size/scale messages

We'll update WaylandNativeLayers for WaylandSurface in next patches.

  • Replace MozContainerSurfaceLock with WaylandSurfaceLock
  • Temporary disable GtkCompositorWidget::GetNativeLayerRoot()
  • We may need to provide HDR info per monitor but for now it's enough to just enable it globally to get it working.

@ Martin: I'm following this with great interest, but unfortunately lack the bandwidth to do in-depth reviewing atm., sorry :/

(In reply to Robert Mader [:rmader] from comment #18)

@ Martin: I'm following this with great interest, but unfortunately lack the bandwidth to do in-depth reviewing atm., sorry :/

Not a problem, it can be adjusted any time later.

Pushed by stransky@redhat.com: https://hg.mozilla.org/integration/autoland/rev/59b2a1f052e4 [Wayland] Update nsAppShell logging r=emilio https://hg.mozilla.org/integration/autoland/rev/fe1e2b1b4f8b [Wayland] Add GdkWindow to traits to use it with RefPtr r=emilio https://hg.mozilla.org/integration/autoland/rev/f6ea1323c158 [Wayland] Allow to run GetDesktopEnvironmentIdentifier() from different threads r=emilio https://hg.mozilla.org/integration/autoland/rev/2fbec9faf49c [Wayland] Implement wl_surface abstraction as WaylandSurface r=emilio https://hg.mozilla.org/integration/autoland/rev/a1cf316b3e7a [Wayland] Implement WaylandSurface lock as WaylandSurfaceLock class r=emilio https://hg.mozilla.org/integration/autoland/rev/d6e7e274dda3 [Wayland] Udate WaylandBuffer to work with WaylandSurface and implement WaylandBufferDMABUF r=emilio https://hg.mozilla.org/integration/autoland/rev/bbe16df11895 [Wayland] Move wl_surface management from MozContainerWayland to WaylandSurface and reference it from MozContainerWayland r=emilio https://hg.mozilla.org/integration/autoland/rev/4f50bd47febd [Wayland] Update WindowSurfaceWaylandMultiBuffer to work with WaylandSurface r=emilio https://hg.mozilla.org/integration/autoland/rev/739018e9ae4a [Wayland] Rework WaylandVsyncSource for WaylandSurface r=emilio https://hg.mozilla.org/integration/autoland/rev/ed34f4ff5a2b [Wayland] Make nsWindow to use WaylandSurface and new VSync interface r=emilio https://hg.mozilla.org/integration/autoland/rev/2f0971ca8b41 [Wayland] Switch MozContainerSurfaceLock for WaylandSurfaceClock at RenderCompositorEGL r=emilio https://hg.mozilla.org/integration/autoland/rev/6225ae4714a9 [Wayland] Temporary disable layer rendering r=emilio https://hg.mozilla.org/integration/autoland/rev/31f0a398817f [Wayland] Update GtkCompositorWidget for WaylandSurface r=emilio https://hg.mozilla.org/integration/autoland/rev/e535888994ed [Wayland] Propagate HDR info from WaylandDisplay to Screen r=emilio https://hg.mozilla.org/integration/autoland/rev/e6b221a0e987 [Wayland] Use wl_surface owned by Gtk to set Wayland WakeLockListener r=emilio https://hg.mozilla.org/integration/autoland/rev/b2f82cada9b0 [Wayland] Remove MozContainerSurfaceLock r=emilio
Regressions: 1936214

Backed out for causing Wayland related mochitest failures and bustage on WaylandSurface.cpp and Bug 1936214

Backout link

Push with failures

Failure log 1 // Failure log 2 // Failure log 3 // Failure log 4 // Failure log 5

Flags: needinfo?(stransky)
Duplicate of this bug: 1936214

For the leak it looks like WaylandSurface is references by unreleased VSyncSource. Not sure why it's kept around.

(In reply to Martin Stránský [:stransky] (ni? me) from comment #24)

For the leak it looks like WaylandSurface is references by unreleased VSyncSource. Not sure why it's kept around.

Hm, looks like popups is the issue as VSync is cleared. Perhaps popup holds strong ref to parent which is not released.

Looks like the memleaks are caused by compositor bug when wl_buffer is not released. Updated. Let's see if Wayland try is clean this run:

Flags: needinfo?(stransky)
Pushed by stransky@redhat.com: https://hg.mozilla.org/integration/autoland/rev/5ba05279a465 [Wayland] Update nsAppShell logging r=emilio https://hg.mozilla.org/integration/autoland/rev/191397418056 [Wayland] Add GdkWindow to traits to use it with RefPtr r=emilio https://hg.mozilla.org/integration/autoland/rev/75d095afa9cf [Wayland] Allow to run GetDesktopEnvironmentIdentifier() from different threads r=emilio https://hg.mozilla.org/integration/autoland/rev/693a7c400778 [Wayland] Implement wl_surface abstraction as WaylandSurface r=emilio https://hg.mozilla.org/integration/autoland/rev/c0512daa9188 [Wayland] Implement WaylandSurface lock as WaylandSurfaceLock class r=emilio https://hg.mozilla.org/integration/autoland/rev/dcef70581e34 [Wayland] Udate WaylandBuffer to work with WaylandSurface and implement WaylandBufferDMABUF r=emilio https://hg.mozilla.org/integration/autoland/rev/ff8a92afd360 [Wayland] Move wl_surface management from MozContainerWayland to WaylandSurface and reference it from MozContainerWayland r=emilio https://hg.mozilla.org/integration/autoland/rev/6806bbf97c86 [Wayland] Update WindowSurfaceWaylandMultiBuffer to work with WaylandSurface r=emilio https://hg.mozilla.org/integration/autoland/rev/5343854a37e5 [Wayland] Rework WaylandVsyncSource for WaylandSurface r=emilio https://hg.mozilla.org/integration/autoland/rev/a9a38191e649 [Wayland] Make nsWindow to use WaylandSurface and new VSync interface r=emilio https://hg.mozilla.org/integration/autoland/rev/eea0eef40abf [Wayland] Switch MozContainerSurfaceLock for WaylandSurfaceClock at RenderCompositorEGL r=emilio https://hg.mozilla.org/integration/autoland/rev/87613cc32aa4 [Wayland] Temporary disable layer rendering r=emilio https://hg.mozilla.org/integration/autoland/rev/2bf4f54a3077 [Wayland] Update GtkCompositorWidget for WaylandSurface r=emilio https://hg.mozilla.org/integration/autoland/rev/e6917a8311f2 [Wayland] Propagate HDR info from WaylandDisplay to Screen r=emilio https://hg.mozilla.org/integration/autoland/rev/6aff7ffeaff4 [Wayland] Use wl_surface owned by Gtk to set Wayland WakeLockListener r=emilio https://hg.mozilla.org/integration/autoland/rev/795745f450df [Wayland] Remove MozContainerSurfaceLock r=emilio

Backed out for causing mass failures.

Flags: needinfo?(stransky)

Updated, Thanks.

Flags: needinfo?(stransky)
Pushed by stransky@redhat.com: https://hg.mozilla.org/integration/autoland/rev/2e9080fd1c7c [Wayland] Update nsAppShell logging r=emilio https://hg.mozilla.org/integration/autoland/rev/3e0c8eec4b20 [Wayland] Add GdkWindow to traits to use it with RefPtr r=emilio https://hg.mozilla.org/integration/autoland/rev/84186392210d [Wayland] Allow to run GetDesktopEnvironmentIdentifier() from different threads r=emilio https://hg.mozilla.org/integration/autoland/rev/e87a5169f668 [Wayland] Implement wl_surface abstraction as WaylandSurface r=emilio https://hg.mozilla.org/integration/autoland/rev/8cc721cc8bc5 [Wayland] Implement WaylandSurface lock as WaylandSurfaceLock class r=emilio https://hg.mozilla.org/integration/autoland/rev/b72ae2651fad [Wayland] Udate WaylandBuffer to work with WaylandSurface and implement WaylandBufferDMABUF r=emilio https://hg.mozilla.org/integration/autoland/rev/395f7e887b81 [Wayland] Move wl_surface management from MozContainerWayland to WaylandSurface and reference it from MozContainerWayland r=emilio https://hg.mozilla.org/integration/autoland/rev/4e2fe326671e [Wayland] Update WindowSurfaceWaylandMultiBuffer to work with WaylandSurface r=emilio https://hg.mozilla.org/integration/autoland/rev/1c53bbe84cda [Wayland] Rework WaylandVsyncSource for WaylandSurface r=emilio https://hg.mozilla.org/integration/autoland/rev/4e75ec1344b9 [Wayland] Make nsWindow to use WaylandSurface and new VSync interface r=emilio https://hg.mozilla.org/integration/autoland/rev/c3b9163075af [Wayland] Switch MozContainerSurfaceLock for WaylandSurfaceClock at RenderCompositorEGL r=emilio https://hg.mozilla.org/integration/autoland/rev/18df8a1298f6 [Wayland] Temporary disable layer rendering r=emilio https://hg.mozilla.org/integration/autoland/rev/4a1a1cbab703 [Wayland] Update GtkCompositorWidget for WaylandSurface r=emilio https://hg.mozilla.org/integration/autoland/rev/dd6f161a2dd0 [Wayland] Propagate HDR info from WaylandDisplay to Screen r=emilio https://hg.mozilla.org/integration/autoland/rev/5e231ba0d046 [Wayland] Use wl_surface owned by Gtk to set Wayland WakeLockListener r=emilio https://hg.mozilla.org/integration/autoland/rev/f9a6fb8bae13 [Wayland] Remove MozContainerSurfaceLock r=emilio
Pushed by amarc@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/58a807c8fde7 [Wayland] Fix build bustage on release r=emilio https://hg.mozilla.org/integration/autoland/rev/8af28b4f8ccb [Wayland] Fix non unified build bustage r=emilio CLOSED TREE
Regressions: 1943583
Regressions: 1943662
Regressions: 1943874
Regressions: 1940924
No longer duplicate of this bug: 1735494
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: