Commit graph

102 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
a9620e05aa Bug 1763591 - Clean up a bit nsWaylandDisplay. r=stransky
Use inline initializers and remove (void), which is not necessary in
C++.

Differential Revision: https://phabricator.services.mozilla.com/D143147
2022-04-07 11:10:31 +00:00
Randell Jesup
fcaf70841e Bug 1207753 - Add MOZ_UNANNOTATED to all Mutexes/Monitors r=nika,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D140849
2022-03-16 18:47:08 +00:00
Noemi Erli
2390d257e6 Backed out changeset 12a59e5a50bf (bug 1207753) for causing build bustage CLOSED TREE 2022-03-16 18:32:51 +02:00
Randell Jesup
4b033a5256 Bug 1207753 - Add MOZ_UNANNOTATED to all Mutexes/Monitors r=nika,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D140849
2022-03-16 16:16:14 +00:00
Butkovits Atila
927ad62c6a Backed out changeset a68ee4b09f92 (bug 1207753) for causing Hazard bustages. CLOSED TREE 2022-03-16 14:38:14 +02:00
Randell Jesup
7d4b5fae04 Bug 1207753 - Add MOZ_UNANNOTATED to all Mutexes/Monitors r=nika,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D140849
2022-03-16 12:01:14 +00:00
stransky
265855ff8a Bug 1743769 [Wayland] Get xdg_activation_v1 interface from Wayland registry r=rmader
Differential Revision: https://phabricator.services.mozilla.com/D132553
2021-12-02 10:48:02 +00:00
Robert Mader
51d265f2ad Bug 1726923 - Add Wayland crash handler, r=stransky,emilio
To ensure Wayland protocol errors trigger crash reports.
This is inspired by Xwayland, which handles things similarly.

Note: in theory there are a few cases we wouldn't need to crash on
`wl_log` - but in practice we always want to.

Differential Revision: https://phabricator.services.mozilla.com/D123894
2021-08-31 18:27:00 +00:00
Andi-Bogdan Postelnicu
9945b94835 Bug 1519636 - Reformat recent changes to the Google coding style. r=emilio
Updated with clang-format version 12.0.1 (taskcluster-dNZqCRqWRTqa6cZxPKxh7Q)

Differential Revision: https://phabricator.services.mozilla.com/D122814
2021-08-23 09:30:23 +00:00
stransky
699174544b Bug 1721023 [Wayland] Close display registry right after use, r=rmader
Don't keep reference to wl_registry object as we don't need that so release it right after use.

Differential Revision: https://phabricator.services.mozilla.com/D120129
2021-07-20 18:29:49 +00:00
Robert Mader
943d2cda7b Bug 1718569 - Implement method to create a wl_buffer from a DMABufSurface, r=stransky
In order to allow us to create FBOs ourselves. Right now only implement
it for `DMABufSurfaceRGBA`. In the future, we will want implement the same
for YUV, see bug 1711461.

While on it, add mutexes to file descriptor functions to ensure the
surface mutex is always hold when calling them.

Differential Revision: https://phabricator.services.mozilla.com/D119013
2021-07-12 20:12:00 +00:00
Robert Mader
6d891cc4ba Bug 1710532 - Some Wayland/X11 related cleanups in WindowSurfaceProvider, r=stransky
And while on it, also clean up `moz.build` a bit in the same regard.
No functional changes intended.

Differential Revision: https://phabricator.services.mozilla.com/D114799
2021-05-11 09:44:39 +00:00
Greg V
c34911209c Bug 1580595 - [Wayland] Add support for pointer lock via relative-pointer and pointer-constraints r=stransky,rmader,emilio
On Wayland, it is not possible to warp the pointer.
To use the appropriate protocols, new IPC messages were added for supporting
a platform's native pointer locking mechanism.

Differential Revision: https://phabricator.services.mozilla.com/D102114
2021-04-22 14:56:43 +00:00
stransky
33c1175041 Bug 1706624 [Wayland] Use wl_seat0 from Gtk, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D112965
2021-04-21 17:29:21 +00:00
Robert Mader
801844c76c Bug 1699985 - Add wp_viewporter protocol, r=stransky
This protocol allows cropping and scaling of surfaces and is
required for native compositor integration.

Differential Revision: https://phabricator.services.mozilla.com/D111081
2021-04-07 11:11:41 +00:00
stransky
dc24c155c2 Bug 1702606 [Wayland] Don't call mWaylandDisplay::WaitForSyncEnd() from Compositor/Render thread, r=rmader
Differential Revision: https://phabricator.services.mozilla.com/D110590
2021-04-02 14:26:20 +00:00
Jan Alexander Steffens (heftig)
4920407bb3 Bug 1696845 - Use dlsym for gdk_*_display_get_type. r=stransky
Using `dlsym` for `gdk_wayland_display_get_type` is a cleaner solution
to bug 1696319, allowing running with a GTK that lacks the Wayland
backend.

Also adds a symmetric implementation for `gdk_x11_display_get_type`,
which should help running without X11.

Differential Revision: https://phabricator.services.mozilla.com/D107406
2021-03-11 14:32:53 +00:00
Narcis Beleuzu
198358fc15 Backed out changeset a4f4f640eaa7 (bug 1696845) for bustages on pangofc-fontmap.h 2021-03-10 04:49:51 +02:00
Jan Alexander Steffens (heftig)
1261a74d17 Bug 1696845 - Use dlsym for gdk_*_display_get_type. r=stransky
Using `dlsym` for `gdk_wayland_display_get_type` is a cleaner solution
to bug 1696319, allowing running with a GTK that lacks the Wayland
backend.

Also adds a symmetric implementation for `gdk_x11_display_get_type`,
which should help running without X11.

Differential Revision: https://phabricator.services.mozilla.com/D107406
2021-03-09 22:55:47 +00:00
stransky
2ef0cb2551 Bug 1685055 [Wayland] Post SyncBegin() to main thread only and remove thread specific code as it's unused, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D101157
2021-01-12 21:07:22 +00:00
stransky
45a9baf489 Bug 1685055 [Wayland] Dispatch Wayland display queue in main thread only, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D101156
2021-01-11 20:31:18 +00:00
Bogdan Tara
0545759f73 Backed out 2 changesets (bug 1685055) for nsWaylandDisplay related bustage CLOSED TREE
Backed out changeset 813da913ec72 (bug 1685055)
Backed out changeset c46c76db0a48 (bug 1685055)
2021-01-11 22:27:24 +02:00
stransky
e8802ce8e3 Bug 1685055 [Wayland] Post SyncBegin() to main thread only and remove thread specific code as it's unused, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D101157
2021-01-11 19:58:04 +00:00
stransky
b18d5b9051 Bug 1685055 [Wayland] Dispatch Wayland display queue in main thread only, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D101156
2021-01-11 19:57:57 +00:00
stransky
9be10fea0c Bug 1648698 [Wayland] Move nsWaylandDisplay::SyncBegin() out of FlushPendingCommitsLocked() call, r=rmader
- Move nsWaylandDisplay::SyncBegin() out of FlushPendingCommitsLocked() call to avoid a deadlock there
- Rename FlushPendingCommitsInternal() to FlushPendingCommitsLocked() to clearly state it operates on locked surface only.
- Implement nsWaylandDisplay::QueueSyncBegin() which delays SyncBegin() execution untill recent event batch is finished
  and use it instead of SyncBegin().

Differential Revision: https://phabricator.services.mozilla.com/D100384
2021-01-04 20:32:31 +00:00
Martin Stransky
4f499c0c54 Bug 1660336 Build ffvpx FFmpegVideoDecoder module with VAAPI support, r=jya,glandium,jgilbert
- Remove MOZ_WAYLAND_CFLAGS and /ipc/chromium/chromium-config.mozbuild from ffmpeg58/moz.build
- Build ffvpx with vaapi support at ffvpx/moz.build
- Move gfx related headers from DMABUFSurfaceImage.h to DMABUFSurfaceImage.cpp and implement
  the gfx methods there.
- Remove GL headers from DMABufSurface.h and forward declare GLuint/GLContext there.
- Move mutex/MessageLoop/task related headers from nsWaylandDisplay.h to nsWaylandDisplay.cpp.
- Move mozva.cpp to mozva.c due to linking issues

Depends on D90556

Differential Revision: https://phabricator.services.mozilla.com/D90557
2020-12-08 15:26:09 +00:00
Butkovits Atila
6772473e85 Backed out 4 changesets (bug 1660336) for causing build bustage on libmozavcodec.so. CLOSED TREE
Backed out changeset 13936ff79b4c (bug 1660336)
Backed out changeset 7315e7b327f7 (bug 1660336)
Backed out changeset b6ca98c5a3cc (bug 1660336)
Backed out changeset fb8fee4471de (bug 1660336)
2020-12-04 12:40:28 +02:00
Martin Stransky
ae3e1f1aac Bug 1660336 Build ffvpx FFmpegVideoDecoder module with VAAPI support, r=jya,glandium,jgilbert
- Remove MOZ_WAYLAND_CFLAGS and /ipc/chromium/chromium-config.mozbuild from ffmpeg58/moz.build
- Build ffvpx with vaapi support at ffvpx/moz.build
- Move gfx related headers from DMABUFSurfaceImage.h to DMABUFSurfaceImage.cpp and implement
  the gfx methods there.
- Remove GL headers from DMABufSurface.h and forward declare GLuint/GLContext there.
- Move mutex/MessageLoop/task related headers from nsWaylandDisplay.h to nsWaylandDisplay.cpp.

Depends on D90556

Differential Revision: https://phabricator.services.mozilla.com/D90557
2020-12-04 09:41:46 +00:00
Razvan Maries
4d377757b2 Backed out 6 changesets (bug 1660336) for multiple perma failures. CLOSED TREE
Backed out changeset 0f7b1edcd999 (bug 1660336)
Backed out changeset b43bed57327d (bug 1660336)
Backed out changeset 6c74e8eef334 (bug 1660336)
Backed out changeset 5575575cc0c4 (bug 1660336)
Backed out changeset 6fb988919317 (bug 1660336)
Backed out changeset 04056b5c72d9 (bug 1660336)
2020-11-29 01:11:43 +02:00
Martin Stransky
d27e30a0c9 Bug 1660336 Build ffvpx FFmpegVideoDecoder module with VAAPI support, r=jya,glandium,jgilbert
- Remove MOZ_WAYLAND_CFLAGS and /ipc/chromium/chromium-config.mozbuild from ffmpeg58/moz.build
- Build ffvpx with vaapi support at ffvpx/moz.build
- Move gfx related headers from DMABUFSurfaceImage.h to DMABUFSurfaceImage.cpp and implement
  the gfx methods there.
- Remove GL headers from DMABufSurface.h and forward declare GLuint/GLContext there.
- Move mutex/MessageLoop/task related headers from nsWaylandDisplay.h to nsWaylandDisplay.cpp.

Differential Revision: https://phabricator.services.mozilla.com/D90557
2020-11-28 09:45:21 +00:00
Csoregi Natalia
3bbe4dde1f Backed out 6 changesets (bug 1660336) for causing media related failures. CLOSED TREE
Backed out changeset 1aa6c9d65403 (bug 1660336)
Backed out changeset f1dadb052d3a (bug 1660336)
Backed out changeset bdf9d27bd4d2 (bug 1660336)
Backed out changeset 373a658bb281 (bug 1660336)
Backed out changeset 5ccda5ab6563 (bug 1660336)
Backed out changeset e6f396b25887 (bug 1660336)
2020-11-27 05:08:40 +02:00
Martin Stransky
24a4ddcc49 Bug 1660336 Build ffvpx FFmpegVideoDecoder module with VAAPI support, r=jya
- Remove MOZ_WAYLAND_CFLAGS and /ipc/chromium/chromium-config.mozbuild from ffmpeg58/moz.build
- Build ffvpx with vaapi support at ffvpx/moz.build
- Move gfx related headers from DMABUFSurfaceImage.h to DMABUFSurfaceImage.cpp and implement
  the gfx methods there.
- Remove GL headers from DMABufSurface.h and forward declare GLuint/GLContext there.
- Move mutex/MessageLoop/task related headers from nsWaylandDisplay.h to nsWaylandDisplay.cpp.

Differential Revision: https://phabricator.services.mozilla.com/D90557

Depends on D90556
2020-11-26 21:25:52 +00:00
stransky
1f80023b70 Bug 1675453 [Wayland] Include DMABufLibWrapper.h in nsWaylandDisplay.h header and update wayland headers, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D95992
2020-11-06 14:13:20 +00:00
Robert Mader
71f8bab55f Bug 1667674 - [Wayland] Support public primary-selection unstable protocol. r=stransky
This is required to support pasting the primary selection into Firefox on compositors only
supporting the public protocol, such as KWin. Getting the selection *from* Firefox is done
via GTK and will be supported from GTK 3.24.23 on.

The public protocol, while practically identical, will replace the gtk-private one eventually.
However, support for the private one will still be needed for a while.

Note: this also updates the auto-generated gtk-primary-selection files.

Differential Revision: https://phabricator.services.mozilla.com/D91594
2020-10-02 09:13:06 +00:00
Narcis Beleuzu
c3f877ffe4 Backed out changeset 499103fc4ccb (bug 1667674) for bc failures on browser_aboutCertError_offlineSupport.js . CLOSED TREE 2020-09-30 21:50:27 +03:00
stransky
3ee15b3859 Bug 1664911 [Wayland] Use DRM modifiers for WebGL surfaces, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D90168
2020-09-30 13:14:05 +00:00
Robert Mader
8397a4676b Bug 1667674 - [Wayland] Support public primary-selection unstable protocol. r=stransky
This is required to support pasting the primary selection into Firefox on compositors only
supporting the public protocol, such as KWin. Getting the selection *from* Firefox is done
via GTK and will be supported from GTK 3.24.23 on.

The public protocol, while practically identical, will replace the gtk-private one eventually.
However, support for the private one will still be needed for a while.

Note: this also updates the auto-generated gtk-primary-selection files.

Differential Revision: https://phabricator.services.mozilla.com/D91594
2020-09-30 12:35:49 +00:00
Butkovits Atila
1c3507c950 Backed out changeset 9811cad69b2c (bug 1664911) for causing build bustage on nsWaylandDisplay.h. CLOSED TREE 2020-09-29 14:47:26 +03:00
stransky
d14d6c3e76 Bug 1664911 [Wayland] Use DRM modifiers for WebGL surfaces, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D90168
2020-09-29 09:32:54 +00:00
stransky
77af5a272b Bug 1662425 [Wayland] Create nsWaylandDisplay as ref counted, r=jhorak
- Create nsWaylandDisplay as a ref-counted struct to avoid potential delete when a display is used.
- Don't use Mutex to access all display array operations. Use only write mutex when the array is modified / released.
- Store all wayland displays in nsTArray instead of fixed plain C array.
- Release all displays before we close Gtk display to make sure we quit before Gtk connections are closed.

Differential Revision: https://phabricator.services.mozilla.com/D89188
2020-09-04 10:54:49 +00:00
Jan Alexander Steffens (heftig)
b8594b12d2 Bug 1648872 - Add WaylandRegistryBind, a portable wl_registry_bind. r=stransky
Differential Revision: https://phabricator.services.mozilla.com/D89219
2020-09-03 19:05:48 +00:00
Brindusan Cristian
678576577a Backed out changeset 00a41c5183d7 (bug 1662425) for linux leakcheck failures. CLOSED TREE 2020-09-03 17:15:01 +03:00
stransky
333b3cf8ca Bug 1662425 [Wayland] Create nsWaylandDisplay as ref counted, r=jhorak
- Create nsWaylandDisplay as a ref-counted struct to avoid potential delete when a display is used.
- Don't use Mutex to access all display array operations. Use only write mutex when the array is modified / released.
- Store all wayland displays in nsTArray instead of fixed plain C array.
- Release all displays before we close Gtk display to make sure we quit before Gtk connections are closed.

Differential Revision: https://phabricator.services.mozilla.com/D89188
2020-09-03 13:30:30 +00:00
Brindusan Cristian
1d151de974 Backed out changeset 6a8ca967e963 (bug 1648872) for linux build bustages at nsWaylandDisplay.h. CLOSED TREE 2020-09-03 12:31:14 +03:00
Jan Alexander Steffens (heftig)
da2b882fed Bug 1648872 - Add WaylandRegistryBind, a portable wl_registry_bind. r=stransky
Differential Revision: https://phabricator.services.mozilla.com/D89219
2020-09-03 09:14:42 +00:00
Robert Mader
1e96614739 Bug 1654687 - Remove some more GTK3-version related checks, r=stransky
They are all present since 3.8. Also bumb a version check.

Differential Revision: https://phabricator.services.mozilla.com/D84899
2020-07-26 13:20:13 +00:00
Martin Stransky
f13a78bbb2 Bug 1655026 [Linux] Move dmabuf format setup from nsWaylandDisplay to nsDMABufDevice, r=rmader
Migrate DRM pixel format setup from nsWaylandDiplay to nsDMABufDevice so we don't need nsWaylandDisplay connection
to create a dmabuf surface.

It reduces wayland display connections, saves resources and allows to create dmabuf surfaces on X11 EGL config.

Differential Revision: https://phabricator.services.mozilla.com/D84900
2020-07-26 13:02:56 +00:00
Martin Stransky
8fc11cb1ca Bug 1645734 [Wayland] Move gbm library interface from nsWaylandDisplay, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D79695
2020-06-23 06:27:09 +00:00
Martin Stransky
48eab6d50c Bug 1629788 [Wayland] Add widget.wayland-dmabuf-video-textures.enabled preference, r=jhorak
- widget.wayland-dmabuf-video-textures.enabled controls dmabuf texture backend for decoded video frames.

Differential Revision: https://phabricator.services.mozilla.com/D78293
2020-06-13 18:38:45 +00:00
Bogdan Tara
f3d007c8fd Backed out 3 changesets (bug 1629788) for WaylandDMABufSurface.cpp related bustages CLOSED TREE
Backed out changeset 31fba4d1fe1d (bug 1629788)
Backed out changeset 9d1e4da287a6 (bug 1629788)
Backed out changeset 23791ccf64dd (bug 1629788)
2020-06-13 13:56:04 +03:00