xwayland/glamor: Add return status to post_damage
If the glamor backend failed to post damage, the caller should do the same to avoid a failure to attach the buffer to the Wayland surface. Change the API of Xwayland's glamor backend post_damage() to return a status so that xwl_window_post_damage() can tell whether the callee failed. Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Michel Dänzer <mdaenzer@redhat.com> https://gitlab.freedesktop.org/xorg/xserver/-/issues/1156
This commit is contained in:
parent
3b265c59a6
commit
252cbad316
|
@ -605,7 +605,7 @@ xwl_glamor_eglstream_allow_commits(struct xwl_window *xwl_window)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static Bool
|
||||||
xwl_glamor_eglstream_post_damage(struct xwl_window *xwl_window,
|
xwl_glamor_eglstream_post_damage(struct xwl_window *xwl_window,
|
||||||
PixmapPtr pixmap, RegionPtr region)
|
PixmapPtr pixmap, RegionPtr region)
|
||||||
{
|
{
|
||||||
|
@ -625,7 +625,7 @@ xwl_glamor_eglstream_post_damage(struct xwl_window *xwl_window,
|
||||||
* flipping OpenGL or Vulkan window. In that case, we don't
|
* flipping OpenGL or Vulkan window. In that case, we don't
|
||||||
* need to do the copy below.
|
* need to do the copy below.
|
||||||
*/
|
*/
|
||||||
return;
|
return TRUE;
|
||||||
|
|
||||||
/* Unbind the framebuffer BEFORE binding the EGLSurface, otherwise we
|
/* Unbind the framebuffer BEFORE binding the EGLSurface, otherwise we
|
||||||
* won't actually draw to it
|
* won't actually draw to it
|
||||||
|
@ -668,6 +668,8 @@ xwl_glamor_eglstream_post_damage(struct xwl_window *xwl_window,
|
||||||
|
|
||||||
/* hang onto the pixmap until the compositor has released it */
|
/* hang onto the pixmap until the compositor has released it */
|
||||||
pixmap->refcnt++;
|
pixmap->refcnt++;
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
|
|
|
@ -304,14 +304,16 @@ xwl_glamor_pixmap_get_wl_buffer(PixmapPtr pixmap)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
Bool
|
||||||
xwl_glamor_post_damage(struct xwl_window *xwl_window,
|
xwl_glamor_post_damage(struct xwl_window *xwl_window,
|
||||||
PixmapPtr pixmap, RegionPtr region)
|
PixmapPtr pixmap, RegionPtr region)
|
||||||
{
|
{
|
||||||
struct xwl_screen *xwl_screen = xwl_window->xwl_screen;
|
struct xwl_screen *xwl_screen = xwl_window->xwl_screen;
|
||||||
|
|
||||||
if (xwl_screen->egl_backend->post_damage)
|
if (xwl_screen->egl_backend->post_damage)
|
||||||
xwl_screen->egl_backend->post_damage(xwl_window, pixmap, region);
|
return xwl_screen->egl_backend->post_damage(xwl_window, pixmap, region);
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
Bool
|
Bool
|
||||||
|
|
|
@ -83,7 +83,7 @@ struct xwl_egl_backend {
|
||||||
* you should implement blitting from the glamor pixmap to the wayland
|
* you should implement blitting from the glamor pixmap to the wayland
|
||||||
* pixmap here. Otherwise, this callback is optional.
|
* pixmap here. Otherwise, this callback is optional.
|
||||||
*/
|
*/
|
||||||
void (*post_damage)(struct xwl_window *xwl_window,
|
Bool (*post_damage)(struct xwl_window *xwl_window,
|
||||||
PixmapPtr pixmap, RegionPtr region);
|
PixmapPtr pixmap, RegionPtr region);
|
||||||
|
|
||||||
/* Called by Xwayland to confirm with the egl backend that the given
|
/* Called by Xwayland to confirm with the egl backend that the given
|
||||||
|
@ -117,7 +117,7 @@ void xwl_glamor_init_wl_registry(struct xwl_screen *xwl_screen,
|
||||||
uint32_t version);
|
uint32_t version);
|
||||||
Bool xwl_glamor_has_wl_interfaces(struct xwl_screen *xwl_screen,
|
Bool xwl_glamor_has_wl_interfaces(struct xwl_screen *xwl_screen,
|
||||||
struct xwl_egl_backend *xwl_egl_backend);
|
struct xwl_egl_backend *xwl_egl_backend);
|
||||||
void xwl_glamor_post_damage(struct xwl_window *xwl_window,
|
Bool xwl_glamor_post_damage(struct xwl_window *xwl_window,
|
||||||
PixmapPtr pixmap, RegionPtr region);
|
PixmapPtr pixmap, RegionPtr region);
|
||||||
Bool xwl_glamor_allow_commits(struct xwl_window *xwl_window);
|
Bool xwl_glamor_allow_commits(struct xwl_window *xwl_window);
|
||||||
void xwl_glamor_egl_make_current(struct xwl_screen *xwl_screen);
|
void xwl_glamor_egl_make_current(struct xwl_screen *xwl_screen);
|
||||||
|
|
|
@ -811,8 +811,12 @@ xwl_window_post_damage(struct xwl_window *xwl_window)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef XWL_HAS_GLAMOR
|
#ifdef XWL_HAS_GLAMOR
|
||||||
if (xwl_screen->glamor)
|
if (xwl_screen->glamor) {
|
||||||
xwl_glamor_post_damage(xwl_window, pixmap, region);
|
if (!xwl_glamor_post_damage(xwl_window, pixmap, region)) {
|
||||||
|
ErrorF("glamor: Failed to post damage\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
wl_surface_attach(xwl_window->surface, buffer, 0, 0);
|
wl_surface_attach(xwl_window->surface, buffer, 0, 0);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user