loader/dri3: Use client local back to front blit in copySubBuffer if available
authorThomas Hellstrom <thellstrom@vmware.com>
Mon, 4 Sep 2017 12:05:25 +0000 (14:05 +0200)
committerThomas Hellstrom <thellstrom@vmware.com>
Tue, 5 Sep 2017 10:22:17 +0000 (12:22 +0200)
The copySubBuffer functionality always attempted a server side blit from
back to fake front if a fake front was present, and we weren't displaying
on a remote GPU.

Now that we always have local blit capability on modern drivers, first
attempt a local blit, and only if that fails, try the server blit.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Axel Davy <axel.davy@normalesup.org>
src/loader/loader_dri3_helper.c

index e3120f5d250bfd93ae7453d00d909dc05af75233..c0a6e0d259237d5a19594de4e28bd349ecc6a440 100644 (file)
@@ -635,14 +635,6 @@ loader_dri3_copy_sub_buffer(struct loader_dri3_drawable *draw,
                                     back->image,
                                     0, 0, back->width, back->height,
                                     0, 0, __BLIT_FLAG_FLUSH);
                                     back->image,
                                     0, 0, back->width, back->height,
                                     0, 0, __BLIT_FLAG_FLUSH);
-      /* We use blit_image to update our fake front,
-       */
-      if (draw->have_fake_front)
-         (void) loader_dri3_blit_image(draw,
-                                       dri3_fake_front_buffer(draw)->image,
-                                       back->image,
-                                       x, y, width, height,
-                                       x, y, __BLIT_FLAG_FLUSH);
    }
 
    loader_dri3_swapbuffer_barrier(draw);
    }
 
    loader_dri3_swapbuffer_barrier(draw);
@@ -656,7 +648,13 @@ loader_dri3_copy_sub_buffer(struct loader_dri3_drawable *draw,
    /* Refresh the fake front (if present) after we just damaged the real
     * front.
     */
    /* Refresh the fake front (if present) after we just damaged the real
     * front.
     */
-   if (draw->have_fake_front && !draw->is_different_gpu) {
+   if (draw->have_fake_front &&
+       !loader_dri3_blit_image(draw,
+                               dri3_fake_front_buffer(draw)->image,
+                               back->image,
+                               x, y, width, height,
+                               x, y, __BLIT_FLAG_FLUSH) &&
+       !draw->is_different_gpu) {
       dri3_fence_reset(draw->conn, dri3_fake_front_buffer(draw));
       dri3_copy_area(draw->conn,
                      back->pixmap,
       dri3_fence_reset(draw->conn, dri3_fake_front_buffer(draw));
       dri3_copy_area(draw->conn,
                      back->pixmap,