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)
This commit is contained in:
Adel Gadllah 2014-01-06 15:29:38 +01:00 committed by Robert Bragg
parent 9a879a7616
commit a750f80c6a

View File

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