aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/glamor/glamor_copyplane.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/glamor/glamor_copyplane.c')
-rw-r--r--xorg-server/glamor/glamor_copyplane.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/xorg-server/glamor/glamor_copyplane.c b/xorg-server/glamor/glamor_copyplane.c
index c42d33e94..2bd2de30d 100644
--- a/xorg-server/glamor/glamor_copyplane.c
+++ b/xorg-server/glamor/glamor_copyplane.c
@@ -38,12 +38,15 @@ _glamor_copy_plane(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
&& glamor_ddx_fallback_check_pixmap(pDst))
goto fail;
- glamor_prepare_access(pDst, GLAMOR_ACCESS_RW);
- glamor_prepare_access(pSrc, GLAMOR_ACCESS_RO);
- *pRegion = fbCopyPlane(pSrc, pDst, pGC, srcx, srcy, w, h,
- dstx, dsty, bitPlane);
- glamor_finish_access(pSrc, GLAMOR_ACCESS_RO);
- glamor_finish_access(pDst, GLAMOR_ACCESS_RW);
+ if (glamor_prepare_access(pDst, GLAMOR_ACCESS_RW) &&
+ glamor_prepare_access(pSrc, GLAMOR_ACCESS_RO) &&
+ glamor_prepare_access_gc(pGC)) {
+ *pRegion = fbCopyPlane(pSrc, pDst, pGC, srcx, srcy, w, h,
+ dstx, dsty, bitPlane);
+ }
+ glamor_finish_access_gc(pGC);
+ glamor_finish_access(pSrc);
+ glamor_finish_access(pDst);
return TRUE;
fail: