diff options
Diffstat (limited to 'backend/drm/drm.c')
-rw-r--r-- | backend/drm/drm.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/backend/drm/drm.c b/backend/drm/drm.c index bd482be3..95f8c3d0 100644 --- a/backend/drm/drm.c +++ b/backend/drm/drm.c @@ -377,7 +377,7 @@ static bool drm_crtc_page_flip(struct wlr_drm_connector *conn) { } assert(crtc->pending.active); - assert(plane_get_next_fb(crtc->primary)->type != WLR_DRM_FB_TYPE_NONE); + assert(plane_get_next_fb(crtc->primary)->bo); if (!drm_crtc_commit(conn, DRM_MODE_PAGE_FLIP_EVENT)) { return false; } @@ -650,10 +650,10 @@ static bool drm_connector_export_dmabuf(struct wlr_output *output, } struct wlr_drm_fb *fb = &crtc->primary->queued_fb; - if (fb->type == WLR_DRM_FB_TYPE_NONE) { + if (fb->bo == NULL) { fb = &crtc->primary->current_fb; } - if (fb->type == WLR_DRM_FB_TYPE_NONE) { + if (fb->bo == NULL) { return false; } @@ -661,10 +661,10 @@ static bool drm_connector_export_dmabuf(struct wlr_output *output, } struct wlr_drm_fb *plane_get_next_fb(struct wlr_drm_plane *plane) { - if (plane->pending_fb.type != WLR_DRM_FB_TYPE_NONE) { + if (plane->pending_fb.bo) { return &plane->pending_fb; } - if (plane->queued_fb.type != WLR_DRM_FB_TYPE_NONE) { + if (plane->queued_fb.bo) { return &plane->queued_fb; } return &plane->current_fb; @@ -680,7 +680,7 @@ static bool drm_connector_pageflip_renderer(struct wlr_drm_connector *conn) { // drm_crtc_page_flip expects a FB to be available struct wlr_drm_plane *plane = crtc->primary; - if (plane_get_next_fb(plane)->type == WLR_DRM_FB_TYPE_NONE) { + if (!plane_get_next_fb(plane)->bo) { drm_surface_render_black_frame(&plane->surf); if (!drm_fb_lock_surface(&plane->pending_fb, &plane->surf)) { return false; @@ -1507,11 +1507,10 @@ static void page_flip_handler(int fd, unsigned seq, } struct wlr_drm_plane *plane = conn->crtc->primary; - if (plane->queued_fb.type != WLR_DRM_FB_TYPE_NONE) { + if (plane->queued_fb.bo) { drm_fb_move(&plane->current_fb, &plane->queued_fb); } - if (conn->crtc->cursor && - conn->crtc->cursor->queued_fb.type != WLR_DRM_FB_TYPE_NONE) { + if (conn->crtc->cursor && conn->crtc->cursor->queued_fb.bo) { drm_fb_move(&conn->crtc->cursor->current_fb, &conn->crtc->cursor->queued_fb); } @@ -1522,7 +1521,8 @@ static void page_flip_handler(int fd, unsigned seq, * data between the GPUs, even if we were using the direct scanout * interface. */ - if (!drm->parent && plane->current_fb.type == WLR_DRM_FB_TYPE_WLR_BUFFER) { + if (!drm->parent && plane->current_fb.wlr_buf && + wlr_client_buffer_get(plane->current_fb.wlr_buf)) { present_flags |= WLR_OUTPUT_PRESENT_ZERO_COPY; } |