Closed Bug 1552590 Opened 3 months ago Closed 3 days ago

[Wayland] Implement basic Wayland dmabuf surface support

Categories

(Core :: Graphics, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
Tracking Status
firefox68 --- affected

People

(Reporter: stransky, Assigned: stransky)

References

(Blocks 3 open bugs)

Details

Attachments

(1 file, 2 obsolete files)

Wayland dmabuf surface are located in GPU and can be attached as EGLImage or wl_buffer. It allows direct rendering to GPU and share the HW buffer across processes.

Attached patch WIP patch (obsolete) — Splinter Review

WIP patch

For me build fails with

15:31.86 mozilla-unified/obj-x86_64-pc-linux-gnu/dist/include/mozilla/widget/nsWaylandDisplay.h:19:12: fatal error: 'drm/drm_fourcc.h' file not found
15:31.86 #  include <drm/drm_fourcc.h>
15:31.86            ^~~~~~~~~~~~~~~~~~

Same for mozilla-unified/gfx/2d/WaylandSurface.cpp

On Arch Linux.

Replacing drm with libdrm fixes the compilation issue (result not tested yet though).

(In reply to Francois Guerraz from comment #2)

For me build fails with

mozilla-unified/gfx/2d/WaylandSurface.cpp:10:
15:31.86
mozilla-unified/obj-x86_64-pc-linux-gnu/dist/include/mozilla/widget/
nsWaylandDisplay.h:19:12: fatal error: 'drm/drm_fourcc.h' file not found
15:31.86 #  include <drm/drm_fourcc.h>
15:31.86            ^~~~~~~~~~~~~~~~~~

It's really wip and don't expect anything from it right now.

always happy to test new cool features / optimizations :-)

I've been running it for a few hours, I don't know if the code path is used anywhere yet, but I didn't notice any problem. Let us know when there is something to expect from it.

Attached patch WIP v.2 (obsolete) — Splinter Review

Use DMAbuf as a Wayland backend. Not finished/polished yet.

Attachment #9065805 - Attachment is obsolete: true

Not sure this is useful feedback because you probably know about it already. It's working but it's really really slow and I get a lot of

Hard copy 3200 x 1746 -> 22348800```
Type: defect → enhancement
Attached patch patchSplinter Review

Working patch, uses DMABuf as Wayland backend if gfx.wayland_dmabuf_backend.enabled is set to true.

Attachment #9066388 - Attachment is obsolete: true
Depends on: 1554517
Depends on: 1554520
Depends on: 1554522
Depends on: 1554525

I have not tried the individual patches, but the latest unified one with gfx.wayland_dmabuf_backend.enabled and no odd behaviour so far, slowdown is gone.

I don't know if it's related, but I got this: bp-17143081-1ae6-4a48-8f2f-d79820190528 ... probably not super helpful backtrace.

Depends on: 1557265
Depends on: 1557266
Priority: -- → P2
Depends on: 1557658
Depends on: 1557662
Depends on: 1560545
Depends on: 1561512

When the feature is enabled, is there any visibility in about:support ? How do we know it's working/enabled?

(In reply to Francois Guerraz from comment #10)

When the feature is enabled, is there any visibility in about:support ? How
do we know it's working/enabled?

No, there's no evidence is enabled right now :) We should address that.

(In reply to Francois Guerraz from comment #10)

When the feature is enabled, is there any visibility in about:support ? How
do we know it's working/enabled?

Filed as Bug 1561859.

Depends on: 1562023

Is this also required (or beneficial) for hardware video decoding (bug 1210726)? In that case, should we mark it as blocker?

Could this help with terrible performance in situations like fishbowl benchmark? (W10: FF and Chrome ~60fps, Linux: Chrome 60fps, FF 7fps)

(In reply to mthw0 from comment #14)

Could this help with terrible performance in situations like fishbowl benchmark? (W10: FF and Chrome ~60fps, Linux: Chrome 60fps, FF 7fps)

This is Bug 1572697.
This one can be closed as basic dmabuf support landed.

Status: NEW → RESOLVED
Closed: 3 days ago
Resolution: --- → FIXED
Summary: [Wayland] Implement Wayland dmabuf surface → [Wayland] Implement basic Wayland dmabuf surface support
Blocks: 1572697
You need to log in before you can comment on or make changes to this bug.