render/pixman: Add dmabuf support

Adds linux-dmabuf support to the pixman renderer.  The main reason is so
clients can use GPU-accelerated rendering even if the compositor is
using the pixman renderer for whatever reason.  This also allows the
pixman renderer to import dmabufs (only RGB/ARGB formats, not YUV for
now).

Since after this change all renderers store a DRM FD, I move the drm_fd
from the individual implementations to the shared wlr_renderer base.
This means that renderer_autocreate() can set pixman's drm_fd for it and
the pixman renderer doesn't have to know about DRM at all.

Originally based on
961edfe44e
This commit is contained in:
David Turner 2024-06-10 17:10:20 +01:00
parent 27bbb91abf
commit e4ccc8e822
10 changed files with 36 additions and 42 deletions

View file

@ -25,7 +25,6 @@ struct wlr_renderer_impl {
const struct wlr_drm_format_set *(*get_render_formats)(
struct wlr_renderer *renderer);
void (*destroy)(struct wlr_renderer *renderer);
int (*get_drm_fd)(struct wlr_renderer *renderer);
struct wlr_texture *(*texture_from_buffer)(struct wlr_renderer *renderer,
struct wlr_buffer *buffer);
struct wlr_render_pass *(*begin_buffer_pass)(struct wlr_renderer *renderer,

View file

@ -13,7 +13,6 @@
#include <wlr/render/wlr_renderer.h>
struct wlr_renderer *wlr_pixman_renderer_create(void);
bool wlr_renderer_is_pixman(struct wlr_renderer *wlr_renderer);
bool wlr_texture_is_pixman(struct wlr_texture *texture);

View file

@ -55,6 +55,7 @@ struct wlr_renderer {
struct {
const struct wlr_renderer_impl *impl;
int drm_fd;
} WLR_PRIVATE;
};