diff options
author | Scott Anderson <scott@anderso.nz> | 2018-08-04 15:03:34 +1200 |
---|---|---|
committer | Scott Anderson <scott@anderso.nz> | 2018-08-04 15:08:28 +1200 |
commit | 4bee710c308924395ca8a7ff8492a3feb696ca48 (patch) | |
tree | 4a7e0a75a8ff16cb3c0b41cd0838159128571666 /backend/drm | |
parent | e547e55be079b612a8b81b18cdca09f3c523f939 (diff) |
Fix hardware cursor on secondary GPU
Create rendering resources on parent GPU, so that we can sample the
passed in texture properly. The cursor buffer needs to remain on the
same GPU.
Diffstat (limited to 'backend/drm')
-rw-r--r-- | backend/drm/drm.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/backend/drm/drm.c b/backend/drm/drm.c index 9d030dff..c050a356 100644 --- a/backend/drm/drm.c +++ b/backend/drm/drm.c @@ -628,7 +628,6 @@ static bool drm_connector_set_cursor(struct wlr_output *output, bool update_texture) { struct wlr_drm_connector *conn = (struct wlr_drm_connector *)output; struct wlr_drm_backend *drm = (struct wlr_drm_backend *)output->backend; - struct wlr_drm_renderer *renderer = &drm->renderer; struct wlr_drm_crtc *crtc = conn->crtc; if (!crtc) { @@ -654,13 +653,16 @@ static bool drm_connector_set_cursor(struct wlr_output *output, ret = drmGetCap(drm->fd, DRM_CAP_CURSOR_HEIGHT, &h); h = ret ? 64 : h; + struct wlr_drm_renderer *renderer = + drm->parent ? &drm->parent->renderer : &drm->renderer; + if (!init_drm_surface(&plane->surf, renderer, w, h, GBM_FORMAT_ARGB8888, 0)) { wlr_log(WLR_ERROR, "Cannot allocate cursor resources"); return false; } - plane->cursor_bo = gbm_bo_create(renderer->gbm, w, h, + plane->cursor_bo = gbm_bo_create(drm->renderer.gbm, w, h, GBM_FORMAT_ARGB8888, GBM_BO_USE_CURSOR | GBM_BO_USE_WRITE); if (!plane->cursor_bo) { wlr_log_errno(WLR_ERROR, "Failed to create cursor bo"); |