xorg-x11-server/0010-glamor-Propagate-glamor_prepare_access-failures-in-c.patch
Olivier Fourdan 1e468bc44a xserver 1.20.7
- backport from stable "xserver-1.20-branch" up to commit ad7364d8d
  (for mutter fullscreen unredirect on Wayland)
- Update videodrv minor ABI as 1.20.7 changed the minor ABI version
  (backward compatible, API addition in glamor)
- Rebase Xwayland randr resolution change emulation support patches
2020-03-13 09:54:18 +01:00

46 lines
1.5 KiB
Diff

From ca034c2f2cfff8e49b816b8ecbaa96215b796e36 Mon Sep 17 00:00:00 2001
From: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Date: Mon, 10 Feb 2020 10:20:30 +0100
Subject: [PATCH xserver 10/22] glamor: Propagate glamor_prepare_access
failures in copy helpers
glamor_prepare_access can fail for a few reasons, especially when
failing to allocate a PBO buffer. Take this in account and bail in
the copy helpers that call the helper when a failure happens.
Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
(cherry picked from commit de6b3fac1f26075ce915006c914c4a4755617715)
---
glamor/glamor_copy.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/glamor/glamor_copy.c b/glamor/glamor_copy.c
index e050c0220..1ab2be6c0 100644
--- a/glamor/glamor_copy.c
+++ b/glamor/glamor_copy.c
@@ -221,7 +221,9 @@ glamor_copy_cpu_fbo(DrawablePtr src,
goto bail;
glamor_make_current(glamor_priv);
- glamor_prepare_access(src, GLAMOR_ACCESS_RO);
+
+ if (!glamor_prepare_access(src, GLAMOR_ACCESS_RO))
+ goto bail;
glamor_get_drawable_deltas(dst, dst_pixmap, &dst_xoff, &dst_yoff);
@@ -309,7 +311,9 @@ glamor_copy_fbo_cpu(DrawablePtr src,
goto bail;
glamor_make_current(glamor_priv);
- glamor_prepare_access(dst, GLAMOR_ACCESS_RW);
+
+ if (!glamor_prepare_access(dst, GLAMOR_ACCESS_RW))
+ goto bail;
glamor_get_drawable_deltas(src, src_pixmap, &src_xoff, &src_yoff);
--
2.24.1