mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-12-22 18:09:49 +01:00
backend/headless: implement export_dmabuf
This commit is contained in:
parent
61f8cdfb9e
commit
02df7b7ac8
1 changed files with 18 additions and 0 deletions
|
@ -121,6 +121,23 @@ static void output_rollback_render(struct wlr_output *wlr_output) {
|
|||
output->back_buffer = NULL;
|
||||
}
|
||||
|
||||
static bool output_export_dmabuf(struct wlr_output *wlr_output,
|
||||
struct wlr_dmabuf_attributes *attribs) {
|
||||
struct wlr_headless_output *output =
|
||||
headless_output_from_output(wlr_output);
|
||||
|
||||
if (!output->front_buffer) {
|
||||
return false;
|
||||
}
|
||||
|
||||
struct wlr_dmabuf_attributes tmp;
|
||||
if (!wlr_buffer_get_dmabuf(output->front_buffer, &tmp)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return wlr_dmabuf_attributes_copy(attribs, &tmp);
|
||||
}
|
||||
|
||||
static void output_destroy(struct wlr_output *wlr_output) {
|
||||
struct wlr_headless_output *output =
|
||||
headless_output_from_output(wlr_output);
|
||||
|
@ -137,6 +154,7 @@ static const struct wlr_output_impl output_impl = {
|
|||
.attach_render = output_attach_render,
|
||||
.commit = output_commit,
|
||||
.rollback_render = output_rollback_render,
|
||||
.export_dmabuf = output_export_dmabuf,
|
||||
};
|
||||
|
||||
bool wlr_output_is_headless(struct wlr_output *wlr_output) {
|
||||
|
|
Loading…
Reference in a new issue