Mesa (master): loader_dri3: Support GLX_SWAP_EXCHANGE_OML

Thomas Hellstrom thomash at kemper.freedesktop.org
Thu Aug 17 05:48:00 UTC 2017


Module: Mesa
Branch: master
Commit: 7c3e3c0faf7dfff61762fb7bc3299f5d7528b91e
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=7c3e3c0faf7dfff61762fb7bc3299f5d7528b91e

Author: Thomas Hellstrom <thellstrom at vmware.com>
Date:   Thu Aug 10 17:34:05 2017 +0200

loader_dri3: Support GLX_SWAP_EXCHANGE_OML

Add support for the exchange swap method. Since we're now forcing a fake front
buffer and we exchange the back and fake front on swaps, we don't need to add
much code.

Signed-off-by: Thomas Hellstrom <thellstrom at vmware.com>
Reviewed-by: Michel Dänzer <michel.daenzer at amd.com>

---

 src/loader/loader_dri3_helper.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/loader/loader_dri3_helper.c b/src/loader/loader_dri3_helper.c
index 3434af3c51..55e14718bc 100644
--- a/src/loader/loader_dri3_helper.c
+++ b/src/loader/loader_dri3_helper.c
@@ -777,7 +777,7 @@ loader_dri3_swap_buffers_msc(struct loader_dri3_drawable *draw,
     * The force_copy parameter is used by EGL to attempt to preserve
     * the back buffer across a call to this function.
     */
-   if (draw->swap_method == __DRI_ATTRIB_SWAP_COPY || force_copy)
+   if (draw->swap_method != __DRI_ATTRIB_SWAP_UNDEFINED || force_copy)
       draw->cur_blit_source = LOADER_DRI3_BACK_ID(draw->cur_back);
 
    /* Exchange the back and fake front. Even though the server knows about these
@@ -1504,8 +1504,10 @@ loader_dri3_get_buffers(__DRIdrawable *driDrawable,
    if (!dri3_update_drawable(driDrawable, draw))
       return false;
 
-   /* pixmaps always have front buffers */
-   if (draw->is_pixmap)
+   /* pixmaps always have front buffers.
+    * Exchange swaps also mandate fake front buffers.
+    */
+   if (draw->is_pixmap || draw->swap_method == __DRI_ATTRIB_SWAP_EXCHANGE)
       buffer_mask |= __DRI_IMAGE_BUFFER_FRONT;
 
    if (buffer_mask & __DRI_IMAGE_BUFFER_FRONT) {




More information about the mesa-commit mailing list