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

mesa: Changes to 'ubuntu'



 Makefile.am                                 |    2 
 configure.ac                                |    5 
 debian/changelog                            |   16 +-
 debian/rules                                |    2 
 docs/relnotes-9.0.html                      |    2 
 src/egl/drivers/dri2/platform_x11.c         |    3 
 src/gallium/drivers/r600/evergreen_state.c  |   13 +
 src/gallium/drivers/radeon/Makefile         |   24 +--
 src/gallium/drivers/radeon/Makefile.sources |   25 +++
 src/mesa/drivers/common/meta.c              |  206 ++++++++++++++++++++++------
 src/mesa/drivers/dri/i965/gen6_cc.c         |   13 +
 src/mesa/main/api_exec.c                    |    2 
 src/mesa/main/state.c                       |    3 
 src/mesa/main/teximage.c                    |   21 --
 src/mesa/main/texstore.c                    |    6 
 src/mesa/main/version.h                     |    2 
 16 files changed, 252 insertions(+), 93 deletions(-)

New commits:
commit 0775ade92e1ba7c4df0676ec08259869039a3409
Author: Timo Aaltonen <tjaalton@ubuntu.com>
Date:   Tue Oct 9 15:58:22 2012 +0300

    release to quantal

diff --git a/debian/changelog b/debian/changelog
index 71132d6..7f4cb0f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-mesa (9.0-0ubuntu1) UNRELEASED; urgency=low
+mesa (9.0-0ubuntu1) quantal; urgency=low
 
   * Merge from unreleased debian git.
     - final 9.0 release.

commit 81ecf0e16a78f198254eebbcb33886b1e6050301
Author: Timo Aaltonen <tjaalton@ubuntu.com>
Date:   Tue Oct 9 15:57:32 2012 +0300

    rules: Don't try building gallium swrast for arm
    
    since it doesn't work and wasn't actually built anyway

diff --git a/debian/changelog b/debian/changelog
index c83a9f9..71132d6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+mesa (9.0-0ubuntu1) UNRELEASED; urgency=low
+
+  * Merge from unreleased debian git.
+    - final 9.0 release.
+  * rules: Don't try building gallium swrast for arm, since it doesn't
+    work and wasn't actually built anyway.
+
+ -- Timo Aaltonen <tjaalton@ubuntu.com>  Tue, 09 Oct 2012 15:55:51 +0300
+
 mesa (9.0~git20121004.b2048c5e-0ubuntu1) quantal; urgency=low
 
   * Merge from unreleased debian git.
diff --git a/debian/rules b/debian/rules
index e42a32e..e059404 100755
--- a/debian/rules
+++ b/debian/rules
@@ -87,7 +87,7 @@ else
 
 # Build the llvmpipe driver only on amd64, i386 and armhf until it's tested
 # elsewhere
-  ifeq (,$(filter $(DEB_HOST_ARCH_CPU), amd64 i386 arm))
+  ifeq (,$(filter $(DEB_HOST_ARCH_CPU), amd64 i386))
 	DRI_DRIVERS += swrast
   else
 	GALLIUM_DRIVERS += swrast

commit 63d3ca9ce84062a05b3694a05d778b7a1ccc85ce
Author: Timo Aaltonen <tjaalton@ubuntu.com>
Date:   Tue Oct 9 12:15:37 2012 +0300

    final release 9.0

diff --git a/debian/changelog b/debian/changelog
index 10788a6..fa0815d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,10 +1,10 @@
-mesa (9.0~git20121004.b2048c5e-1) UNRELEASED; urgency=low
+mesa (9.0-1) UNRELEASED; urgency=low
 
   [ Julien Cristau ]
   * Use xz for all binary packages not just *-dbg.
 
   [ Timo Aaltonen ]
-  * New upstream git snapshot.
+  * New upstream release 9.0.
   * Refresh patches
     - disable 05_kfreebsd-egl-x11.diff for now.
     - switch to llvm-3.1.

commit e5fdeef1e08b55acd48dc68f0cc8fe213f2820b8
Author: Ian Romanick <ian.d.romanick@intel.com>
Date:   Mon Oct 8 14:56:11 2012 -0700

    mesa: Bump version number to 9.0 (final)
    
    Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>

diff --git a/Makefile.am b/Makefile.am
index 190246c..9a0c1dd 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -54,7 +54,7 @@ distclean-local:
 
 # Rules for making release tarballs
 
-PACKAGE_VERSION=9.0-devel
+PACKAGE_VERSION=9.0
 PACKAGE_DIR = Mesa-$(PACKAGE_VERSION)
 PACKAGE_NAME = MesaLib-$(PACKAGE_VERSION)
 
diff --git a/docs/relnotes-9.0.html b/docs/relnotes-9.0.html
index ff31fbb..d72c5bb 100644
--- a/docs/relnotes-9.0.html
+++ b/docs/relnotes-9.0.html
@@ -7,7 +7,7 @@
 </head>
 <body>
 
-<h1>Mesa 9.0 Release Notes / date TBD</h1>
+<h1>Mesa 9.0 Release Notes / October 8th, 2012</h1>
 
 <p>
 Mesa 9.0 is a new development release.
diff --git a/src/mesa/main/version.h b/src/mesa/main/version.h
index 5b2e85a..85701ca 100644
--- a/src/mesa/main/version.h
+++ b/src/mesa/main/version.h
@@ -35,7 +35,7 @@ struct gl_context;
 #define MESA_MAJOR 9
 #define MESA_MINOR 0
 #define MESA_PATCH 0
-#define MESA_VERSION_STRING "9.0-devel"
+#define MESA_VERSION_STRING "9.0"
 
 /* To make version comparison easy */
 #define MESA_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))

commit a8d0652c04ae4249608b37f06b5a8b3dca3774a9
Author: Tom Stellard <thomas.stellard@amd.com>
Date:   Tue Sep 4 09:37:02 2012 -0400

    configure.ac: Don't link gallium drivers with libdricore
    
    Reviewed-by: Matt Turner <mattst88@gmail.com>
    (cherry picked from commit d68e337c600a1b644d84e4703c92c2087aff82a4)

diff --git a/configure.ac b/configure.ac
index b8d0141..2d922f6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -916,7 +916,6 @@ AC_SUBST([GLESv2_LIB_DEPS])
 AC_SUBST([GLESv2_PC_LIB_PRIV])
 
 DRI_LIB_DEPS="\$(top_builddir)/src/mesa/libdricore/libdricore${VERSION}.la"
-GALLIUM_DRI_LIB_DEPS="\$(TOP)/\$(LIB_DIR)/libdricore${VERSION}.so"
 
 AC_SUBST([HAVE_XF86VIDMODE])
 

commit ad4b3b93ded960c22388c7bc3ba14d32b30b8f1d
Author: Anuj Phogat <anuj.phogat@gmail.com>
Date:   Fri Aug 31 13:51:39 2012 -0700

    _mesa_meta_GenerateMipmap: Support all texture targets by generating shaders at runtime
    
    This is a squash for the following 7 commits.  The first introduces the
    functionality, and the remaining six fix various bugs.
    
    Patch 1:
        _mesa_meta_GenerateMipmap: Support all texture targets by generating shaders at runtime
    
        glsl path of _mesa_meta_GenerateMipmap() function would require different fragment
        shaders depending on the texture target. This patch adds the code to generate
        appropriate fragment shader programs at run time.
        Fixes https://bugs.freedesktop.org/show_bug.cgi?id=54296
    
        V2: Removed the code for integer textures as ARB is planning to
            disallow automatic mipmap generation for integer textures.
            Now using ralloc_asprintf in setup_glsl_generate_mipmap().
    
        NOTE: This is a candidate for stable branches.
    
        Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
        Reviewed-by: Brian Paul <brianp@vmware.com>
        (cherry picked from commit 299acac849eb8506de9760c94c6e8e8b1046d909)
    
    Patch 2:
        _mesa_meta_GenerateMipmap: Generate separate shaders for glsl 120 / 130
    
        glsl version of _mesa_meta_GenerateMipmap() would require separate
        shaders for glsl 120 and 130.
    
        V2: Removed the code for integer textures as ARB is planning to
            disallow automatic mipmap generation for integer textures.
    
        NOTE: This is a candidate for stable branches.
    
        Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
        Reviewed-by: Brian Paul <brianp@vmware.com>
        (cherry picked from commit 15bf3103b48a5928321fe56fbb3ed28a0f314418)
    
    Patch 3:
        meta: Add on demand compilation of per target shader programs
    
        A call to glGenerateMipmap() follows the generation of a relevant
        shader program in setup_glsl_generate_mipmap().
    
        To support all texture targets and to avoid compiling shaders
        everytime, per target shader programs are compiled on demand
        and saved for the next call.
    
        Fixes float-texture(mipmap.manual):
        See Comment 6: https://bugs.freedesktop.org/show_bug.cgi?id=54296
    
        NOTE: This is a candidate for stable branches.
    
        Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
        Reviewed-by: Brian Paul <brianp@vmware.com>
        (cherry picked from commit eb1d87fb945783448cc40ad43c9cd4d98002d424)
    
    Patch 4:
        meta: make mem_ctx non-global.
    
        I can't see any external users, and this is a global symbol,
    
        Reviewed-by: Matt Turner <mattst88@gmail.com>
        Signed-off-by: Dave Airlie <airlied@redhat.com>
        (cherry picked from commit 36639ec6e9a2758e344235fbdc1450719d8851e3)
    
    Patch 5:
        meta: Remove unsafe global mem_ctx pointer
    
        NOTE: This is a candidate for the 9.0 branch.
    
        Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
        Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
        Reviewed-by: Brian Paul <brianp@vmware.com>
        Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
        (cherry picked from commit ab097dde0c958dd8b1c06a07ef8913512753760c)
    
    Patch 6:
        meta: Rearrange shader creation in setup_glsl_generate_mipmap
    
        The diff looks weird, but this moves the code from the first 'if
        (ctx->Const.GLSLVersion < 130)' block down into the second block.  It
        also moves some variable decalarations closer to their use.
    
        NOTE: This is a candidate for the 9.0 branch.
    
        Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
        Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
        Reviewed-by: Brian Paul <brianp@vmware.com>
        Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
        (cherry picked from commit 3308c079bd00e9b9aa546f5214ce197a904d059b)
    
    Patch 7:
        meta: Don't use GLSL 1.30 shader on OpenGL ES 2
    
        Fixes GLES2 CoverageGL conformance test.
    
        NOTE: This is a candidate for the 9.0 branch.
    
        Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
        Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
        Reviewed-by: Brian Paul <brianp@vmware.com>
        Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
        (cherry picked from commit 0242381f06edb09dcf0eaacd6d26ccd8584700cc)

diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
index fe452cf..5f0b478 100644
--- a/src/mesa/drivers/common/meta.c
+++ b/src/mesa/drivers/common/meta.c
@@ -76,7 +76,7 @@
 #include "drivers/common/meta.h"
 #include "main/enums.h"
 #include "main/glformats.h"
-
+#include "../glsl/ralloc.h"
 
 /** Return offset in bytes of the field within a vertex struct */
 #define OFFSET(FIELD) ((void *) offsetof(struct vertex, FIELD))
@@ -272,6 +272,16 @@ struct bitmap_state
    struct temp_texture Tex;  /**< separate texture from other meta ops */
 };
 
+/**
+ * State for GLSL texture sampler which is used to generate fragment
+ * shader in _mesa_meta_generate_mipmap().
+ */
+struct glsl_sampler {
+   const char *type;
+   const char *func;
+   const char *texcoords;
+   GLuint shader_prog;
+};
 
 /**
  * State for _mesa_meta_generate_mipmap()
@@ -284,9 +294,14 @@ struct gen_mipmap_state
    GLuint Sampler;
    GLuint ShaderProg;
    GLuint IntegerShaderProg;
+   struct glsl_sampler sampler_1d;
+   struct glsl_sampler sampler_2d;
+   struct glsl_sampler sampler_3d;
+   struct glsl_sampler sampler_cubemap;
+   struct glsl_sampler sampler_1d_array;
+   struct glsl_sampler sampler_2d_array;
 };
 
-
 /**
  * State for texture decompression
  */
@@ -2979,7 +2994,7 @@ setup_texture_coords(GLenum faceTarget,
 
 static void
 setup_ff_generate_mipmap(struct gl_context *ctx,
-                           struct gen_mipmap_state *mipmap)
+                         struct gen_mipmap_state *mipmap)
 {
    struct vertex {
       GLfloat x, y, tex[3];
@@ -3008,31 +3023,62 @@ setup_ff_generate_mipmap(struct gl_context *ctx,
 }
 
 
+static struct glsl_sampler *
+setup_texture_sampler(GLenum target, struct gen_mipmap_state *mipmap)
+{
+   switch(target) {
+   case GL_TEXTURE_1D:
+      mipmap->sampler_1d.type = "sampler1D";
+      mipmap->sampler_1d.func = "texture1D";
+      mipmap->sampler_1d.texcoords = "texCoords.x";
+      return &mipmap->sampler_1d;
+   case GL_TEXTURE_2D:
+      mipmap->sampler_2d.type = "sampler2D";
+      mipmap->sampler_2d.func = "texture2D";
+      mipmap->sampler_2d.texcoords = "texCoords.xy";
+      return &mipmap->sampler_2d;
+   case GL_TEXTURE_3D:
+      /* Code for mipmap generation with 3D textures is not used yet.
+       * It's a sw fallback.
+       */
+      mipmap->sampler_3d.type = "sampler3D";
+      mipmap->sampler_3d.func = "texture3D";
+      mipmap->sampler_3d.texcoords = "texCoords";
+      return &mipmap->sampler_3d;
+   case GL_TEXTURE_CUBE_MAP:
+      mipmap->sampler_cubemap.type = "samplerCube";
+      mipmap->sampler_cubemap.func = "textureCube";
+      mipmap->sampler_cubemap.texcoords = "texCoords";
+      return &mipmap->sampler_cubemap;
+   case GL_TEXTURE_1D_ARRAY:
+      mipmap->sampler_1d_array.type = "sampler1DArray";
+      mipmap->sampler_1d_array.func = "texture1DArray";
+      mipmap->sampler_1d_array.texcoords = "texCoords.xy";
+      return &mipmap->sampler_1d_array;
+   case GL_TEXTURE_2D_ARRAY:
+      mipmap->sampler_2d_array.type = "sampler2DArray";
+      mipmap->sampler_2d_array.func = "texture2DArray";
+      mipmap->sampler_2d_array.texcoords = "texCoords";
+      return &mipmap->sampler_2d_array;
+   default:
+      _mesa_problem(NULL, "Unexpected texture target 0x%x in"
+                    " setup_texture_sampler()\n", target);
+      return NULL;
+   }
+}
+
+
 static void
 setup_glsl_generate_mipmap(struct gl_context *ctx,
-                           struct gen_mipmap_state *mipmap)
+                           struct gen_mipmap_state *mipmap,
+                           GLenum target)
 {
    struct vertex {
       GLfloat x, y, tex[3];
    };
+   struct glsl_sampler *sampler;
+   const char *vs_source;
 
-   static const char *vs_source =
-      "attribute vec2 position;\n"
-      "attribute vec3 textureCoords;\n"
-      "varying vec3 texCoords;\n"
-      "void main()\n"
-      "{\n"
-      "   texCoords = textureCoords;\n"
-      "   gl_Position = vec4(position, 0.0, 1.0);\n"
-      "}\n";
-   static const char *fs_source =
-      "uniform sampler2D tex2d;\n"
-      "varying vec3 texCoords;\n"
-      "void main()\n"
-      "{\n"
-      "   gl_FragColor = texture2D(tex2d, texCoords.xy);\n"
-      "}\n";
- 
    static const char *vs_int_source =
       "#version 130\n"
       "in vec2 position;\n"
@@ -3053,24 +3099,96 @@ setup_glsl_generate_mipmap(struct gl_context *ctx,
       "{\n"
       "   out_color = texture(tex2d, texCoords.xy);\n"
       "}\n";
+   char *fs_source;
    GLuint vs, fs;
+   void *mem_ctx;
 
    /* Check if already initialized */
-   if (mipmap->ArrayObj != 0)
-      return;
-   /* create vertex array object */
-   _mesa_GenVertexArrays(1, &mipmap->ArrayObj);
-   _mesa_BindVertexArray(mipmap->ArrayObj);
+   if (mipmap->ArrayObj == 0) {
 
-   /* create vertex array buffer */
-   _mesa_GenBuffersARB(1, &mipmap->VBO);
-   _mesa_BindBufferARB(GL_ARRAY_BUFFER_ARB, mipmap->VBO);
+      /* create vertex array object */
+      _mesa_GenVertexArrays(1, &mipmap->ArrayObj);
+      _mesa_BindVertexArray(mipmap->ArrayObj);
 
-   /* setup vertex arrays */
-   _mesa_VertexAttribPointerARB(0, 2, GL_FLOAT, GL_FALSE,
-                                sizeof(struct vertex), OFFSET(x));
-   _mesa_VertexAttribPointerARB(1, 3, GL_FLOAT, GL_FALSE,
-                                sizeof(struct vertex), OFFSET(tex));
+      /* create vertex array buffer */
+      _mesa_GenBuffersARB(1, &mipmap->VBO);
+      _mesa_BindBufferARB(GL_ARRAY_BUFFER_ARB, mipmap->VBO);
+
+      /* setup vertex arrays */
+      _mesa_VertexAttribPointerARB(0, 2, GL_FLOAT, GL_FALSE,
+                                   sizeof(struct vertex), OFFSET(x));
+      _mesa_VertexAttribPointerARB(1, 3, GL_FLOAT, GL_FALSE,
+                                   sizeof(struct vertex), OFFSET(tex));
+   }
+
+   /* Generate a fragment shader program appropriate for the texture target */
+   sampler = setup_texture_sampler(target, mipmap);
+   assert(sampler != NULL);
+   if (sampler->shader_prog != 0) {
+      mipmap->ShaderProg = sampler->shader_prog;
+      return;
+   }
+
+   mem_ctx = ralloc_context(NULL);
+
+   if (ctx->API == API_OPENGLES2 || ctx->Const.GLSLVersion < 130) {
+      const char *fs_template;
+      const char *extension_mode;
+
+      vs_source =
+         "attribute vec2 position;\n"
+         "attribute vec3 textureCoords;\n"
+         "varying vec3 texCoords;\n"
+         "void main()\n"
+         "{\n"
+         "   texCoords = textureCoords;\n"
+         "   gl_Position = vec4(position, 0.0, 1.0);\n"
+         "}\n";
+      fs_template =
+         "#extension GL_EXT_texture_array : %s\n"
+         "uniform %s texSampler;\n"
+         "varying vec3 texCoords;\n"
+         "void main()\n"
+         "{\n"
+         "   gl_FragColor = %s(texSampler, %s);\n"
+         "}\n";
+
+      extension_mode = ((target == GL_TEXTURE_1D_ARRAY) ||
+                        (target == GL_TEXTURE_2D_ARRAY)) ?
+                       "require" : "disable";
+
+      fs_source = ralloc_asprintf(mem_ctx, fs_template,
+                                  extension_mode, sampler->type,
+                                  sampler->func, sampler->texcoords);
+   }
+   else {
+      const char *fs_template;
+
+      vs_source =
+         "#version 130\n"
+         "in vec2 position;\n"
+         "in vec3 textureCoords;\n"
+         "out vec3 texCoords;\n"
+         "void main()\n"
+         "{\n"
+         "   texCoords = textureCoords;\n"
+         "   gl_Position = vec4(position, 0.0, 1.0);\n"
+         "}\n";
+      fs_template =
+         "#version 130\n"
+         "uniform %s texSampler;\n"
+         "in vec3 texCoords;\n"
+         "out %s out_color;\n"
+         "\n"
+         "void main()\n"
+         "{\n"
+         "   out_color = texture(texSampler, %s);\n"
+         "}\n";
+
+      fs_source = ralloc_asprintf(mem_ctx, fs_template,
+                                  sampler->type, "vec4",
+                                  sampler->texcoords);
+   }
 
    vs = compile_shader_with_debug(ctx, GL_VERTEX_SHADER, vs_source);
    fs = compile_shader_with_debug(ctx, GL_FRAGMENT_SHADER, fs_source);
@@ -3085,6 +3203,8 @@ setup_glsl_generate_mipmap(struct gl_context *ctx,
    _mesa_EnableVertexAttribArrayARB(0);
    _mesa_EnableVertexAttribArrayARB(1);
    link_program_with_debug(ctx, mipmap->ShaderProg);
+   sampler->shader_prog = mipmap->ShaderProg;
+   ralloc_free(mem_ctx);
 
    if ((_mesa_is_desktop_gl(ctx) && ctx->Const.GLSLVersion >= 130) ||
        _mesa_is_gles3(ctx)){
@@ -3118,8 +3238,20 @@ meta_glsl_generate_mipmap_cleanup(struct gl_context *ctx,
    mipmap->ArrayObj = 0;
    _mesa_DeleteBuffersARB(1, &mipmap->VBO);
    mipmap->VBO = 0;
-   _mesa_DeleteObjectARB(mipmap->ShaderProg);
-   mipmap->ShaderProg = 0;
+
+   _mesa_DeleteObjectARB(mipmap->sampler_1d.shader_prog);
+   _mesa_DeleteObjectARB(mipmap->sampler_2d.shader_prog);
+   _mesa_DeleteObjectARB(mipmap->sampler_3d.shader_prog);
+   _mesa_DeleteObjectARB(mipmap->sampler_cubemap.shader_prog);
+   _mesa_DeleteObjectARB(mipmap->sampler_1d_array.shader_prog);
+   _mesa_DeleteObjectARB(mipmap->sampler_2d_array.shader_prog);
+
+   mipmap->sampler_1d.shader_prog = 0;
+   mipmap->sampler_2d.shader_prog = 0;
+   mipmap->sampler_3d.shader_prog = 0;
+   mipmap->sampler_cubemap.shader_prog = 0;
+   mipmap->sampler_1d_array.shader_prog = 0;
+   mipmap->sampler_2d_array.shader_prog = 0;
 
    if (mipmap->IntegerShaderProg) {
       _mesa_DeleteObjectARB(mipmap->IntegerShaderProg);
@@ -3177,7 +3309,7 @@ _mesa_meta_GenerateMipmap(struct gl_context *ctx, GLenum target,
     * GenerateMipmap function.
     */
    if (use_glsl_version) {
-      setup_glsl_generate_mipmap(ctx, mipmap);
+      setup_glsl_generate_mipmap(ctx, mipmap, target);
 
       if (texObj->_IsIntegerFormat)
          _mesa_UseProgramObjectARB(mipmap->IntegerShaderProg);

commit 7851d398def2df3f6836a500d67123eed50f3943
Author: Marek Olšák <maraeo@gmail.com>
Date:   Sat Oct 6 05:23:47 2012 +0200

    r600g: fix possible issue with stencil mipmap rendering
    
    Somehow I only hit this issue with my latest libdrm changes.
    This won't be needed with DB texturing.
    
    NOTE: This is a candidate for the 9.0 branch.
    (cherry picked from commit 9dfca930d7fcfda6767d3be9b1690d010f08fea5)

diff --git a/src/gallium/drivers/r600/evergreen_state.c b/src/gallium/drivers/r600/evergreen_state.c
index feeff10..6bf4247 100644
--- a/src/gallium/drivers/r600/evergreen_state.c
+++ b/src/gallium/drivers/r600/evergreen_state.c
@@ -1491,13 +1491,24 @@ static void evergreen_init_depth_surface(struct r600_context *rctx,
 
 	if (rtex->surface.flags & RADEON_SURF_SBUFFER) {
 		uint64_t stencil_offset = rtex->surface.stencil_offset;
-		unsigned stile_split = rtex->surface.stencil_tile_split;
+		unsigned i, stile_split = rtex->surface.stencil_tile_split;
 
 		stile_split = eg_tile_split(stile_split);
 		stencil_offset += r600_resource_va(screen, surf->base.texture);
 		stencil_offset += rtex->surface.level[level].offset / 4;
 		stencil_offset >>= 8;
 
+		/* We're guessing the stencil offset from the depth offset.
+		 * Make sure each mipmap level has a unique offset. */
+		for (i = 1; i <= level; i++) {
+			/* If two levels have the same address, add 256
+			 * to the offset of the smaller level. */
+			if ((rtex->surface.level[i-1].offset / 4) >> 8 ==
+			    (rtex->surface.level[i].offset / 4) >> 8) {
+				stencil_offset++;
+			}
+		}
+
 		surf->db_stencil_base = stencil_offset;
 		surf->db_stencil_info = 1 | S_028044_TILE_SPLIT(stile_split);
 	} else {

commit 19a15cd5ba320b71295c4afbe73c5d656f829ad8
Author: Brian Paul <brianp@vmware.com>
Date:   Tue Oct 2 09:52:55 2012 -0600

    mesa: remove bogus compressed texture size checks
    
    A compressed texture image size doesn't have to be a multiple of the
    compressed block size (only sub-images do).  Fixes issues when building
    compressed mipmaps because we often wind up with non-block-size images
    for the higher mipmap levels.
    
    Fixes https://bugs.freedesktop.org/show_bug.cgi?id=55445
    
    Note: This is a candidate for the stable branches.
    
    Reviewed-by: Eric Anholt <eric@anholt.net>
    Tested-by: Sven Arvidsson <sa@whiz.se>
    (cherry picked from commit df4a88ac4398ec4c152eb57a7129c07bb623edd7)

diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index 4b7fd1c..21646cc 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -2041,27 +2041,6 @@ compressed_texture_error_check(struct gl_context *ctx, GLint dimensions,
       goto error;
    }
 
-   /* check image size against compression block size */
-   {
-      gl_format texFormat =
-         ctx->Driver.ChooseTextureFormat(ctx, target, proxy_format,
-					 choose_format, choose_type);
-      GLuint bw, bh;
-
-      _mesa_get_format_block_size(texFormat, &bw, &bh);
-      if ((width > bw && width % bw > 0) ||
-          (height > bh && height % bh > 0)) {
-         /*
-          * Per GL_ARB_texture_compression:  GL_INVALID_OPERATION is
-          * generated [...] if any parameter combinations are not
-          * supported by the specific compressed internal format. 
-          */
-         reason = "invalid width or height for compression format";
-         error = GL_INVALID_OPERATION;
-         goto error;
-      }
-   }
-
    /* check image sizes */
    if (!ctx->Driver.TestProxyTexImage(ctx, proxyTarget, level,
 				      proxy_format, choose_format,
diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c
index 18429f5..f4cfa16 100644
--- a/src/mesa/main/texstore.c
+++ b/src/mesa/main/texstore.c
@@ -4490,12 +4490,6 @@ _mesa_store_compressed_texsubimage(struct gl_context *ctx, GLuint dims,
 
    _mesa_get_format_block_size(texFormat, &bw, &bh);
 
-   /* these should have been caught sooner */
-   ASSERT((width % bw) == 0 || width < bw);
-   ASSERT((height % bh) == 0 || height < bh);
-   ASSERT((xoffset % bw) == 0);
-   ASSERT((yoffset % bh) == 0);
-
    /* get pointer to src pixels (may be in a pbo which we'll map here) */
    data = _mesa_validate_pbo_compressed_teximage(ctx, imageSize, data,
                                                  &ctx->Unpack,

commit c566267f5c3b480c1a805790c45fc13ab52c98e2
Author: Anuj Phogat <anuj.phogat@gmail.com>
Date:   Fri Sep 21 15:16:38 2012 -0700

    intel/i965: Disable SampleAlphaToOne if dual source blending enabled
    
    From SandyBridge PRM, volume 2 Part 1, section 12.2.3, BLEND_STATE:
    DWord 1, Bit 30 (AlphaToOne Enable):
    "If Dual Source Blending is enabled, this bit must be disabled"
    
    Note: This is a candidate for stable branches.
    
    Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
    Reviewed-by: Eric Anholt <eric@anholt.net>
    (cherry picked from commit ea0d08872724b5e31e9e32db2338e15fdfdcc4de)

diff --git a/src/mesa/drivers/dri/i965/gen6_cc.c b/src/mesa/drivers/dri/i965/gen6_cc.c
index 6aeaaa2..e9c7f50 100644
--- a/src/mesa/drivers/dri/i965/gen6_cc.c
+++ b/src/mesa/drivers/dri/i965/gen6_cc.c
@@ -174,8 +174,17 @@ gen6_upload_blend_state(struct brw_context *brw)
          /* _NEW_MULTISAMPLE */
          blend[b].blend1.alpha_to_coverage =
             ctx->Multisample._Enabled && ctx->Multisample.SampleAlphaToCoverage;
-         blend[b].blend1.alpha_to_one =
-            ctx->Multisample._Enabled && ctx->Multisample.SampleAlphaToOne;
+
+	/* From SandyBridge PRM, volume 2 Part 1, section 8.2.3, BLEND_STATE:
+	 * DWord 1, Bit 30 (AlphaToOne Enable):
+	 * "If Dual Source Blending is enabled, this bit must be disabled"
+	 */
+	 if (ctx->Color.Blend[b]._UsesDualSrc)
+            blend[b].blend1.alpha_to_one = false;
+	 else
+	    blend[b].blend1.alpha_to_one =
+	       ctx->Multisample._Enabled && ctx->Multisample.SampleAlphaToOne;
+
          blend[b].blend1.alpha_to_coverage_dither = (brw->intel.gen >= 7);
       }
       else {

commit 8491e03b2befd7e9d16c5d17f95a83d91c5b16c9
Author: Kenneth Graunke <kenneth@whitecape.org>
Date:   Mon Oct 1 20:11:38 2012 -0700

    mesa: Flag _NEW_VARYING_VP_INPUTS when TexEnv programs are active.
    
    The idea here is to not flag _NEW_VARYING_VP_INPUTS when shaders (either
    GLSL or ARB vp/fp) are in use.  If either TNL or TexEnv programs are
    active, at least one stage is using fixed function.
    
    On Pineview, fixes 20 Piglit, 60 oglconforms, and 7 ES 1.1 conformance
    tests, as well as missing textures in Xonotic.  These were all
    regressions since commit fb4a34e60eb4c1bdc7b0fdcd98d1bf3038c354e8.
    
    NOTE: This is a candidate for the 9.0 branch.
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=49127
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54807
    Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
    Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
    (cherry picked from commit 7fa0f10cd85ccb5afbc3a961164011de70970ff3)

diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c
index 76946bd..fb8b71c 100644
--- a/src/mesa/main/state.c
+++ b/src/mesa/main/state.c
@@ -627,7 +627,8 @@ _mesa_set_varying_vp_inputs( struct gl_context *ctx,
        *
        * It's okay to check the VP pointer here, because this is called after
        * _mesa_update_state in the vbo module. */
-      if (ctx->VertexProgram._TnlProgram) {
+      if (ctx->VertexProgram._TnlProgram ||
+          ctx->FragmentProgram._TexEnvProgram) {
          ctx->NewState |= _NEW_VARYING_VP_INPUTS;
       }
       /*printf("%s %x\n", __FUNCTION__, varying_inputs);*/

commit 78c9adb17e158ef40f03b5041803991ea8a0aa27
Author: Paul Berry <stereotype441@gmail.com>
Date:   Wed Oct 3 14:20:17 2012 -0700

    mesa: don't enable glVertexPointer() when using API_OPENGLES2.
    
    This function is only present in GLES1 and in the OpenGL compatibility
    profile.
    
    Fixes the following "make check" failure:
    
        [----------] 1 test from DispatchSanity_test
        [ RUN      ] DispatchSanity_test.GLES2
        Mesa warning: couldn't open libtxc_dxtn.so, software DXTn
        compression/decompression unavailable
        dispatch_sanity.cpp:122: Failure
        Value of: table[i]
           Actual: 0x4de54e
        Expected: (_glapi_proc) _mesa_generic_nop
        Which is: 0x41af72
        i = 321
        [  FAILED  ] DispatchSanity_test.GLES2 (4 ms)
        [----------] 1 test from DispatchSanity_test (4 ms total)
    
    NOTE: This is a candidate for stable release branches.
    
    Reviewed-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
    Tested-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
    Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
    (cherry picked from commit 8f0b81bf7ddcdf5715a3e00af67395b91f27a243)

diff --git a/src/mesa/main/api_exec.c b/src/mesa/main/api_exec.c
index 30b1fb3..31fc270 100644
--- a/src/mesa/main/api_exec.c
+++ b/src/mesa/main/api_exec.c
@@ -353,8 +353,6 @@ _mesa_create_exec_table(struct gl_context *ctx)
       SET_NormalPointer(exec, _mesa_NormalPointer);
       SET_PrioritizeTextures(exec, _mesa_PrioritizeTextures);
       SET_TexCoordPointer(exec, _mesa_TexCoordPointer);
-   }
-   if (ctx->API != API_OPENGL_CORE) {
       SET_VertexPointer(exec, _mesa_VertexPointer);
    }
 #endif

commit e1cb50b15dbb75d1ba0fe184d05be7d302b058ee
Author: Robert Bragg <robert@linux.intel.com>
Date:   Tue Sep 18 16:10:03 2012 +0100

    SwapBuffersRegionNOK: invert rectangles on y axis
    
    The EGL_NOK_swap_region2 spec states that the rectangles are specified
    with a bottom-left origin within a surface coordinate space also with a
    bottom left origin, so this patch ensures the rectangles are flipped
    before passing them on to dri2_copy_region.
    
    Fixes piglit's egl-nok-swap-region test.
    
    Tested-by: Matt Turner <mattst88@gmail.com>
    (cherry picked from commit 0a523a8820e8a2549ac1c7887eb1892b228af44b)

diff --git a/src/egl/drivers/dri2/platform_x11.c b/src/egl/drivers/dri2/platform_x11.c
index 7486a91..939af86 100644
--- a/src/egl/drivers/dri2/platform_x11.c
+++ b/src/egl/drivers/dri2/platform_x11.c
@@ -778,10 +778,9 @@ dri2_swap_buffers_region(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw,
    if (numRects > (int)ARRAY_SIZE(rectangles))
       return dri2_copy_region(drv, disp, draw, dri2_surf->region);
 
-   /* FIXME: Invert y here? */
    for (i = 0; i < numRects; i++) {
       rectangles[i].x = rects[i * 4];
-      rectangles[i].y = rects[i * 4 + 1];
+      rectangles[i].y = dri2_surf->base.Height - rects[i * 4 + 1] - rects[i * 4 + 3];
       rectangles[i].width = rects[i * 4 + 2];
       rectangles[i].height = rects[i * 4 + 3];
    }

commit c8fda5f44a02ab8c1c50a052edc6b189f34352ae
Author: Matt Turner <mattst88@gmail.com>
Date:   Thu Sep 27 15:49:52 2012 -0700

    build: Set PTHREAD_LIBS for pkgconfig files if empty
    
    (cherry picked from dd4fde8f674f5e3efa19e929f97de4ecfd82391b)

diff --git a/configure.ac b/configure.ac
index 1a795ca..b8d0141 100644
--- a/configure.ac
+++ b/configure.ac
@@ -502,6 +502,10 @@ AC_CHECK_FUNC([posix_memalign], [DEFINES="$DEFINES -DHAVE_POSIX_MEMALIGN"])
 
 dnl Check for pthreads
 AX_PTHREAD
+dnl AX_PTHREADS leaves PTHREAD_LIBS empty for gcc and sets PTHREAD_CFLAGS
+dnl to -pthread, which causes problems if we need -lpthread to appear in
+dnl pkgconfig files.
+test -z "$PTHREAD_LIBS" && PTHREAD_LIBS="-lpthread"
 
 dnl SELinux awareness.
 AC_ARG_ENABLE([selinux],

commit 542f6feda9bf18267dbd337943a5e871400d425a
Author: Tom Stellard <thomas.stellard@amd.com>
Date:   Thu Sep 6 14:05:22 2012 +0000

    radeon/llvm: Remove R600InstrInfo.td from TD_FILES
    
    Fixes build bug introduced by
    cebbdd4ac23725963207bf6f8fc7101150e6065f
    (cherry picked from commit 2baaa5c7eb21517f0197bfd91154e9b4886fbb1b)

diff --git a/src/gallium/drivers/radeon/Makefile.sources b/src/gallium/drivers/radeon/Makefile.sources
index 4eb4fbb..0f874d7 100644
--- a/src/gallium/drivers/radeon/Makefile.sources
+++ b/src/gallium/drivers/radeon/Makefile.sources
@@ -10,7 +10,6 @@ TD_FILES := \
 	AMDILIntrinsics.td	\
 	AMDILRegisterInfo.td	\
 	Processors.td		\
-	R600InstrInfo.td	\
 	R600Instructions.td	\
 	R600Intrinsics.td	\
 	R600IntrinsicsNoOpenCL.td	\

commit 71b5503164deee189df5ac4e2b8d2fcd09a8ec55
Author: Tom Stellard <thomas.stellard@amd.com>
Date:   Wed Aug 29 13:01:15 2012 +0000

    radeon/llvm: Cleanup makefile
    
    Hopefully, this will fix all the parallel make problems people have
    been having.
    (cherry picked from commit cebbdd4ac23725963207bf6f8fc7101150e6065f)

diff --git a/src/gallium/drivers/radeon/Makefile b/src/gallium/drivers/radeon/Makefile
index 43f668a..7f1c613 100644
--- a/src/gallium/drivers/radeon/Makefile
+++ b/src/gallium/drivers/radeon/Makefile
@@ -20,8 +20,6 @@ tablegen = $(TBLGEN) -I $(LLVM_INCLUDEDIR) $1 $2 -o $3
 
 HAVE_LLVM_INTRINSICS = $(shell grep IntrinsicsR600.td $(LLVM_INCLUDEDIR)/llvm/Intrinsics.td)
 
-gen: $(GENERATED_SOURCES)
-
 SIRegisterInfo.td: SIGenRegisterInfo.pl
 	$(PERL) $^ > $@
 
@@ -38,37 +36,37 @@ endif
 R600RegisterInfo.td: R600GenRegisterInfo.pl
 	$(PERL) $^ > $@
 
-AMDGPUGenRegisterInfo.inc: *.td
+AMDGPUGenRegisterInfo.inc: $(TD_FILES)
 	$(call tablegen, -gen-register-info, AMDGPU.td, $@)
 
-AMDGPUGenInstrInfo.inc: *.td
+AMDGPUGenInstrInfo.inc: $(TD_FILES)
 	$(call tablegen, -gen-instr-info, AMDGPU.td, $@)
 
-AMDGPUGenAsmWriter.inc: *.td
+AMDGPUGenAsmWriter.inc: $(TD_FILES)
 	$(call tablegen, -gen-asm-writer, AMDGPU.td, $@)
 
-AMDGPUGenDAGISel.inc: *.td
+AMDGPUGenDAGISel.inc: $(TD_FILES)
 	$(call tablegen, -gen-dag-isel, AMDGPU.td, $@)
 
-AMDGPUGenCallingConv.inc: *.td
+AMDGPUGenCallingConv.inc: $(TD_FILES)
 	$(call tablegen, -gen-callingconv, AMDGPU.td, $@)
 
-AMDGPUGenSubtargetInfo.inc: *.td
+AMDGPUGenSubtargetInfo.inc: $(TD_FILES)
 	$(call tablegen, -gen-subtarget, AMDGPU.td, $@)
 
-AMDGPUGenEDInfo.inc: *.td
+AMDGPUGenEDInfo.inc: $(TD_FILES)
 	$(call tablegen, -gen-enhanced-disassembly-info, AMDGPU.td, $@)
 
-AMDGPUGenIntrinsics.inc: *.td
+AMDGPUGenIntrinsics.inc: $(TD_FILES)
 	$(call tablegen, -gen-tgt-intrinsic, AMDGPU.td, $@)
 
-AMDGPUGenCodeEmitter.inc: *.td
+AMDGPUGenCodeEmitter.inc: $(TD_FILES)
 	$(call tablegen, -gen-emitter, AMDGPU.td, $@)
 
-AMDGPUGenMCCodeEmitter.inc: *.td
+AMDGPUGenMCCodeEmitter.inc: $(TD_FILES)
 	$(call tablegen, -mc-emitter -gen-emitter, AMDGPU.td, $@)
 
-AMDGPUGenDFAPacketizer.inc: *.td
+AMDGPUGenDFAPacketizer.inc: $(TD_FILES)
 	$(call tablegen, -gen-dfa-packetizer, AMDGPU.td, $@)
 
 LOADER_LIBS=$(shell llvm-config --libs bitreader asmparser)
diff --git a/src/gallium/drivers/radeon/Makefile.sources b/src/gallium/drivers/radeon/Makefile.sources
index 687acb3..4eb4fbb 100644
--- a/src/gallium/drivers/radeon/Makefile.sources
+++ b/src/gallium/drivers/radeon/Makefile.sources
@@ -1,4 +1,30 @@
 
+TD_FILES := \
+	AMDGPU.td		\
+	AMDGPUInstrInfo.td	\
+	AMDGPUInstructions.td	\
+	AMDGPUIntrinsics.td	\
+	AMDGPURegisterInfo.td	\
+	AMDILBase.td		\
+	AMDILInstrInfo.td	\
+	AMDILIntrinsics.td	\
+	AMDILRegisterInfo.td	\
+	Processors.td		\
+	R600InstrInfo.td	\
+	R600Instructions.td	\
+	R600Intrinsics.td	\
+	R600IntrinsicsNoOpenCL.td	\
+	R600IntrinsicsOpenCL.td	\
+	R600RegisterInfo.td	\
+	R600Schedule.td		\
+	SIInstrFormats.td	\
+	SIInstrInfo.td		\
+	SIInstructions.td	\
+	SIIntrinsics.td		\
+	SIRegisterInfo.td	\
+	SISchedule.td
+
+
 GENERATED_SOURCES := \
 	R600Intrinsics.td		\
 	R600RegisterInfo.td		\

commit 1520d5fb27291cae2620c422df2c7cd2646bff40
Author: Timo Aaltonen <tjaalton@ubuntu.com>
Date:   Thu Oct 4 14:05:23 2012 +0300

    release to quantal

diff --git a/debian/changelog b/debian/changelog
index 567394f..c9c7ca2 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,7 @@


Reply to: