mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-22 21:05:58 +01:00
backend/drm: grab DMA-BUF from wlr_buffer instead of gbm_bo
Get the DMA-BUF directly out of the wlr_buffer instead of relying on the gbm_bo. This eliminates a roundtrip through GBM.
This commit is contained in:
parent
83925f04c3
commit
dabd2e7207
1 changed files with 10 additions and 3 deletions
|
@ -626,14 +626,21 @@ static bool drm_connector_export_dmabuf(struct wlr_output *output,
|
||||||
}
|
}
|
||||||
|
|
||||||
struct wlr_drm_fb *fb = &crtc->primary->queued_fb;
|
struct wlr_drm_fb *fb = &crtc->primary->queued_fb;
|
||||||
if (fb->bo == NULL) {
|
if (fb->wlr_buf == NULL) {
|
||||||
fb = &crtc->primary->current_fb;
|
fb = &crtc->primary->current_fb;
|
||||||
}
|
}
|
||||||
if (fb->bo == NULL) {
|
if (fb->wlr_buf == NULL) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return export_drm_bo(fb->bo, attribs);
|
// export_dmabuf gives ownership of the DMA-BUF to the caller, so we need
|
||||||
|
// to dup it
|
||||||
|
struct wlr_dmabuf_attributes buf_attribs = {0};
|
||||||
|
if (!wlr_buffer_get_dmabuf(fb->wlr_buf, &buf_attribs)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return wlr_dmabuf_attributes_copy(attribs, &buf_attribs);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct wlr_drm_fb *plane_get_next_fb(struct wlr_drm_plane *plane) {
|
struct wlr_drm_fb *plane_get_next_fb(struct wlr_drm_plane *plane) {
|
||||||
|
|
Loading…
Reference in a new issue