From 627ec429d684c57bdee45a21354009810fc03186 Mon Sep 17 00:00:00 2001 From: Brendan King Date: Wed, 28 Apr 2021 10:57:15 +0100 Subject: [PATCH 51/67] egl/wayland: a linear buffer is not needed with DRM format modifiers If the compositor supports DRM format modifiers, there is no need for an additional linear buffer, as the client can allocate buffers with attributes known to the compositor. --- src/egl/drivers/dri2/platform_wayland.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c index b393e058770..60683fa6c1a 100644 --- a/src/egl/drivers/dri2/platform_wayland.c +++ b/src/egl/drivers/dri2/platform_wayland.c @@ -695,7 +695,7 @@ get_back_bo(struct dri2_egl_surface *dri2_surf) use_flags |= __DRI_IMAGE_USE_PROTECTED; } - if (dri2_dpy->is_different_gpu && + if (dri2_dpy->is_different_gpu && !num_modifiers && dri2_surf->back->linear_copy == NULL) { /* The LINEAR modifier should be a perfect alias of the LINEAR use * flag; try the new interface first before the old, then fall back. */ @@ -811,7 +811,7 @@ update_buffers(struct dri2_egl_display *dri2_dpy, dri2_surf->color_buffers[i].wl_buffer) { wl_buffer_destroy(dri2_surf->color_buffers[i].wl_buffer); dri2_dpy->image->destroyImage(dri2_surf->color_buffers[i].dri_image); - if (dri2_dpy->is_different_gpu) + if (dri2_surf->color_buffers[i].linear_copy) dri2_dpy->image->destroyImage(dri2_surf->color_buffers[i].linear_copy); dri2_surf->color_buffers[i].wl_buffer = NULL; dri2_surf->color_buffers[i].dri_image = NULL; @@ -1247,7 +1247,7 @@ dri2_wl_swap_buffers_with_damage(_EGLDisplay *disp, if (!dri2_surf->current->wl_buffer) { __DRIimage *image; - if (dri2_dpy->is_different_gpu) + if (dri2_surf->current->linear_copy) image = dri2_surf->current->linear_copy; else image = dri2_surf->current->dri_image; @@ -1281,7 +1281,7 @@ dri2_wl_swap_buffers_with_damage(_EGLDisplay *disp, dri2_flush_drawable_for_swapbuffers(disp, draw); - if (dri2_dpy->is_different_gpu) { + if (dri2_surf->current->linear_copy) { _EGLContext *ctx = _eglGetCurrentContext(); struct dri2_egl_context *dri2_ctx = dri2_egl_context(ctx); dri2_dpy->image->blitImage(dri2_ctx->dri_context, -- 2.25.1