[cogl/cogl-1.18] winsys-glx: Reenable swap_region for llvmpipe and swrast



commit a750f80c6aaafb5830c3ef40a2d2b0991cf7f413
Author: Adel Gadllah <adel gadllah gmail com>
Date:   Mon Jan 6 15:29:38 2014 +0100

    winsys-glx: Reenable swap_region for llvmpipe and swrast
    
    The bug that prevented MESA_copy_sub_buffer to work for swrast /
    llvmpipe got fixed in mesa 10.1 git so enable it for mesa 10.1+.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=721450
    
    When landing the patch, it was tweaked to #include "cogl-version.h" to
    avoid a compiler warning about COGL_VERSION_ENCODE being implicitly
    defined. -- Robert Bragg
    
    Reviewed-by: Robert Bragg <robert linux intel com>
    (cherry picked from commit e7e216b1d3d151acf3fed619bd759692a989b4b4)

 cogl/winsys/cogl-winsys-glx.c |   24 ++++++++++++++----------
 1 files changed, 14 insertions(+), 10 deletions(-)
---
diff --git a/cogl/winsys/cogl-winsys-glx.c b/cogl/winsys/cogl-winsys-glx.c
index 04af8d4..09a10c2 100644
--- a/cogl/winsys/cogl-winsys-glx.c
+++ b/cogl/winsys/cogl-winsys-glx.c
@@ -52,6 +52,7 @@
 #include "cogl-winsys-glx-private.h"
 #include "cogl-error-private.h"
 #include "cogl-poll-private.h"
+#include "cogl-version.h"
 
 #include <stdlib.h>
 #include <sys/types.h>
@@ -812,24 +813,27 @@ update_winsys_features (CoglContext *context, CoglError **error)
 
   if (glx_renderer->glXCopySubBuffer || context->glBlitFramebuffer)
     {
-      CoglGpuInfoArchitecture arch;
+      CoglGpuInfo *info = &context->gpu;
+      CoglGpuInfoArchitecture arch = info->architecture;
 
-      /* XXX: ONGOING BUG:
-       * (Don't change the line above since we use this to grep for
-       * un-resolved bug workarounds as part of the release process.)
-       *
+      COGL_FLAGS_SET (context->winsys_features, COGL_WINSYS_FEATURE_SWAP_REGION, TRUE);
+
+      /*
        * "The "drisw" binding in Mesa for loading sofware renderers is
        * broken, and neither glBlitFramebuffer nor glXCopySubBuffer
        * work correctly."
        * - ajax
        * - https://bugzilla.gnome.org/show_bug.cgi?id=674208
        *
-       * This is broken in software Mesa at least as of 7.10
+       * This is broken in software Mesa at least as of 7.10 and got
+       * fixed in Mesa 10.1
        */
-      arch = context->gpu.architecture;
-      if (arch != COGL_GPU_INFO_ARCHITECTURE_LLVMPIPE &&
-          arch != COGL_GPU_INFO_ARCHITECTURE_SOFTPIPE &&
-          arch != COGL_GPU_INFO_ARCHITECTURE_SWRAST)
+
+      if (info->driver_package == COGL_GPU_INFO_DRIVER_PACKAGE_MESA &&
+          info->driver_package_version < COGL_VERSION_ENCODE (10, 1, 0) &&
+          (arch == COGL_GPU_INFO_ARCHITECTURE_LLVMPIPE ||
+           arch == COGL_GPU_INFO_ARCHITECTURE_SOFTPIPE ||
+           arch == COGL_GPU_INFO_ARCHITECTURE_SWRAST))
        {
          COGL_FLAGS_SET (context->winsys_features,
                          COGL_WINSYS_FEATURE_SWAP_REGION, TRUE);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]