mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-18 06:59:44 -05:00
backend/drm: add basic support for direct scan-out
This commit is contained in:
parent
3dec88e455
commit
96d6fde5dc
7 changed files with 105 additions and 7 deletions
|
|
@ -478,6 +478,30 @@ bool wlr_output_commit(struct wlr_output *output) {
|
|||
return true;
|
||||
}
|
||||
|
||||
bool wlr_output_set_dmabuf(struct wlr_output *output,
|
||||
struct wlr_dmabuf_attributes *attribs) {
|
||||
if (output->frame_pending) {
|
||||
wlr_log(WLR_ERROR, "Tried to swap buffers when a frame is pending");
|
||||
return false;
|
||||
}
|
||||
if (output->idle_frame != NULL) {
|
||||
wl_event_source_remove(output->idle_frame);
|
||||
output->idle_frame = NULL;
|
||||
}
|
||||
|
||||
if (!output->impl->set_dmabuf) {
|
||||
return false;
|
||||
}
|
||||
if (!output->impl->set_dmabuf(output, attribs)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
output->frame_pending = true;
|
||||
output->needs_swap = false;
|
||||
pixman_region32_clear(&output->damage);
|
||||
return true;
|
||||
}
|
||||
|
||||
void wlr_output_send_frame(struct wlr_output *output) {
|
||||
output->frame_pending = false;
|
||||
wlr_signal_emit_safe(&output->events.frame, output);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue