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

mesa: Changes to 'ubuntu'



 configure.ac                                                        |    8 
 debian/changelog                                                    |   10 
 debian/patches/04_osmesa_version.diff                               |    4 
 debian/patches/revert-c8a86f717f8e30204c615d06bcec159410ac06c5.diff |   91 +++++++
 debian/patches/series                                               |    1 
 src/gallium/drivers/r600/evergreen_state.c                          |    3 
 src/gallium/drivers/r600/evergreend.h                               |   11 
 src/gallium/drivers/r600/r600_state.c                               |    3 
 src/gallium/drivers/r600/r600_state_common.c                        |    2 
 src/gallium/drivers/r600/r600d.h                                    |    9 
 src/gallium/winsys/radeon/drm/radeon_drm_winsys.c                   |    3 
 src/glsl/ast_to_hir.cpp                                             |   19 +
 src/mapi/glapi/gen/glX_proto_send.py                                |    4 
 src/mesa/drivers/common/meta.c                                      |    8 
 src/mesa/drivers/dri/i965/brw_fs_live_variables.cpp                 |   24 +
 src/mesa/drivers/osmesa/Makefile.am                                 |    4 
 src/mesa/drivers/osmesa/osmesa.pc.in                                |    2 
 src/mesa/main/extensions.c                                          |   11 
 src/mesa/main/fbobject.c                                            |    4 
 src/mesa/main/teximage.c                                            |   48 ++-
 src/mesa/main/teximage.h                                            |    2 
 src/mesa/main/texstorage.c                                          |  126 +++++++---
 22 files changed, 313 insertions(+), 84 deletions(-)

New commits:
commit 3f3e95022b8cec326b2246855a674bce5b24d11b
Author: Timo Aaltonen <tjaalton@ubuntu.com>
Date:   Fri Sep 14 12:25:36 2012 +0300

    refresh 04_osmesa_version.diff

diff --git a/debian/patches/04_osmesa_version.diff b/debian/patches/04_osmesa_version.diff
index deac406..63cfcfd 100644
--- a/debian/patches/04_osmesa_version.diff
+++ b/debian/patches/04_osmesa_version.diff
@@ -4,7 +4,7 @@
  
  lib@OSMESA_LIB@_la_SOURCES = osmesa.c
  
--lib@OSMESA_LIB@_la_LDFLAGS = -module -version-number @VERSION_NUMBER@ -no-undefined
+-lib@OSMESA_LIB@_la_LDFLAGS = -module -version-number @OSMESA_VERSION@ -no-undefined
 +lib@OSMESA_LIB@_la_LDFLAGS = -module -version-number 6:5:3 -no-undefined
  lib@OSMESA_LIB@_la_LIBADD = \
  	$(top_builddir)/src/mesa/libmesa.la \
@@ -13,7 +13,7 @@
  all-local: lib@OSMESA_LIB@.la
  	$(MKDIR_P) $(top_builddir)/$(LIB_DIR);
  	ln -f .libs/lib@OSMESA_LIB@.so $(top_builddir)/$(LIB_DIR)/lib@OSMESA_LIB@.so;
--	ln -f .libs/lib@OSMESA_LIB@.so.@VERSION@ $(top_builddir)/$(LIB_DIR)/lib@OSMESA_LIB@.so.@VERSION@;
+-	ln -f .libs/lib@OSMESA_LIB@.so.@OSMESA_VERSION@ $(top_builddir)/$(LIB_DIR)/lib@OSMESA_LIB@.so.@OSMESA_VERSION@;
 +	ln -f .libs/lib@OSMESA_LIB@.so.6.5.3 $(top_builddir)/$(LIB_DIR)/lib@OSMESA_LIB@.so.6.5.3;
  endif
  

commit 91e9963ae8dee6d2a0c699e53d5f74325d867eae
Author: Timo Aaltonen <tjaalton@ubuntu.com>
Date:   Fri Sep 14 11:54:26 2012 +0300

    bump the version

diff --git a/debian/changelog b/debian/changelog
index c9b9f16..a383f65 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-mesa (9.0~git20120903.e1673d20-1) UNRELEASED; urgency=low
+mesa (9.0~git20120914.c586fce4-1) UNRELEASED; urgency=low
 
   [ Julien Cristau ]
   * Use xz for all binary packages not just *-dbg.

commit dbc7481282003217cc7f37e5b0e1b6440c033563
Author: Timo Aaltonen <tjaalton@ubuntu.com>
Date:   Fri Sep 14 11:51:28 2012 +0300

    revert-c8a86f717f8e30204c615d06bcec159410ac06c5.diff Revert an upstream commit to fix i915_dri. (LP: #1047306)

diff --git a/debian/changelog b/debian/changelog
index 2134713..9aa96f6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+mesa (9.0~git20120903.e1673d20-0ubuntu2) UNRELEASED; urgency=low
+
+  * revert-c8a86f717f8e30204c615d06bcec159410ac06c5.diff
+    Revert an upstream commit to fix i915_dri. (LP: #1047306)
+
+ -- Timo Aaltonen <tjaalton@ubuntu.com>  Thu, 13 Sep 2012 20:25:01 +0300
+
 mesa (9.0~git20120903.e1673d20-0ubuntu1) quantal; urgency=low
 
   * Merge from unreleased debian git.
diff --git a/debian/patches/revert-c8a86f717f8e30204c615d06bcec159410ac06c5.diff b/debian/patches/revert-c8a86f717f8e30204c615d06bcec159410ac06c5.diff
new file mode 100644
index 0000000..559e53a
--- /dev/null
+++ b/debian/patches/revert-c8a86f717f8e30204c615d06bcec159410ac06c5.diff
@@ -0,0 +1,91 @@
+commit b156d8c4bf28fcbf469bb71b78fdb45887cb2dad
+Author: Timo Aaltonen <tjaalton@ubuntu.com>
+Date:   Thu Sep 13 20:23:51 2012 +0300
+
+    Revert "mesa: move IS_NEGATIVE() and DIFFERENT_SIGNS() to macros.h"
+    
+    This reverts commit c8a86f717f8e30204c615d06bcec159410ac06c5.
+
+diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h
+index 2f854e5..bb42094 100644
+--- a/src/mesa/main/imports.h
++++ b/src/mesa/main/imports.h
+@@ -223,6 +223,35 @@ static inline int IS_INF_OR_NAN( float x )
+ 
+ 
+ /***
++ *** IS_NEGATIVE: test if float is negative
++ ***/
++#if defined(USE_IEEE)
++static inline int GET_FLOAT_BITS( float x )
++{
++   fi_type fi;
++   fi.f = x;
++   return fi.i;
++}
++#define IS_NEGATIVE(x) (GET_FLOAT_BITS(x) < 0)
++#else
++#define IS_NEGATIVE(x) (x < 0.0F)
++#endif
++
++
++/***
++ *** DIFFERENT_SIGNS: test if two floats have opposite signs
++ ***/
++#if defined(USE_IEEE)
++#define DIFFERENT_SIGNS(x,y) ((GET_FLOAT_BITS(x) ^ GET_FLOAT_BITS(y)) & (1<<31))
++#else
++/* Could just use (x*y<0) except for the flatshading requirements.
++ * Maybe there's a better way?
++ */
++#define DIFFERENT_SIGNS(x,y) ((x) * (y) <= 0.0F && (x) - (y) != 0.0F)
++#endif
++
++
++/***
+  *** CEILF: ceiling of float
+  *** FLOORF: floor of float
+  *** FABSF: absolute value of float
+diff --git a/src/mesa/main/macros.h b/src/mesa/main/macros.h
+index 7d0a375..5af9487 100644
+--- a/src/mesa/main/macros.h
++++ b/src/mesa/main/macros.h
+@@ -689,38 +689,6 @@ NORMALIZE_3FV(GLfloat v[3])
+ }
+ 
+ 
+-/** Is float value negative? */
+-static inline GLboolean
+-IS_NEGATIVE(float x)
+-{
+-#if defined(USE_IEEE)
+-   fi_type fi;
+-   fi.f = x;
+-   return fi.i < 0;
+-#else
+-   return x < 0.0F;
+-#endif
+-}
+-
+-
+-/** Test two floats have opposite signs */
+-static inline GLboolean
+-DIFFERENT_SIGNS(GLfloat x, GLfloat y)
+-{
+-#if defined(USE_IEEE)
+-   fi_type xfi, yfi;
+-   xfi.f = x;
+-   yfi.f = y;
+-   return (xfi.i ^ yfi.i) & (1u << 31);
+-#else
+-   /* Could just use (x*y<0) except for the flatshading requirements.
+-    * Maybe there's a better way?
+-    */
+-   return ((x) * (y) <= 0.0F && (x) - (y) != 0.0F);
+-#endif
+-}
+-
+-
+ /** Compute ceiling of integer quotient of A divided by B. */
+ #define CEILING( A, B )  ( (A) % (B) == 0 ? (A)/(B) : (A)/(B)+1 )
+ 
diff --git a/debian/patches/series b/debian/patches/series
index 1d3510c..a142b7a 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -13,3 +13,4 @@
 100_no_abi_tag.patch
 101_ubuntu_hidden_glname.patch
 #117-static-gallium.patch
+revert-c8a86f717f8e30204c615d06bcec159410ac06c5.diff

commit c586fce4fb537e904e35cb5197b6b7fe02217acb
Author: Vadim Girlin <vadimgirlin@gmail.com>
Date:   Tue Sep 4 00:18:13 2012 +0400

    r600g: adjust QUANT_MODE for higher precision
    
    Use 1/256 for R6xx/7xx, 1/4096 for evergreen, instead of default 1/16.
    
    Helps to pass some piglit tests (fbo, multisample).
    
    Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
    Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
    (cherry picked from commit f44bda17f515c411071ca8744ebd96039d9c583b)

diff --git a/src/gallium/drivers/r600/evergreen_state.c b/src/gallium/drivers/r600/evergreen_state.c
index 28a83f2..bda8ed5 100644
--- a/src/gallium/drivers/r600/evergreen_state.c
+++ b/src/gallium/drivers/r600/evergreen_state.c
@@ -920,7 +920,8 @@ static void *evergreen_create_rs_state(struct pipe_context *ctx,
 					S_028C08_PIX_CENTER_HALF(state->gl_rasterization_rules));
 	} else {
 		r600_pipe_state_add_reg(rstate, R_028C08_PA_SU_VTX_CNTL,
-					S_028C08_PIX_CENTER_HALF(state->gl_rasterization_rules));
+					S_028C08_PIX_CENTER_HALF(state->gl_rasterization_rules) |
+					S_028C08_QUANT_MODE(V_028C08_X_1_4096TH));
 	}
 	r600_pipe_state_add_reg(rstate, R_028B7C_PA_SU_POLY_OFFSET_CLAMP, fui(state->offset_clamp));
 	r600_pipe_state_add_reg(rstate, R_028814_PA_SU_SC_MODE_CNTL,
diff --git a/src/gallium/drivers/r600/evergreend.h b/src/gallium/drivers/r600/evergreend.h
index 91d78f8..e4d72f5 100644
--- a/src/gallium/drivers/r600/evergreend.h
+++ b/src/gallium/drivers/r600/evergreend.h
@@ -1955,6 +1955,17 @@
 #define   S_028C08_PIX_CENTER_HALF(x)                  (((x) & 0x1) << 0)
 #define   G_028C08_PIX_CENTER_HALF(x)                  (((x) >> 0) & 0x1)
 #define   C_028C08_PIX_CENTER_HALF                     0xFFFFFFFE
+#define   S_028C08_QUANT_MODE(x)                       (((x) & 0x7) << 3)
+#define   G_028C08_QUANT_MODE(x)                       (((x) >> 3) & 0x7)
+#define   C_028C08_QUANT_MODE                          0xFFFFFFC7
+#define     V_028C08_X_1_16TH                          0x00
+#define     V_028C08_X_1_8TH                           0x01
+#define     V_028C08_X_1_4TH                           0x02
+#define     V_028C08_X_1_2                             0x03
+#define     V_028C08_X_1                               0x04
+#define     V_028C08_X_1_256TH                         0x05
+#define     V_028C08_X_1_1024TH                        0x06
+#define     V_028C08_X_1_4096TH                        0x07
 #define R_028C0C_PA_CL_GB_VERT_CLIP_ADJ              0x00028C0C
 #define R_028C10_PA_CL_GB_VERT_DISC_ADJ              0x00028C10
 #define R_028C14_PA_CL_GB_HORZ_CLIP_ADJ              0x00028C14
diff --git a/src/gallium/drivers/r600/r600_state.c b/src/gallium/drivers/r600/r600_state.c
index 26db24b..53bbdd9 100644
--- a/src/gallium/drivers/r600/r600_state.c
+++ b/src/gallium/drivers/r600/r600_state.c
@@ -948,7 +948,8 @@ static void *r600_create_rs_state(struct pipe_context *ctx,
 	r600_pipe_state_add_reg(rstate, R_028A4C_PA_SC_MODE_CNTL, sc_mode_cntl);
 
 	r600_pipe_state_add_reg(rstate, R_028C08_PA_SU_VTX_CNTL,
-				S_028C08_PIX_CENTER_HALF(state->gl_rasterization_rules));
+				S_028C08_PIX_CENTER_HALF(state->gl_rasterization_rules) |
+				S_028C08_QUANT_MODE(V_028C08_X_1_256TH));
 
 	r600_pipe_state_add_reg(rstate, R_028DFC_PA_SU_POLY_OFFSET_CLAMP, fui(state->offset_clamp));
 	r600_pipe_state_add_reg(rstate, R_028814_PA_SU_SC_MODE_CNTL,
diff --git a/src/gallium/drivers/r600/r600d.h b/src/gallium/drivers/r600/r600d.h
index a6da0a2..28423e1 100644
--- a/src/gallium/drivers/r600/r600d.h
+++ b/src/gallium/drivers/r600/r600d.h
@@ -2194,6 +2194,15 @@
 #define   S_028C08_PIX_CENTER_HALF(x)                  (((x) & 0x1) << 0)
 #define   G_028C08_PIX_CENTER_HALF(x)                  (((x) >> 0) & 0x1)
 #define   C_028C08_PIX_CENTER_HALF                     0xFFFFFFFE
+#define   S_028C08_QUANT_MODE(x)                       (((x) & 0x7) << 3)
+#define   G_028C08_QUANT_MODE(x)                       (((x) >> 3) & 0x7)
+#define   C_028C08_QUANT_MODE                          0xFFFFFFC7
+#define     V_028C08_X_1_16TH                          0x00
+#define     V_028C08_X_1_8TH                           0x01
+#define     V_028C08_X_1_4TH                           0x02
+#define     V_028C08_X_1_2                             0x03
+#define     V_028C08_X_1                               0x04
+#define     V_028C08_X_1_256TH                         0x05
 #define R_028C1C_PA_SC_AA_SAMPLE_LOCS_MCTX           0x028C1C
 #define R_028C48_PA_SC_AA_MASK                       0x028C48
 #define R_028810_PA_CL_CLIP_CNTL                     0x028810

commit 405d47bbe78106f44e4283925e58a1d1ebc88455
Author: Vadim Girlin <vadimgirlin@gmail.com>
Date:   Sat Sep 1 01:02:24 2012 +0400

    mesa: don't wait in _mesa_ClientWaitSync if timeout is 0
    
    From ARB_sync spec:
    
        If the value of <timeout> is zero, then ClientWaitSync does not
        block, but simply tests the current state of <sync>. TIMEOUT_EXPIRED
        will be returned in this case if <sync> is not signaled, even though
        no actual wait was performed.
    
    Fixes random fails of the arb_sync-timeout-zero piglit test on r600g.
    
    Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
    Reviewed-by: Eric Anholt <eric@anholt.net>
    (cherry picked from commit b05a1fc156c4776d97d6ff3dcce71e6e34bac21d)

diff --git a/src/mesa/main/syncobj.c b/src/mesa/main/syncobj.c
index e1a5c6c..9f5a27e 100644
--- a/src/mesa/main/syncobj.c
+++ b/src/mesa/main/syncobj.c
@@ -326,9 +326,13 @@ _mesa_ClientWaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout)
    if (syncObj->StatusFlag) {
       ret = GL_ALREADY_SIGNALED;
    } else {
-      ctx->Driver.ClientWaitSync(ctx, syncObj, flags, timeout);
+      if (timeout == 0) {
+         ret = GL_TIMEOUT_EXPIRED;
+      } else {
+         ctx->Driver.ClientWaitSync(ctx, syncObj, flags, timeout);
 
-      ret = syncObj->StatusFlag ? GL_CONDITION_SATISFIED : GL_TIMEOUT_EXPIRED;
+         ret = syncObj->StatusFlag ? GL_CONDITION_SATISFIED : GL_TIMEOUT_EXPIRED;
+      }
    }
 
    _mesa_unref_sync_object(ctx, syncObj);

commit 04f902b47226f976d3d81c66ddadb7414051c957
Author: Brian Paul <brianp@vmware.com>
Date:   Sat Sep 8 09:33:13 2012 -0600

    mesa: fix proxy texture error handling in glTexStorage()
    
    This is basically a follow-on to 1f5b1f98468d5e80be39e619ed15c422fbede8d3.
    Basically, generate GL errors for ordinary invalid parameters for proxy
    targets the same as for non-proxy targets.  Only texture size and OOM
    errors should be handled specially for proxies.
    
    Note: This is a candidate for the stable branches.
    (cherry picked from commit 35c75f6777c177a59df8a87adf0777403113ce74)

diff --git a/src/mesa/main/texstorage.c b/src/mesa/main/texstorage.c
index 8e03e5e..f8a9397 100644
--- a/src/mesa/main/texstorage.c
+++ b/src/mesa/main/texstorage.c
@@ -192,9 +192,10 @@ setup_texstorage(struct gl_context *ctx,
 
          return;
       }
-   }
 
-   texObj->Immutable = GL_TRUE;
+      /* Only set this field for non-proxy texture objects */
+      texObj->Immutable = GL_TRUE;
+   }
 }
 
 
@@ -242,7 +243,6 @@ tex_storage_error_check(struct gl_context *ctx, GLuint dims, GLenum target,
                         GLsizei levels, GLenum internalformat,
                         GLsizei width, GLsizei height, GLsizei depth)
 {
-   const GLboolean isProxy = _mesa_is_proxy_texture(target);
    struct gl_texture_object *texObj;
    GLuint maxDim;
    GLboolean legalFormat;
@@ -296,19 +296,15 @@ tex_storage_error_check(struct gl_context *ctx, GLuint dims, GLenum target,
 
    /* size check */
    if (width < 1 || height < 1 || depth < 1) {
-      if (!isProxy) {
-         _mesa_error(ctx, GL_INVALID_VALUE,
-                     "glTexStorage%uD(width, height or depth < 1)", dims);
-      }
+      _mesa_error(ctx, GL_INVALID_VALUE,
+                  "glTexStorage%uD(width, height or depth < 1)", dims);
       return GL_TRUE;
    }  
 
    /* levels check */
    if (levels < 1 || height < 1 || depth < 1) {
-      if (!isProxy) {
-         _mesa_error(ctx, GL_INVALID_VALUE, "glTexStorage%uD(levels < 1)",
-                     dims);
-      }
+      _mesa_error(ctx, GL_INVALID_VALUE, "glTexStorage%uD(levels < 1)",
+                  dims);
       return GL_TRUE;
    }  
 
@@ -322,40 +318,32 @@ tex_storage_error_check(struct gl_context *ctx, GLuint dims, GLenum target,
 
    /* check levels against maximum */
    if (levels > _mesa_max_texture_levels(ctx, target)) {
-      if (!isProxy) {
-         _mesa_error(ctx, GL_INVALID_OPERATION,
-                     "glTexStorage%uD(levels too large)", dims);
-      }
+      _mesa_error(ctx, GL_INVALID_OPERATION,
+                  "glTexStorage%uD(levels too large)", dims);
       return GL_TRUE;
    }
 
    /* check levels against width/height/depth */
    maxDim = MAX3(width, height, depth);
    if (levels > _mesa_logbase2(maxDim) + 1) {
-      if (!isProxy) {
-         _mesa_error(ctx, GL_INVALID_OPERATION,
-                     "glTexStorage%uD(too many levels for max texture dimension)",
-                     dims);
-      }
+      _mesa_error(ctx, GL_INVALID_OPERATION,
+                  "glTexStorage%uD(too many levels for max texture dimension)",
+                  dims);
       return GL_TRUE;
    }
 
    /* non-default texture object check */
    texObj = _mesa_get_current_tex_object(ctx, target);
-   if (!texObj || (texObj->Name == 0 && !isProxy)) {
-      if (!isProxy) {
-         _mesa_error(ctx, GL_INVALID_OPERATION,
-                     "glTexStorage%uD(texture object 0)", dims);
-      }
+   if (!texObj || (texObj->Name == 0)) {
+      _mesa_error(ctx, GL_INVALID_OPERATION,
+                  "glTexStorage%uD(texture object 0)", dims);
       return GL_TRUE;
    }
 
    /* Check if texObj->Immutable is set */
    if (texObj->Immutable) {
-      if (!isProxy) {
-         _mesa_error(ctx, GL_INVALID_OPERATION, "glTexStorage%uD(immutable)",
-                     dims);
-      }
+      _mesa_error(ctx, GL_INVALID_OPERATION, "glTexStorage%uD(immutable)",
+                  dims);
       return GL_TRUE;
    }
 
@@ -371,22 +359,38 @@ texstorage(GLuint dims, GLenum target, GLsizei levels, GLenum internalformat,
            GLsizei width, GLsizei height, GLsizei depth)
 {
    struct gl_texture_object *texObj;
-   GLboolean error;
+   GLboolean sizeOK;
+   GLenum proxyTarget = _mesa_get_proxy_target(target);
 
    GET_CURRENT_CONTEXT(ctx);
 
    texObj = _mesa_get_current_tex_object(ctx, target);
 
-   error = tex_storage_error_check(ctx, dims, target, levels,
-                                   internalformat, width, height, depth);
-   if (!error) {
+   if (tex_storage_error_check(ctx, dims, target, levels,
+                               internalformat, width, height, depth)) {
+      return; /* error was recorded */
+   }
+
+   sizeOK = ctx->Driver.TestProxyTexImage(ctx, proxyTarget, 0,
+                                          internalformat, GL_NONE, GL_NONE,
+                                          width, height, depth, 0);
+
+   if (!sizeOK) {
+      if (_mesa_is_proxy_texture(texObj->Target)) {
+         /* clear all image fields for [levels] */
+         clear_image_fields(ctx, dims, texObj);
+      }
+      else {
+         _mesa_error(ctx, GL_INVALID_VALUE,
+                     "glTexStorage%uD(invalid width, height or depth)",
+                     dims);
+         return;
+      }
+   }
+   else {
       setup_texstorage(ctx, texObj, dims, levels, internalformat,
                        width, height, depth);
    }
-   else if (_mesa_is_proxy_texture(target)) {
-      /* clear all image fields for [levels] */
-      clear_image_fields(ctx, dims, texObj);
-   }
 }
 
 

commit f9bb66b1cee2272b20ff3086e84d17026b8e8bb9
Author: Brian Paul <brianp@vmware.com>
Date:   Sat Sep 8 09:46:14 2012 -0600

    mesa: make _mesa_get_proxy_target() non-static
    
    Needed for the next patch.
    
    Note: This is a candidate for the stable branches.
    (cherry picked from commit d17440dcaa42ac4c19dad1be7d4c7199395135a9)

diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index 664bb6d..cbbb8e7 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -660,8 +660,8 @@ _mesa_is_proxy_texture(GLenum target)
 /**
  * Return the proxy target which corresponds to the given texture target
  */
-static GLenum
-get_proxy_target(GLenum target)
+GLenum
+_mesa_get_proxy_target(GLenum target)
 {
    switch (target) {
    case GL_TEXTURE_1D:
@@ -692,7 +692,7 @@ get_proxy_target(GLenum target)
    case GL_PROXY_TEXTURE_2D_ARRAY_EXT:
       return GL_PROXY_TEXTURE_2D_ARRAY_EXT;
    default:
-      _mesa_problem(NULL, "unexpected target in get_proxy_target()");
+      _mesa_problem(NULL, "unexpected target in _mesa_get_proxy_target()");
       return 0;
    }
 }
@@ -1703,7 +1703,7 @@ texture_error_check( struct gl_context *ctx,
                      GLint width, GLint height,
                      GLint depth, GLint border )
 {
-   const GLenum proxyTarget = get_proxy_target(target);
+   const GLenum proxyTarget = _mesa_get_proxy_target(target);
    const GLboolean isProxy = target == proxyTarget;
    GLboolean sizeOK = GL_TRUE;
    GLboolean colorFormat;
@@ -1933,7 +1933,7 @@ compressed_texture_error_check(struct gl_context *ctx, GLint dimensions,
                                GLsizei height, GLsizei depth, GLint border,
                                GLsizei imageSize)
 {
-   const GLenum proxyTarget = get_proxy_target(target);
+   const GLenum proxyTarget = _mesa_get_proxy_target(target);
    const GLint maxLevels = _mesa_max_texture_levels(ctx, target);
    GLint expectedSize;
    GLenum choose_format;
@@ -2308,7 +2308,7 @@ copytexture_error_check( struct gl_context *ctx, GLuint dimensions,
                          GLenum target, GLint level, GLint internalFormat,
                          GLint width, GLint height, GLint border )
 {
-   const GLenum proxyTarget = get_proxy_target(target);
+   const GLenum proxyTarget = _mesa_get_proxy_target(target);
    const GLenum type = GL_FLOAT;
    GLboolean sizeOK;
    GLint baseFormat;
diff --git a/src/mesa/main/teximage.h b/src/mesa/main/teximage.h
index feaaf0c..36fd1c2 100644
--- a/src/mesa/main/teximage.h
+++ b/src/mesa/main/teximage.h
@@ -66,6 +66,8 @@ _mesa_base_tex_format( struct gl_context *ctx, GLint internalFormat );
 extern GLboolean
 _mesa_is_proxy_texture(GLenum target);
 
+extern GLenum
+_mesa_get_proxy_target(GLenum target);
 
 extern struct gl_texture_image *
 _mesa_new_texture_image( struct gl_context *ctx );

commit 10b9a02952ff0918c40024326228324704992329
Author: Brian Paul <brianp@vmware.com>
Date:   Sat Sep 8 09:27:46 2012 -0600

    mesa: do internal format error checking for glTexStorage()
    
    Turns out we weren't doing any format checking before.  Now check
    the internal format and, in particular, make sure that unsized internal
    formats aren't accepted.
    
    Note: This is a candidate for the stable branches.
    (cherry picked from commit 2e4fc54977977e674ee77294e6632a24e594d17f)

diff --git a/src/mesa/main/texstorage.c b/src/mesa/main/texstorage.c
index f8af8bf..8e03e5e 100644
--- a/src/mesa/main/texstorage.c
+++ b/src/mesa/main/texstorage.c
@@ -245,6 +245,54 @@ tex_storage_error_check(struct gl_context *ctx, GLuint dims, GLenum target,
    const GLboolean isProxy = _mesa_is_proxy_texture(target);
    struct gl_texture_object *texObj;
    GLuint maxDim;
+   GLboolean legalFormat;
+
+   /* check internal format - note that only sized formats are allowed */
+   switch (internalformat) {
+   case GL_ALPHA:
+   case GL_LUMINANCE:
+   case GL_LUMINANCE_ALPHA:
+   case GL_INTENSITY:
+   case GL_RED:
+   case GL_RG:
+   case GL_RGB:
+   case GL_RGBA:
+   case GL_BGRA:
+   case GL_DEPTH_COMPONENT:
+   case GL_DEPTH_STENCIL:
+   case GL_COMPRESSED_ALPHA:
+   case GL_COMPRESSED_LUMINANCE_ALPHA:
+   case GL_COMPRESSED_LUMINANCE:
+   case GL_COMPRESSED_INTENSITY:
+   case GL_COMPRESSED_RGB:
+   case GL_COMPRESSED_RGBA:
+   case GL_COMPRESSED_SRGB:
+   case GL_COMPRESSED_SRGB_ALPHA:
+   case GL_COMPRESSED_SLUMINANCE:
+   case GL_COMPRESSED_SLUMINANCE_ALPHA:
+   case GL_RED_INTEGER:
+   case GL_GREEN_INTEGER:
+   case GL_BLUE_INTEGER:
+   case GL_ALPHA_INTEGER:
+   case GL_RGB_INTEGER:
+   case GL_RGBA_INTEGER:
+   case GL_BGR_INTEGER:
+   case GL_BGRA_INTEGER:
+   case GL_LUMINANCE_INTEGER_EXT:
+   case GL_LUMINANCE_ALPHA_INTEGER_EXT:
+      /* these unsized formats are illegal */
+      legalFormat = GL_FALSE;
+      break;
+   default:
+      legalFormat = _mesa_base_tex_format(ctx, internalformat) > 0;
+   }
+
+   if (!legalFormat) {
+      _mesa_error(ctx, GL_INVALID_ENUM,
+                  "glTexStorage%uD(internalformat = %s)", dims,
+                  _mesa_lookup_enum_by_nr(internalformat));
+      return GL_TRUE;
+   }
 
    /* size check */
    if (width < 1 || height < 1 || depth < 1) {

commit 1f4d074f75055fd9591c5b5506727000e4a5526d
Author: Paul Berry <stereotype441@gmail.com>
Date:   Wed Sep 5 16:07:16 2012 -0700

    mesa/msaa: Allow X and Y flips in multisampled blits.
    
    From the GL 4.3 spec, section 18.3.1 "Blitting Pixel Rectangles":
    
        If SAMPLE_BUFFERS for either the read framebuffer or draw
        framebuffer is greater than zero, no copy is performed and an
        INVALID_OPERATION error is generated if the dimensions of the
        source and destination rectangles provided to BlitFramebuffer are
        not identical, or if the formats of the read and draw framebuffers
        are not identical.
    
    It is not clear from the spec whether "dimensions" should mean both
    sign and magnitude, or just magnitude.
    
    Previously, Mesa interpreted "dimensions" as meaning both sign and
    magnitude, so any multisampled blit that attempted to flip the image
    in the X and/or Y direction would fail.
    
    However, Y flips are likely to be commonplace in OpenGL applications
    that have been ported from DirectX applications, as a result of the
    fact that DirectX and OpenGL differ in their orientation of the Y
    axis.  Furthermore, at least one commercial driver (nVidia) permits Y
    filps, and L4D2 relies on them being permitted.  So it seems prudent
    for Mesa to permit them.
    
    This patch changes Mesa to allow both X and Y flips, since there is no
    language in the spec to indicate that X and Y flips should be treated
    differently.
    
    NOTE: This is a candidate for stable release branches.
    
    Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
    Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
    (cherry picked from commit 5d5f0f349135786cdd76b6004f38b12e50d7f8f9)

diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index 59a5ec3..abc9d83 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -2979,8 +2979,8 @@ _mesa_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
    /* extra checks for multisample copies... */
    if (readFb->Visual.samples > 0 || drawFb->Visual.samples > 0) {
       /* src and dest region sizes must be the same */
-      if (srcX1 - srcX0 != dstX1 - dstX0 ||
-          srcY1 - srcY0 != dstY1 - dstY0) {
+      if (abs(srcX1 - srcX0) != abs(dstX1 - dstX0) ||
+          abs(srcY1 - srcY0) != abs(dstY1 - dstY0)) {
          _mesa_error(ctx, GL_INVALID_OPERATION,
                 "glBlitFramebufferEXT(bad src/dst multisample region sizes)");
          return;

commit 42ef3f68c9621eb713f154955dccabacd6e1e0ef
Author: Kenneth Graunke <kenneth@whitecape.org>
Date:   Fri Aug 31 16:04:19 2012 -0700

    glsl: Generate compile errors for explicit blend indices < 0 or > 1.
    
    According to the GLSL 4.30 specification, this is a compile time error.
    Earlier specifications don't specify a behavior, but since 0 and 1 are
    the only valid indices for dual source blending, it makes sense to
    generate the error.
    
    Fixes (the fixed version of) piglit's layout-12.frag.
    
    NOTE: This is a candidate for the 9.0 branch.
    
    Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
    Reviewed-by: Paul Berry <stereotype441@gmail.com>
    (cherry picked from commit 354f2cb5c7330a7d43cf0b177daf758d2aa31e0a)

diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
index 02fe66b..5157661 100644
--- a/src/glsl/ast_to_hir.cpp
+++ b/src/glsl/ast_to_hir.cpp
@@ -2086,9 +2086,24 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual,
 	 } else {
 	    var->location = qual->location;
 	 }
+
 	 if (qual->flags.q.explicit_index) {
-	    var->explicit_index = true;
-	    var->index = qual->index;
+            /* From the GLSL 4.30 specification, section 4.4.2 (Output
+             * Layout Qualifiers):
+             *
+             * "It is also a compile-time error if a fragment shader
+             *  sets a layout index to less than 0 or greater than 1."
+             *
+             * Older specifications don't mandate a behavior; we take
+             * this as a clarification and always generate the error.
+             */
+            if (qual->index < 0 || qual->index > 1) {
+               _mesa_glsl_error(loc, state,
+                                "explicit index may only be 0 or 1\n");
+            } else {
+               var->explicit_index = true;
+               var->index = qual->index;
+            }
 	 }
       }
    } else if (qual->flags.q.explicit_index) {

commit e2b4f9aac38b6fcd8eacef24afab47e9d346ba22
Author: Eric Anholt <eric@anholt.net>
Date:   Wed Sep 5 22:10:41 2012 -0700

    i965: Fix virtual_grf_interferes() between calculate_live_intervals() and DCE.
    
    This fixes the blue zombies bug in l4d2.
    
    NOTE: This is a candidate for the 9.0 branch.
    Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
    (cherry picked from commit 39aca5076fa0e31d418b481167063933f5f7b74f)

diff --git a/src/mesa/drivers/dri/i965/brw_fs_live_variables.cpp b/src/mesa/drivers/dri/i965/brw_fs_live_variables.cpp
index 16480ad..392691d 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_live_variables.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_live_variables.cpp
@@ -221,6 +221,30 @@ fs_visitor::calculate_live_intervals()
    }
 
    this->live_intervals_valid = true;
+
+   /* Note in the non-control-flow code above, that we only take def[] as the
+    * first store, and use[] as the last use.  We use this in dead code
+    * elimination, to determine when a store never gets used.  However, we
+    * also use these arrays to answer the virtual_grf_interferes() question
+    * (live interval analysis), which is used for register coalescing and
+    * register allocation.
+    *
+    * So, there's a conflict over what the array should mean: if use[]
+    * considers a def after the last use, then the dead code elimination pass
+    * never does anything (and it's an important pass!).  But if we don't
+    * include dead code, then virtual_grf_interferes() lies and we'll do
+    * horrible things like coalesce the register that is dead-code-written
+    * into another register that was live across the dead write (causing the
+    * use of the second register to take the dead write's source value instead
+    * of the coalesced MOV's source value).
+    *
+    * To resolve the conflict, immediately after calculating live intervals,
+    * detect dead code, nuke it, and if we changed anything, calculate again
+    * before returning to the caller.  Now we happen to produce def[] and
+    * use[] arrays that will work for virtual_grf_interferes().
+    */
+   if (dead_code_eliminate())
+      calculate_live_intervals();
 }
 
 bool

commit 8b8416676e959d2ef4ade0d52aa7792641a5ed6c
Author: Brian Paul <brianp@vmware.com>
Date:   Thu Sep 6 08:16:56 2012 -0600

    glapi/glx: rename 'table' variable to 'disp_table'
    
    This fixes an issue where the local 'table' variable was hiding the
    function parameter name in glGetColorTable(..., void *table).
    
    This should be OK as long as there's never a GL entrypoint that uses
    'disp_table' as a parameter name.
    
    Note: This is a candidate for the 9.0 branch.
    
    Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
    (cherry picked from commit 043f66204b1a190e18747c3befa8826c82dd87a7)

diff --git a/src/mapi/glapi/gen/glX_proto_send.py b/src/mapi/glapi/gen/glX_proto_send.py
index c533592..ae12c45 100644
--- a/src/mapi/glapi/gen/glX_proto_send.py
+++ b/src/mapi/glapi/gen/glX_proto_send.py
@@ -423,9 +423,9 @@ __indirect_get_proc_address(const char *name)
 				print ''
 				print '#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)'
 				print '    if (gc->isDirect) {'
-				print '        const _glapi_proc *const table = GET_DISPATCH();'
+				print '        const _glapi_proc *const disp_table = GET_DISPATCH();'
 				print '        PFNGL%sPROC p =' % (name.upper())
-				print '            (PFNGL%sPROC) table[%d];' % (name.upper(), func.offset)
+				print '            (PFNGL%sPROC) disp_table[%d];' % (name.upper(), func.offset)
 				print '    %sp(%s);' % (ret_string, func.get_called_parameter_string())
 				print '    } else'
 				print '#endif'

commit 6e9baa85a95495e9343ca899a808d264076d67f8
Author: Brian Paul <brianp@vmware.com>
Date:   Tue Sep 4 20:17:15 2012 -0600

    mesa: fix per-level max texture size error checking
    
    This is a long-standing omission in Mesa's texture image size checking.
    We need to take the mipmap level into consideration when checking if the
    width, height and depth are too large.
    
    Fixes the new piglit max-texture-size-level test.
    Thanks to Stéphane Marchesin for finding this problem.
    
    Note: This is a candidate for the stable branches.
    
    Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
    (cherry picked from commit 771e7b6d884bb4294a89f276a904d90b28efb90a)

diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index 11b1b30..664bb6d 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -1247,11 +1247,12 @@ _mesa_test_proxy_teximage(struct gl_context *ctx, GLenum target, GLint level,
 
    switch (target) {
    case GL_PROXY_TEXTURE_1D:
-      maxSize = 1 << (ctx->Const.MaxTextureLevels - 1);
-      if (width < 2 * border || width > 2 * border + maxSize)
-         return GL_FALSE;
       if (level >= ctx->Const.MaxTextureLevels)
          return GL_FALSE;
+      maxSize = 1 << (ctx->Const.MaxTextureLevels - 1); /* level zero size */
+      maxSize >>= level;  /* level size */
+      if (width < 2 * border || width > 2 * border + maxSize)
+         return GL_FALSE;
       if (!ctx->Extensions.ARB_texture_non_power_of_two) {
          if (width > 0 && !_mesa_is_pow_two(width - 2 * border))
             return GL_FALSE;
@@ -1259,13 +1260,14 @@ _mesa_test_proxy_teximage(struct gl_context *ctx, GLenum target, GLint level,
       return GL_TRUE;
 
    case GL_PROXY_TEXTURE_2D:
+      if (level >= ctx->Const.MaxTextureLevels)
+         return GL_FALSE;
       maxSize = 1 << (ctx->Const.MaxTextureLevels - 1);
+      maxSize >>= level;
       if (width < 2 * border || width > 2 * border + maxSize)
          return GL_FALSE;
       if (height < 2 * border || height > 2 * border + maxSize)
          return GL_FALSE;
-      if (level >= ctx->Const.MaxTextureLevels)
-         return GL_FALSE;
       if (!ctx->Extensions.ARB_texture_non_power_of_two) {
          if (width > 0 && !_mesa_is_pow_two(width - 2 * border))
             return GL_FALSE;
@@ -1275,15 +1277,16 @@ _mesa_test_proxy_teximage(struct gl_context *ctx, GLenum target, GLint level,
       return GL_TRUE;
 
    case GL_PROXY_TEXTURE_3D:
+      if (level >= ctx->Const.Max3DTextureLevels)
+         return GL_FALSE;
       maxSize = 1 << (ctx->Const.Max3DTextureLevels - 1);
+      maxSize >>= level;
       if (width < 2 * border || width > 2 * border + maxSize)
          return GL_FALSE;
       if (height < 2 * border || height > 2 * border + maxSize)
          return GL_FALSE;
       if (depth < 2 * border || depth > 2 * border + maxSize)
          return GL_FALSE;
-      if (level >= ctx->Const.Max3DTextureLevels)
-         return GL_FALSE;
       if (!ctx->Extensions.ARB_texture_non_power_of_two) {
          if (width > 0 && !_mesa_is_pow_two(width - 2 * border))
             return GL_FALSE;
@@ -1295,23 +1298,24 @@ _mesa_test_proxy_teximage(struct gl_context *ctx, GLenum target, GLint level,
       return GL_TRUE;
 
    case GL_PROXY_TEXTURE_RECTANGLE_NV:
+      if (level != 0)
+         return GL_FALSE;
       maxSize = ctx->Const.MaxTextureRectSize;
       if (width < 0 || width > maxSize)
          return GL_FALSE;
       if (height < 0 || height > maxSize)
          return GL_FALSE;
-      if (level != 0)
-         return GL_FALSE;
       return GL_TRUE;
 
    case GL_PROXY_TEXTURE_CUBE_MAP_ARB:
+      if (level >= ctx->Const.MaxCubeTextureLevels)
+         return GL_FALSE;
       maxSize = 1 << (ctx->Const.MaxCubeTextureLevels - 1);
+      maxSize >>= level;
       if (width < 2 * border || width > 2 * border + maxSize)
          return GL_FALSE;
       if (height < 2 * border || height > 2 * border + maxSize)
          return GL_FALSE;
-      if (level >= ctx->Const.MaxCubeTextureLevels)
-         return GL_FALSE;
       if (!ctx->Extensions.ARB_texture_non_power_of_two) {
          if (width > 0 && !_mesa_is_pow_two(width - 2 * border))
             return GL_FALSE;
@@ -1321,13 +1325,14 @@ _mesa_test_proxy_teximage(struct gl_context *ctx, GLenum target, GLint level,
       return GL_TRUE;
 
    case GL_PROXY_TEXTURE_1D_ARRAY_EXT:
+      if (level >= ctx->Const.MaxTextureLevels)
+         return GL_FALSE;
       maxSize = 1 << (ctx->Const.MaxTextureLevels - 1);
+      maxSize >>= level;
       if (width < 2 * border || width > 2 * border + maxSize)
          return GL_FALSE;
       if (height < 1 || height > ctx->Const.MaxArrayTextureLayers)
          return GL_FALSE;
-      if (level >= ctx->Const.MaxTextureLevels)
-         return GL_FALSE;
       if (!ctx->Extensions.ARB_texture_non_power_of_two) {
          if (width > 0 && !_mesa_is_pow_two(width - 2 * border))
             return GL_FALSE;
@@ -1335,15 +1340,16 @@ _mesa_test_proxy_teximage(struct gl_context *ctx, GLenum target, GLint level,
       return GL_TRUE;
 
    case GL_PROXY_TEXTURE_2D_ARRAY_EXT:
+      if (level >= ctx->Const.MaxTextureLevels)
+         return GL_FALSE;
       maxSize = 1 << (ctx->Const.MaxTextureLevels - 1);
+      maxSize >>= level;
       if (width < 2 * border || width > 2 * border + maxSize)
          return GL_FALSE;
       if (height < 2 * border || height > 2 * border + maxSize)
          return GL_FALSE;
       if (depth < 1 || depth > ctx->Const.MaxArrayTextureLayers)
          return GL_FALSE;
-      if (level >= ctx->Const.MaxTextureLevels)
-         return GL_FALSE;
       if (!ctx->Extensions.ARB_texture_non_power_of_two) {
          if (width > 0 && !_mesa_is_pow_two(width - 2 * border))
             return GL_FALSE;

commit 3f6ce3454f4d1331234f74670c82595f84269b1b
Author: Brian Paul <brianp@vmware.com>
Date:   Thu Aug 30 16:12:53 2012 -0600

    st/mesa: s/CALLOC/calloc/ to fix allocation bug
    
    The CALLOC() macro only takes one argument so this was being treated
    as a comma expression.  Simply use calloc() instead.
    
    A follow-on patch will replace all CALLOC() calls with calloc().
    
    NOTE: This is a candidate for the 8.0 and 9.0 branches.
    (cherry picked from commit 43ed822a50db6b980041ddf91c16c7f8fccc4092)

diff --git a/src/mesa/state_tracker/st_mesa_to_tgsi.c b/src/mesa/state_tracker/st_mesa_to_tgsi.c
index 4d99b17..5604714 100644
--- a/src/mesa/state_tracker/st_mesa_to_tgsi.c
+++ b/src/mesa/state_tracker/st_mesa_to_tgsi.c
@@ -1198,7 +1198,7 @@ st_translate_mesa_program(
     * for these, so we put all the translated regs in t->constants.
     */
    if (program->Parameters) {
-      t->constants = CALLOC( program->Parameters->NumParameters,
+      t->constants = calloc( program->Parameters->NumParameters,
                              sizeof t->constants[0] );
       if (t->constants == NULL) {
          ret = PIPE_ERROR_OUT_OF_MEMORY;

commit 7f011e20758b1f4552d56dd40204605f7ae0e3c3
Author: Johannes Obermayr <johannesobermayr@gmx.de>
Date:   Sun Sep 2 01:35:47 2012 +0200

    Set OSMESA_VERSION=8.
    
    VERSION_NUMBER is not required anymore. So it will be removed.
    
    Reviewed-by: Adam Jackson <ajax@redhat.com>


Reply to: