Implement wp_linux_dmabuf_feedback
Categories
(Core :: Widget: Gtk, enhancement)
Tracking
()
Tracking | Status | |
---|---|---|
firefox136 | --- | fixed |
People
(Reporter: rmader, Assigned: stransky)
References
(Blocks 2 open bugs)
Details
Attachments
(6 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 |
See https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/8
This protocol should help us with buffer modifier decisions, especially regarding direct scanout, overlay planes and also multi-gpu cases.
Updated•4 years ago
|
Updated•4 years ago
|
Reporter | ||
Comment 1•4 years ago
|
||
See https://gitlab.freedesktop.org/wayland/weston/-/blob/main/clients/simple-dmabuf-feedback.c for a code example.
Reporter | ||
Comment 2•4 years ago
|
||
We just merged feedback support for Mutter 42, see https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1959. There's still some follow up work necessary to make it work for subsurfaces, but I have a local patch already applied and working.
With this in place, it's becoming interesting for Firefox: if we manage to implement it right, it should allow us to scan out WR tiles directly. For (hardware decoded) video this means we'll only do one copy (while also running the YUV -> RGB shader), which is already pretty good. The final step then is bug 1711461, which in some cases should allow us to scanout YUV buffers directly. But that is very hardware and decoder specific, in many cases we'll still need to do format conversion, i.e. do one copy (either in Firefox or the Wayland compositor).
Assignee | ||
Comment 3•9 months ago
|
||
Will look at it as we need to for HDR support.
Assignee | ||
Updated•9 months ago
|
Assignee | ||
Updated•9 months ago
|
Assignee | ||
Updated•6 months ago
|
Assignee | ||
Comment 4•6 months ago
|
||
Assignee | ||
Comment 5•6 months ago
|
||
Assignee | ||
Comment 6•6 months ago
|
||
- Remove DMABuf formats query from DMABufLibWrapper, us nsWaylandDisplay to get global dmabuf formats
- Query GBMLib for CreateWithModifiers2 and export it to allow DMABuf creation with modifers and flags
Assignee | ||
Comment 7•6 months ago
|
||
- Replace GbmFormat with DRMFormat and allow to create DMABuf surface with given format
- Use CreateWithModifiers2() to create DMABuf surface with format, modifier and use flag
- Use all layers / planes of RGBA surface to create wl_buffer
- Remove wl_buffer ownership from DMABufSurface as one DMABuf surface can have multiple wl_buffers created over it
Assignee | ||
Comment 9•6 months ago
|
||
- Use DRMFormat directly to create DMABuf based wl_buffer
- Use correct DMABuf flags to create it
- Move ownership of wl_buffer from DMABufSurface to WaylandBuffer as multiple WaylandBuffers may use the same DMABufSurface.
Assignee | ||
Comment 10•6 months ago
|
||
Comment 11•6 months ago
|
||
Comment 12•6 months ago
|
||
Backed out for causing build bustages & mass failures @ DMABufFormats.h
Backout link: https://hg.mozilla.org/integration/autoland/rev/6e5dcbc6576e03e589810dc3a95dd2ac0dff3688
INFO - In file included from /builds/worker/checkouts/gecko/widget/gtk/DMABufLibWrapper.h:13:
[task 2025-01-17T21:35:15.696Z] 21:35:15 ERROR - /builds/worker/workspace/obj-build/dist/include/mozilla/widget/DMABufFormats.h:32:37: error: no template named 'nsTArray'
[task 2025-01-17T21:35:15.696Z] 21:35:15 INFO - 32 | DRMFormat(uint32_t aFormat, const nsTArray<uint64_t>& aModifiers)
[task 2025-01-17T21:35:15.697Z] 21:35:15 INFO - | ^
[task 2025-01-17T21:35:15.697Z] 21:35:15 ERROR - /builds/worker/workspace/obj-build/dist/include/mozilla/widget/DMABufFormats.h:50:3: error: no template named 'nsTArray'
[task 2025-01-17T21:35:15.697Z] 21:35:15 INFO - 50 | nsTArray<uint64_t>* GetModifiers() { return &mModifiers; }
[task 2025-01-17T21:35:15.697Z] 21:35:15 INFO - | ^
[task 2025-01-17T21:35:15.698Z] 21:35:15 ERROR - /builds/worker/workspace/obj-build/dist/include/mozilla/widget/DMABufFormats.h:56:3: error: no template named 'AutoTArray'
[task 2025-01-17T21:35:15.698Z] 21:35:15 INFO - 56 | AutoTArray<uint64_t, 15> mModifiers;
[task 2025-01-17T21:35:15.698Z] 21:35:15 INFO - | ^
[task 2025-01-17T21:35:15.698Z] 21:35:15 ERROR - /builds/worker/checkouts/gecko/widget/gtk/DMABufFormats.cpp:346:8: error: use of undeclared identifier 'WaylandDisplayGet'
[task 2025-01-17T21:35:15.698Z] 21:35:15 INFO - 346 | if (!WaylandDisplayGet()->HasDMABufFeedback()) {
[task 2025-01-17T21:35:15.698Z] 21:35:15 INFO - | ^
[task 2025-01-17T21:35:15.698Z] 21:35:15 ERROR - /builds/worker/checkouts/gecko/widget/gtk/DMABufFormats.cpp:350:25: error: use of undeclared identifier 'WaylandDisplayGet'
[task 2025-01-17T21:35:15.698Z] 21:35:15 INFO - 350 | formats->InitFeedback(WaylandDisplayGet()->GetDmabuf(), aFormatRefreshCB,
[task 2025-01-17T21:35:15.698Z] 21:35:15 INFO - | ^
[task 2025-01-17T21:35:15.698Z] 21:35:15 INFO - In file included from /builds/worker/checkouts/gecko/widget/gtk/DMABufFormats.cpp:8:
[task 2025-01-17T21:35:15.698Z] 21:35:15 INFO - In file included from /builds/worker/checkouts/gecko/widget/gtk/DMABufLibWrapper.h:13:
[task 2025-01-17T21:35:15.698Z] 21:35:15 ERROR - /builds/worker/workspace/obj-build/dist/include/mozilla/widget/DMABufFormats.h:56:28: error: private field 'mModifiers' is not used [-Werror,-Wunused-private-field]
[task 2025-01-17T21:35:15.698Z] 21:35:15 INFO - 56 | AutoTArray<uint64_t, 15> mModifiers;
[task 2025-01-17T21:35:15.698Z] 21:35:15 INFO - | ^
[task 2025-01-17T21:35:15.698Z] 21:35:15 INFO - 6 errors generated.
[task 2025-01-17T21:35:15.698Z] 21:35:15 ERROR - gmake[4]: *** [/builds/worker/checkouts/gecko/config/rules.mk:675: DMABufFormats.o] Error 1
[task 2025-01-17T21:35:15.698Z] 21:35:15 INFO - gmake[4]: Leaving directory '/builds/worker/workspace/obj-build/widget/gtk'
Comment 14•6 months ago
|
||
Comment 15•6 months ago
|
||
Backed out for causing assertion failures @ DMABufFormats.cpp
Backout link: https://hg.mozilla.org/integration/autoland/rev/9341c53bf8ec9ed822d30eea8142beae91f96790
Updated•6 months ago
|
Assignee | ||
Comment 16•6 months ago
|
||
Interesting, Thanks. Looks like Wayland compositor on Mozilla testsuite declares dmabuf feedback v3 support but doesn't send us any data. Will make the patch more error prone.
Comment 17•6 months ago
|
||
Assignee | ||
Updated•6 months ago
|
Comment 18•6 months ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/112b85a7d375
https://hg.mozilla.org/mozilla-central/rev/22095c083641
https://hg.mozilla.org/mozilla-central/rev/93cc1cfa32d4
https://hg.mozilla.org/mozilla-central/rev/96677fcedaad
https://hg.mozilla.org/mozilla-central/rev/8d97555405a4
https://hg.mozilla.org/mozilla-central/rev/8aea352dbf15
Description
•