mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-04-14 08:22:25 -04:00
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:
parent
27bbb91abf
commit
e4ccc8e822
10 changed files with 36 additions and 42 deletions
|
|
@ -267,6 +267,14 @@ static struct wlr_renderer *renderer_autocreate(struct wlr_backend *backend, int
|
|||
|
||||
if ((is_auto && !has_render_node(backend)) || strcmp(renderer_name, "pixman") == 0) {
|
||||
renderer = wlr_pixman_renderer_create();
|
||||
if (open_preferred_drm_fd(backend, &drm_fd, &own_drm_fd)) {
|
||||
wlr_log(WLR_DEBUG, "Creating pixman renderer with DRM FD %d", drm_fd);
|
||||
renderer->drm_fd = drm_fd;
|
||||
} else {
|
||||
wlr_log(WLR_DEBUG, "Creating pixman renderer without DRM");
|
||||
renderer->drm_fd = -1;
|
||||
}
|
||||
|
||||
if (renderer) {
|
||||
goto out;
|
||||
} else {
|
||||
|
|
@ -297,11 +305,8 @@ struct wlr_renderer *wlr_renderer_autocreate(struct wlr_backend *backend) {
|
|||
return renderer_autocreate(backend, -1);
|
||||
}
|
||||
|
||||
int wlr_renderer_get_drm_fd(struct wlr_renderer *r) {
|
||||
if (!r->impl->get_drm_fd) {
|
||||
return -1;
|
||||
}
|
||||
return r->impl->get_drm_fd(r);
|
||||
int wlr_renderer_get_drm_fd(struct wlr_renderer *renderer) {
|
||||
return renderer->drm_fd;
|
||||
}
|
||||
|
||||
struct wlr_render_pass *wlr_renderer_begin_buffer_pass(struct wlr_renderer *renderer,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue