Skip to content

WIP: Initial dmabuf hints support

Scott Anderson requested to merge ascent/weston:dmabuf-hints into main

WIP because it relies on wayland-protocols!8 (merged). It also assumes primary_device sends a string of ID_PATH_TAG, rather than a file descriptor. See wayland-protocols#10 (closed).

struct weston_hint

A basic container type for hints, which contains a device and some formats (see below). A compositor-wide default hints exists, and well as one per surface. This PR currently only sets default hints, and no per-surface hints are currently sent.

struct weston_format

This is a type that is just a format+modifier pair that also has a preference associated with it, which becomes the dmabuf-hint tranches. Currently only the renderer sets these formats, and everything ends up as the same priority. Future work would be to modify the DRM backend (and possibly others) to add formats that could be scanned out as a higher priority than the renderer formats.

A possible priority could be

  1. Formats than can be scanned out
  2. Formats that the driver supports natively (eglQueryDmaBufFormatsEXT)
  3. Formats that weston has a renderer fallback for (e.g. some of the YUV formats)

The implementation is fairly basic. I don't know if something more elaborate is wanted/required.

This is somewhat redundant with the query_dmabuf_formats and query_dmabuf_modifiers renderer functions which also gets used by linux-dmabuf. Perhaps we want to change the normal format/modifier event to use this new format and deprecate/remove these functions.

EGL devices

This makes use of EGL_EXT_device_drm to get the DRM device, and works across all backends that the GL renderer supports. This takes some commits from !348 (closed).

weston-simple-dmabuf-egl

This was updated to now use dmabuf-hints to select its rendering device, and adds libudev as a new dependency for it. It doesn't make use of any format hints yet.

Merge request reports

Loading