Bug 271823 - x11-wm/mutter: enable DMA_BUF_SYNC support
Summary: x11-wm/mutter: enable DMA_BUF_SYNC support
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-gnome (Nobody)
URL:
Keywords: feature
Depends on:
Blocks:
 
Reported: 2023-06-04 19:19 UTC by Jan Beich
Modified: 2025-06-11 07:13 UTC (History)
4 users (show)

See Also:
vishwin: maintainer-feedback+


Attachments
v1 (apply via "git am") (10.06 KB, patch)
2023-06-04 19:19 UTC, Jan Beich
no flags Details | Diff
v1 (apply via "git am") (6.42 KB, patch)
2023-06-04 20:00 UTC, Jan Beich
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Beich freebsd_committer freebsd_triage 2023-06-04 19:19:30 UTC
Created attachment 242594 [details]
v1 (apply via "git am")

Instead of patching out DMABUF support due to missing <linux/dma-buf.h> bundle the version from pending DRM KPI. Similar to https://gitlab.freedesktop.org/mesa/mesa/-/blob/main/include/drm-uapi/dma-buf.h

Tested under Xwayland (rootful) e.g.,

$ pkg install mutter cage mpv libva-intel-driver
$ export XDG_RUNTIME_DIR=${XDG_RUNTIME_DIR=/tmp}
$ seatd-launch cage Xwayland -retro :3 &
$ export DISPLAY=:3
$ unset WAYLAND_DISPLAY XDG_SESSION_TYPE
$ mutter &
$ mpv --hwdec=vaapi --gpu-api=vulkan foo.mp4
Comment 1 Jan Beich freebsd_committer freebsd_triage 2023-06-04 19:37:10 UTC
Comment on attachment 242594 [details]
v1 (apply via "git am")

Oops, I've accidentally dropped more OpenBSD cargo cult than necessary. FreeBSD supports evdev (and libgudev), so no need to disable <linux/input-event-codes.h> provided by devel/evdev-proto.
Comment 2 Jan Beich freebsd_committer freebsd_triage 2023-06-04 20:00:10 UTC
Created attachment 242597 [details]
v1 (apply via "git am")

Moved unrelated evdev bits to bug 271824.
Comment 3 Graham Perrin freebsd_committer freebsd_triage 2023-06-05 00:38:38 UTC
^Triage: keyword, status.  

(Not normally 'in progress' without an individual assignee, I think we might be fairly relaxed in cases such as this.)

And, thanks …
Comment 4 Charlie Li freebsd_committer freebsd_triage 2023-06-05 13:25:22 UTC
There has not been any deeper evaluation on this yet, so not in progress at this time. Setting maintainer-feedback solely to avoid timeout, however.
Comment 5 Jan Beich freebsd_committer freebsd_triage 2023-06-19 21:14:02 UTC
Restoring maintainer flag. According to "git log" vishwin@ never contributed to *current* gnome@ ports, let alone x11-wm/mutter. gnome@ doesn't upstream its patches, fails to keep up-to-date, and the last active contributor gave up. Leeching on gnome@ work via consumers doesn't help with maintenance.
Comment 6 Jan Beich freebsd_committer freebsd_triage 2023-06-19 21:44:48 UTC
(In reply to Jan Beich from comment #5)
Sorry, my "git log" stuck due to a long list of ports. Ignoring Cinnamon being dumped on gnome@ I've found ports 15b039e28bc1 which looks recent. The rest still stands.

Note, I don't plan to land this per timeout without testing OpenGL compositing in GNOME/X11 as DE (instead of standalone Mutter). Bug 258042 was sitting in queue for a similar reason. Testing DEs is hard e.g., requires filtering existing brokeness against new regressions.
Comment 7 Charlie Li freebsd_committer freebsd_triage 2023-06-19 22:44:27 UTC
(In reply to Jan Beich from comment #5)
No. You don't get to restore a question-mark maintainer-feedback flag so you can get it to time out faster. Also consider that some gnome@/desktop@ WIPs are not entirely "public" on project spaces for reasons, and I have a laundry list of them. Furthermore, work, to unbreak, update or anywhere in between, on more foundational puzzle pieces can interfere with "leafy" stuff, but they need to get done.

Upstreaming is a personal priority. Consider that the work will get done when it gets done, and many times in desktop-land, cannot be done as isolated/discrete components.

(In reply to Jan Beich from comment #6)
Cinnamon has practically always been a gnome@ property. But that's getting a bit off-topic for this bug.
Comment 8 Olivier Duchateau 2023-06-24 14:43:50 UTC
Patch tested with mutter 43.6 (with GDK backend x11 enabled) on the Pantheon desktop.

Below an excerpt of .xsession-errors

>libmutter-Message: 16:21:35.034: Running Mutter(Gala) (using mutter 43.6) as a X11 window and compositing manager
>Window manager warning: Trying to re-add keybinding "switch-to-workspace-last".
>Window manager warning: Trying to re-add keybinding "move-to-workspace-last".
> 
>(gala:1381): libmutter-WARNING **: 16:21:37.125: Failed to query property: no udev support

I'm planning to test it with GNOME 44 and mutter 44.2.
Comment 9 Jan Beich freebsd_committer freebsd_triage 2023-06-25 11:28:59 UTC
(In reply to Olivier Duchateau from comment #8)
> Patch tested with mutter 43.6 (with GDK backend x11 enabled) on the Pantheon desktop.

Thanks. If partial screen updates didn't glitch then it's probably fine. Broken DMA_BUF_SYNC should fall back to the old behavior.

See also
https://gitlab.gnome.org/GNOME/mutter/-/commit/c2c4f749230c
https://github.com/FreeBSDDesktop/kms-drm/issues/156
Comment 10 Olivier Duchateau 2023-12-27 15:56:25 UTC
Patch is fine with GNOME 44 (tested with mutter from 44.4 to 44.7) and GNOME 45 (with mutter 45.1 and mutter 45.2).
Comment 11 Jan Beich freebsd_committer freebsd_triage 2024-01-17 03:38:22 UTC
mutter >= 46 will need expanding bundled ioctl macros to cover sync_file. Still optional at runtime to support older Linux kernels.

https://gitlab.gnome.org/GNOME/mutter/-/commit/c47730894e12
https://github.com/freebsd/drm-kmod/issues/278
Comment 12 commit-hook freebsd_committer freebsd_triage 2025-06-10 13:52:58 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=2e75d18c1b26de6d114efbc19647cb4326bb914f

commit 2e75d18c1b26de6d114efbc19647cb4326bb914f
Author:     Olivier Duchateau <duchateau.olivier@gmail.com>
AuthorDate: 2025-06-10 13:27:33 +0000
Commit:     Baptiste Daroussin <bapt@FreeBSD.org>
CommitDate: 2025-06-10 13:46:21 +0000

    x11-wm/mutter: update to 47.8.1

    - enable evdev/udev support
    - enable DMA_BUF_SYNC
    - expose nested wayland support

    PR:     286697, 271824, 271823, 258042

 x11-wm/mutter/Makefile                             |  67 +--
 x11-wm/mutter/distinfo                             |   6 +-
 ...tch-clutter_clutter_clutter-stage-view.c (gone) |  58 ---
 .../files/patch-cogl_cogl_cogl-dma-buf-handle.c    |  45 +-
 .../patch-cogl_cogl_cogl-dma-buf-handle.h (gone)   |  22 -
 ...c_backends_x11_meta-input-settings-x11.c (gone) |  39 --
 .../patch-src_backends_x11_meta-seat-x11.c (gone)  |  44 --
 x11-wm/mutter/pkg-descr                            |  13 +-
 x11-wm/mutter/pkg-plist                            | 473 ++++++++++-----------
 9 files changed, 304 insertions(+), 463 deletions(-)
Comment 13 Baptiste Daroussin freebsd_committer freebsd_triage 2025-06-11 07:13:02 UTC
286697