aboutsummaryrefslogtreecommitdiff
path: root/backend/drm
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2020-11-04 14:02:15 +0100
committerSimon Ser <contact@emersion.fr>2020-11-05 09:43:42 +0100
commit1328477a82c50ed4dbed0a42d8624510bf8048f1 (patch)
tree4ff9e7d65bedfdccb8cc6dde027ef84a50f51d31 /backend/drm
parent2934a7292083468b3e25b5d9ff7a03398229b17a (diff)
backend/drm: export pending FB in export_dmabuf, if any
This allows callers to grab the current frame right after committing it, without having to incur a full vblank worth of latency.
Diffstat (limited to 'backend/drm')
-rw-r--r--backend/drm/drm.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/backend/drm/drm.c b/backend/drm/drm.c
index 2644014c..40b73925 100644
--- a/backend/drm/drm.c
+++ b/backend/drm/drm.c
@@ -639,13 +639,15 @@ static bool drm_connector_export_dmabuf(struct wlr_output *output,
return false;
}
- struct wlr_drm_plane *plane = crtc->primary;
-
- if (plane->current_fb.type == WLR_DRM_FB_TYPE_NONE) {
+ struct wlr_drm_fb *fb = &crtc->primary->queued_fb;
+ if (fb->type == WLR_DRM_FB_TYPE_NONE) {
+ fb = &crtc->primary->current_fb;
+ }
+ if (fb->type == WLR_DRM_FB_TYPE_NONE) {
return false;
}
- return export_drm_bo(plane->current_fb.bo, attribs);
+ return export_drm_bo(fb->bo, attribs);
}
struct wlr_drm_fb *plane_get_next_fb(struct wlr_drm_plane *plane) {