Skip to content

Draft: Modifiers support with dev_t render device passed as argument

This adds support for explicit modifiers with the strategy of passing the render device as argument to various wayland_dmabuf public functions.

(In general, the conventions I follow is for public functions to start with (for example for dmabuf) wayland_dmabuf_*, and have private functions be dmabuf_*).

Changes in this version include:

  • Change in wayland_gbm module the exported wayland_gbm_get_dev_t() to wayland_gbm_get_render_dev(), which in turn calls the internal gbm_get_dev_t().
  • Change in wayland_dmabuf the signature of the public function to get the modifiers: from uint_64 *wayland_dmabuf_get_format_modifiers() to size_t wayland_dmabuf_get_format_modifiers(..., **modifiers). This way we get both the size of the modifiers and the pointer.
  • Add fail checks in wayland_gl_drawable_update() (goto out).
  • Add internal dmabuf_has_feedback_support().
  • Add struct wayland_dmabuf_feedback_tranche *owning_tranche field to struct wayland_dmabuf_format. We can now reuse dmabuf_format_get_dmabuf_format_from_optimal_tranche(), which we call from various public functions and returns a wayland_dmabuf_format, for returning various information to the caller.
  • Add struct wayland_dmabuf_feedback *owning_feedback to each tranche. Now we don't have to (awkwardly) pass the main device to dmabuf_feedback_get_tranche_priority().
  • Add BOOL wayland_dmabuf_is_device_scanoutable(), which internally follows the same logic as wayland_dmabuf_get_format_modifiers(), reusing the code from dmabuf_format_get_dmabuf_format_from_optimal_tranche().

Merge request reports