diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-10-30 01:59:25 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-30 01:59:25 +0100 |
commit | 70ca7daeb232ac591a78111fc2cc31093cbbbc3b (patch) | |
tree | 1866374a5c57a5bbc191511fb37374880297c872 /backend/drm/drm.c | |
parent | 11dc1f65d216acf31e81addb9817091e8d9ba9a6 (diff) | |
parent | 68362b37a890916d4c98aaee9d29497951c28c67 (diff) |
Merge pull request #1346 from emersion/fix-schedule-frame-mgpu
backend/drm: fix frame scheduling on secondary GPUs
Diffstat (limited to 'backend/drm/drm.c')
-rw-r--r-- | backend/drm/drm.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/backend/drm/drm.c b/backend/drm/drm.c index 0b624717..9fd5c6a3 100644 --- a/backend/drm/drm.c +++ b/backend/drm/drm.c @@ -735,11 +735,11 @@ static bool drm_connector_move_cursor(struct wlr_output *output, return ok; } -static void drm_connector_schedule_frame(struct wlr_output *output) { +static bool drm_connector_schedule_frame(struct wlr_output *output) { struct wlr_drm_connector *conn = get_drm_connector_from_output(output); struct wlr_drm_backend *drm = get_drm_backend_from_backend(output->backend); if (!drm->session->active) { - return; + return false; } // We need to figure out where we are in the vblank cycle @@ -747,29 +747,33 @@ static void drm_connector_schedule_frame(struct wlr_output *output) { struct wlr_drm_crtc *crtc = conn->crtc; if (!crtc) { - return; + return false; } struct wlr_drm_plane *plane = crtc->primary; struct gbm_bo *bo = plane->surf.back; if (!bo) { // We haven't swapped buffers yet -- can't do a pageflip wlr_output_send_frame(output); - return; + return true; + } + if (drm->parent) { + bo = copy_drm_surface_mgpu(&plane->mgpu_surf, bo); } uint32_t fb_id = get_fb_for_bo(bo); if (conn->pageflip_pending) { wlr_log(WLR_ERROR, "Skipping pageflip on output '%s'", conn->output.name); - return; + return true; } if (!drm->iface->crtc_pageflip(drm, conn, crtc, fb_id, NULL)) { - return; + return false; } conn->pageflip_pending = true; wlr_output_update_enabled(output, true); + return true; } static void drm_connector_destroy(struct wlr_output *output) { |