Commit Graph
18 Commits
Author SHA1 Message Date
Emmanuel Gil Peyrot 0279c0f07d path-unix: only accept absolute paths
The XDG Base Directory specification says “All paths set in these
environment variables must be absolute. If an implementation encounters
a relative path in any of these variables it should consider the path
invalid and ignore it.”
2026-07-02 17:36:50 +00:00
Emmanuel Gil Peyrot 6083cf13f2 wayland: fix displaying non-subsampled formats
Fix regression introduced in 90e3e104d9,
where all non-chroma subsampled formats (e.g. rgb8 or yuv444p) will
trigger a protocol error and get disconnected by the compositor due to
setting the chroma location on the color representation object.

GNOME-Shell 49 will emit this protocol error otherwise:
```
wp_color_representation_surface_v1#54: error 3: Commit contains a color representation with chroma location set and a buffer with a pixel format which is not 4:2:0 subsampled
```

How to reproduce:
- Run gnome-shell 49
- Run `mpv --vo=dmabuf-wayland some-image.png`
2025-10-06 22:00:30 +00:00
Emmanuel Gil Peyrot 4c885905e7 img_format: add a helper to determine if chroma is 4:2:0 subsampled
Only YUV formats which are subsampled once in both width and height will
return true (so for instance NV12 or P010), other formats will return
false.
2025-10-06 22:00:30 +00:00
Emmanuel Gil Peyrot 666cb91cf1 wayland: bump dmabuf protocol to version 4
Pulled from https://github.com/mpv-player/mpv/pull/10382

The zwp_linux_dmabuf_v1 protocol version 4 provides a file descriptor
containing both formats and modifiers, which makes it possible for the
compositor to import the buffers onto planes using explicit modifiers.

This is an extremely important efficiency improvement, as the 3D
hardware can be left powered off altogether, the vaapi buffer being sent
directly from the video hardware to the display controller.

It could be possible to support zwp_linux_dmabuf_v1 version 3 as well,
but there is no reason beyond compatibility with old stacks.  I would
recommend to ditch version 2 as well, as modifier-less formats aren’t
very useful nowadays.
2022-10-26 18:41:47 +00:00
Emmanuel Gil Peyrot d2467f61be wayland: add missing newline in wayland_common 2022-07-23 19:56:48 +00:00
Emmanuel Gil Peyrot f8a9654873 vo_wlshm: support big endian systems
The video was otherwise blue, and that’s not how it should be. :)
2021-02-04 21:13:09 +02:00
Emmanuel Gil Peyrot 5f2b60a645 vd_lavc: add VP8 to the default allowed hwdec codec list
It is supported at least on Intel, from gen8 to gen11, and still gives a
pretty welcome reduction of CPU usage on my gen9.
2020-12-30 17:30:01 +02:00
Emmanuel Gil Peyrot a832c22dac build: disable wayland if linux/input-event-codes.h isn’t available
The wl_pointer interface defines button argument as “a button code as
defined in the Linux kernel's linux/input-event-codes.h header file,
e.g. BTN_LEFT.”

We could #define these few buttons ourselves, but there is no system to
test it on, so for now let’s disable Wayland support on them.

This is a call to non-Linux system maintainers, please help test this
backend on your system and report issues you find, or even working
state.
2020-10-25 15:59:16 +02:00
Emmanuel Gil Peyrot 007ace76e2 wayland: use more specific input codes header
Wayland’s wl_pointer interface describes the button event’s argument as
being taken from linux/input-event-codes.h, so there is no need to
include the more generic linux/input.h.
2020-10-25 15:59:16 +02:00
linkmauve 322eb72679 OpenGL: Also detect softpipe as a software driver
Because it is.
2020-02-25 21:32:04 +02:00
Emmanuel Gil Peyrot a6000d3114 vo_wlshm: use memfd_create() instead of shm_open()
This syscall avoids the need to guess an unused filename in /dev/shm and
allows seals to be placed on it.  We immediately return if no fd got
returned, as there isn’t anything we can do otherwise.

Seals especially allow the compositor to drop the SIGBUS protections,
since the kernel promises the fd won’t ever shrink.

This removes support for any platform but Linux from this vo.
2019-10-17 19:38:04 +02:00
Emmanuel Gil Peyrot 36600ff163 wayland_common: rename “shell” into “wm_base”
This is the naming xdg-shell stable adopted, it doesn’t make much sense
to keep using “shell” everywhere with all functions calling it
“wm_base”.

Finishes what 76211609e3 started.
2019-02-17 23:44:34 +02:00
Emmanuel Gil Peyrot 76211609e3 wayland_common: update to stable xdg-shell
This removes support for older compositors using the unstable version,
but those will still use Xwayland by default, so not a big loss.
2018-04-29 12:33:12 +03:00
Emmanuel Gil Peyrot 4914e688cf manpage: rename drm-egl to drm. 2016-11-07 18:42:27 +01:00
Emmanuel Gil Peyrot f99e48ae6a wayland: use the advertised size in fullscreen
When we receive the wl_shell_surface::configure event, it makes sense
to respect the aspect ratio of the video in windowed mode, but in
fullscreen it forces compositing and wastes resources (until atomic
modesetting is available everywhere and we can stop having
desynchronised planes).

Weston mitigates a resolution mismatch by creating black surfaces and
compositing them around the fullscreen surface, placed at the middle,
while GNOME puts it at the top-left and leaves the rest of the desktop
composited below, both of them producing a subpar experience.

Fixes #3021, #2657.
2016-05-08 19:47:08 +02:00
Emmanuel Gil Peyrot 87b09a180a wscript: don’t install the encoding profiles with encoding disabled 2016-02-22 20:51:06 +01:00
Emmanuel Gil Peyrot a9ed9e329c vo_opengl: remove leftover variable from vaglx in vaegl
This was preventing compilation on systems without X11 headers.
2015-10-02 03:49:02 +01:00
Emmanuel Gil Peyrot 8a21cb1cd3 vo: fix compilation failure when vaapi is enabled and x11 disabled
This was previously trying to use the video_output_vaapi symbol despite
vo_vaapi.c being guarded by the vaapi-x11 option.
2015-10-02 03:21:51 +01:00