From d38648366eea211525de55a1f34854b1a8dc71fc Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sun, 5 Oct 2014 08:00:24 +0100 Subject: [PATCH 1/2] Fallback to std DRI2CopyRegion when DRI2UpdatePrime fails I was looking at a bug report today of intel/ati prime and noticed a number of sna_share_pixmap_backing() failures (called from DRI2UpdatePrime). These were failing as the request was for the scanout buffer (which is tiled and so we refuse to share it, and since it is already on the scanout we refuse to change tiling). But looking at radeon_dri2_copy_region2(), if DRI2UpdatePrime() fails, the copy is aborted and the update lost. If the copy is made to the normal window drawable is that enough for it to be propagated back through damage tracking? --- src/radeon_dri2.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/radeon_dri2.c b/src/radeon_dri2.c index 62325bd..344031b 100644 --- a/src/radeon_dri2.c +++ b/src/radeon_dri2.c @@ -422,26 +422,27 @@ radeon_dri2_copy_region2(ScreenPtr pScreen, dst_drawable = &dst_private->pixmap->drawable; if (src_private->attachment == DRI2BufferFrontLeft) { + src_drawable = NULL; #ifdef USE_DRI2_PRIME - if (drawable->pScreen != pScreen) { + if (drawable->pScreen != pScreen) src_drawable = DRI2UpdatePrime(drawable, src_buffer); - if (!src_drawable) - return; - } else #endif + if (src_drawable == NULL) src_drawable = drawable; } if (dst_private->attachment == DRI2BufferFrontLeft) { + dst_drawable = NULL; #ifdef USE_DRI2_PRIME if (drawable->pScreen != pScreen) { dst_drawable = DRI2UpdatePrime(drawable, dest_buffer); - if (!dst_drawable) - return; - dst_ppix = (PixmapPtr)dst_drawable; - if (dst_drawable != drawable) - translate = TRUE; - } else + if (dst_drawable) { + dst_ppix = (PixmapPtr)dst_drawable; + if (dst_drawable != drawable) + translate = TRUE; + } + } #endif + if (dst_drawable == NULL) dst_drawable = drawable; } -- 2.8.1