mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-28 22:40:07 +01:00
xwayland/eglstream: Check eglSwapBuffers()
EGLstream's post_damage() would unconditionally return success
regardless of the actual status of the eglSwapBuffers().
Yet, if eglSwapBuffers() fails, we should not post the corresponding
damage as they wouldn't match the actual content of the buffer.
Use the eglSwapBuffers() return value as the return value for
post_damage() and do not take a refrence on the pixmap if it fails.
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
(cherry picked from commit b583395cd3)
This commit is contained in:
parent
8b8a9bf6c7
commit
7d839b3ed3
1 changed files with 10 additions and 4 deletions
|
|
@ -750,14 +750,20 @@ xwl_glamor_eglstream_post_damage(struct xwl_window *xwl_window,
|
|||
glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
|
||||
|
||||
if (xwl_eglstream->have_egl_damage)
|
||||
eglSwapBuffersWithDamageKHR(xwl_screen->egl_display,
|
||||
xwl_pixmap->surface, egl_damage, 1);
|
||||
status = eglSwapBuffersWithDamageKHR(xwl_screen->egl_display,
|
||||
xwl_pixmap->surface,
|
||||
egl_damage, 1);
|
||||
else
|
||||
eglSwapBuffers(xwl_screen->egl_display, xwl_pixmap->surface);
|
||||
status = eglSwapBuffers(xwl_screen->egl_display,
|
||||
xwl_pixmap->surface);
|
||||
|
||||
if (!status) {
|
||||
ErrorF("eglstream: buffer swap failed, not posting damage\n");
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* hang onto the pixmap until the compositor has released it */
|
||||
pixmap->refcnt++;
|
||||
status = TRUE;
|
||||
|
||||
out:
|
||||
/* Restore previous state */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue