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>
This commit is contained in:
Paul Kocialkowski 2019-03-04 11:38:20 +01:00
parent bc2e12239f
commit de6b3fac1f
1 changed files with 6 additions and 2 deletions

View File

@ -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);