backend/drm: use modifiers for our GBM buffers

This commit is contained in:
Simon Ser 2019-10-06 17:31:51 -04:00 committed by Scott Anderson
parent 11bf87d678
commit 2bdd1d0896
3 changed files with 24 additions and 11 deletions

View file

@ -680,22 +680,24 @@ static bool drm_connector_set_cursor(struct wlr_output *output,
ret = drmGetCap(drm->fd, DRM_CAP_CURSOR_HEIGHT, &h);
h = ret ? 64 : h;
if (!drm->parent) {
if (!init_drm_surface(&plane->surf, &drm->renderer, w, h,
drm->renderer.gbm_format, GBM_BO_USE_LINEAR | GBM_BO_USE_SCANOUT)) {
drm->renderer.gbm_format, NULL,
GBM_BO_USE_LINEAR | GBM_BO_USE_SCANOUT)) {
wlr_log(WLR_ERROR, "Cannot allocate cursor resources");
return false;
}
} else {
if (!init_drm_surface(&plane->surf, &drm->parent->renderer, w, h,
drm->parent->renderer.gbm_format, GBM_BO_USE_LINEAR)) {
drm->parent->renderer.gbm_format, NULL,
GBM_BO_USE_LINEAR)) {
wlr_log(WLR_ERROR, "Cannot allocate cursor resources");
return false;
}
if (!init_drm_surface(&plane->mgpu_surf, &drm->renderer, w, h,
drm->renderer.gbm_format, GBM_BO_USE_LINEAR | GBM_BO_USE_SCANOUT)) {
drm->renderer.gbm_format, NULL,
GBM_BO_USE_LINEAR | GBM_BO_USE_SCANOUT)) {
wlr_log(WLR_ERROR, "Cannot allocate cursor resources");
return false;
}