diff --git a/src/compositor-drm.c b/src/compositor-drm.c index f943ef33..db84557d 100644 --- a/src/compositor-drm.c +++ b/src/compositor-drm.c @@ -257,15 +257,11 @@ drm_output_prepare_scanout_surface(struct drm_output *output) es->geometry.width != output->base.current->width || es->geometry.height != output->base.current->height || es->transform.enabled || - es->images[0] == EGL_NO_IMAGE_KHR) + es->buffer == NULL) return -1; - bo = gbm_bo_create_from_egl_image(c->gbm, - c->base.egl_display, - es->images[0], - es->geometry.width, - es->geometry.height, - GBM_BO_USE_SCANOUT); + bo = gbm_bo_import(c->gbm, GBM_BO_IMPORT_WL_BUFFER, + es->buffer, GBM_BO_USE_SCANOUT); /* Need to verify output->region contained in surface opaque * region. Or maybe just that format doesn't have alpha. @@ -567,7 +563,7 @@ drm_output_prepare_overlay_surface(struct weston_output *output_base, if (surface_is_primary(ec, es)) return -1; - if (es->num_images != 1 || es->images[0] == EGL_NO_IMAGE_KHR) + if (es->buffer == NULL) return -1; if (!drm_surface_transform_supported(es)) @@ -590,10 +586,11 @@ drm_output_prepare_overlay_surface(struct weston_output *output_base, if (!found) return -1; - bo = gbm_bo_create_from_egl_image(c->gbm, c->base.egl_display, - es->images[0], es->geometry.width, - es->geometry.height, - GBM_BO_USE_SCANOUT); + bo = gbm_bo_import(c->gbm, GBM_BO_IMPORT_WL_BUFFER, + es->buffer, GBM_BO_USE_SCANOUT); + if (!bo) + return -1; + format = gbm_bo_get_format(bo); handle = gbm_bo_get_handle(bo).s32; stride = gbm_bo_get_pitch(bo);