From 7b33c2d3f31fe03f88cc26f08590f2baf1a6ef36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Thu, 6 Feb 2020 18:45:19 +0100 Subject: [PATCH] Revert "xwayland/glamor-gbm: Add xwl_glamor_gbm_post_damage hook" This reverts commit 9e85aa9c1fbf51ef00674e3a91aded4083a14a15. To be replaced with a better solution. Reviewed-by: Adam Jackson --- hw/xwayland/xwayland-glamor-gbm.c | 10 ---------- hw/xwayland/xwayland-glamor.c | 3 ++- hw/xwayland/xwayland-glamor.h | 6 ++++-- 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/hw/xwayland/xwayland-glamor-gbm.c b/hw/xwayland/xwayland-glamor-gbm.c index 17682a172..80655fd16 100644 --- a/hw/xwayland/xwayland-glamor-gbm.c +++ b/hw/xwayland/xwayland-glamor-gbm.c @@ -49,7 +49,6 @@ #include "xwayland-glamor.h" #include "xwayland-pixmap.h" #include "xwayland-screen.h" -#include "xwayland-window.h" #include "linux-dmabuf-unstable-v1-client-protocol.h" @@ -920,14 +919,6 @@ xwl_glamor_gbm_has_wl_interfaces(struct xwl_screen *xwl_screen) return TRUE; } -static void -xwl_glamor_gbm_post_damage(struct xwl_window *xwl_window, PixmapPtr pixmap, - RegionPtr region) -{ - /* Make sure any pending drawing to the pixmap is flushed to the kernel */ - glamor_block_handler(xwl_window->xwl_screen->screen); -} - static Bool xwl_glamor_gbm_init_egl(struct xwl_screen *xwl_screen) { @@ -1120,6 +1111,5 @@ xwl_glamor_init_gbm(struct xwl_screen *xwl_screen) xwl_screen->gbm_backend.init_egl = xwl_glamor_gbm_init_egl; xwl_screen->gbm_backend.init_screen = xwl_glamor_gbm_init_screen; xwl_screen->gbm_backend.get_wl_buffer_for_pixmap = xwl_glamor_gbm_get_wl_buffer_for_pixmap; - xwl_screen->gbm_backend.post_damage = xwl_glamor_gbm_post_damage; xwl_screen->gbm_backend.is_available = TRUE; } diff --git a/hw/xwayland/xwayland-glamor.c b/hw/xwayland/xwayland-glamor.c index f3327f4ee..d9523b0a7 100644 --- a/hw/xwayland/xwayland-glamor.c +++ b/hw/xwayland/xwayland-glamor.c @@ -124,7 +124,8 @@ xwl_glamor_post_damage(struct xwl_window *xwl_window, { struct xwl_screen *xwl_screen = xwl_window->xwl_screen; - xwl_screen->egl_backend->post_damage(xwl_window, pixmap, region); + if (xwl_screen->egl_backend->post_damage) + xwl_screen->egl_backend->post_damage(xwl_window, pixmap, region); } Bool diff --git a/hw/xwayland/xwayland-glamor.h b/hw/xwayland/xwayland-glamor.h index 138accd6d..e9896bfef 100644 --- a/hw/xwayland/xwayland-glamor.h +++ b/hw/xwayland/xwayland-glamor.h @@ -70,8 +70,10 @@ struct xwl_egl_backend { Bool *created); /* Called by Xwayland to perform any pre-wl_surface damage routines - * that are required by the backend to make sure any pending drawing - * operations to the pixmap will be visible to the Wayland server. + * that are required by the backend. If your backend is poorly + * designed and lacks the ability to render directly to a surface, + * you should implement blitting from the glamor pixmap to the wayland + * pixmap here. Otherwise, this callback is optional. */ void (*post_damage)(struct xwl_window *xwl_window, PixmapPtr pixmap, RegionPtr region);