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

mesa: Changes to 'debian-unstable'



 VERSION                                                       |    2 
 configure.ac                                                  |    4 
 debian/changelog                                              |    2 
 docs/relnotes/10.2.7.html                                     |    3 
 docs/relnotes/10.2.8.html                                     |  128 ++++++++++
 src/gallium/auxiliary/gallivm/lp_bld_arit.c                   |    8 
 src/gallium/auxiliary/gallivm/lp_bld_debug.cpp                |    4 
 src/gallium/auxiliary/gallivm/lp_bld_misc.cpp                 |   30 ++
 src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp |   16 -
 src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp            |    4 
 src/gallium/drivers/nouveau/codegen/nv50_ir_target_nv50.cpp   |    2 
 src/gallium/drivers/nouveau/codegen/nv50_ir_target_nvc0.cpp   |    2 
 src/gallium/drivers/nouveau/codegen/nv50_ir_util.cpp          |    8 
 src/gallium/drivers/nouveau/codegen/nv50_ir_util.h            |    1 
 src/gallium/drivers/nouveau/nouveau_vp3_video.h               |    2 
 src/gallium/drivers/nouveau/nouveau_vp3_video_vp.c            |   46 +++
 src/gallium/drivers/nouveau/nv50/nv98_video_bsp.c             |   39 ++-
 src/gallium/drivers/nouveau/nv50/nv98_video_vp.c              |    1 
 src/gallium/drivers/nouveau/nvc0/nvc0_video.c                 |   10 
 src/gallium/drivers/nouveau/nvc0/nvc0_video_bsp.c             |   47 +++
 src/gallium/drivers/nouveau/nvc0/nvc0_video_vp.c              |    1 
 src/gallium/drivers/radeon/r600_query.c                       |   28 ++
 src/gallium/winsys/svga/drm/vmw_screen_dri.c                  |   13 -
 src/mesa/drivers/dri/nouveau/nouveau_render_t.c               |   20 -
 src/mesa/drivers/dri/nouveau/nv04_state_fb.c                  |    1 
 src/mesa/drivers/dri/nouveau/nv04_state_raster.c              |    7 
 src/mesa/drivers/dri/nouveau/nv10_state_fb.c                  |    1 
 src/mesa/drivers/dri/nouveau/nv10_state_raster.c              |    7 
 src/mesa/drivers/dri/nouveau/nv20_state_fb.c                  |    1 
 src/mesa/main/context.c                                       |    3 
 src/mesa/main/macros.h                                        |    7 
 src/mesa/state_tracker/st_extensions.c                        |    5 
 32 files changed, 387 insertions(+), 66 deletions(-)

New commits:
commit 9e64f905a5dd9500cba9e1d6a36c3c9bfe38efa9
Author: maximilian attems <maks@gluino>
Date:   Sun Oct 5 10:52:41 2014 +0200

    changelog update version to latest stable release
    
    Signed-off-by: maximilian attems <maks@gluino>

diff --git a/debian/changelog b/debian/changelog
index 42feb37..f80b5c6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-mesa (10.2.7-1) UNRELEASED; urgency=medium
+mesa (10.2.8-1) UNRELEASED; urgency=medium
 
   * New upstream release.
 

commit 1e2b4120f705b8258da8cbc31bdb9fbfcd118603
Author: Emil Velikov <emil.l.velikov@gmail.com>
Date:   Fri Sep 19 18:41:57 2014 +0100

    Add release notes for the 10.2.8 release
    
    Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>

diff --git a/docs/relnotes/10.2.8.html b/docs/relnotes/10.2.8.html
new file mode 100644
index 0000000..b0879d1
--- /dev/null
+++ b/docs/relnotes/10.2.8.html
@@ -0,0 +1,128 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd";>
+<html lang="en">
+<head>
+  <meta http-equiv="content-type" content="text/html; charset=utf-8">
+  <title>Mesa Release Notes</title>
+  <link rel="stylesheet" type="text/css" href="../mesa.css">
+</head>
+<body>
+
+<div class="header">
+  <h1>The Mesa 3D Graphics Library</h1>
+</div>
+
+<iframe src="../contents.html"></iframe>
+<div class="content">
+
+<h1>Mesa 10.2.8 Release Notes / September 19, 2014</h1>
+
+<p>
+Mesa 10.2.8 is a bug fix release which fixes bugs found since the 10.2.7 release.
+</p>
+<p>
+Mesa 10.2.8 implements the OpenGL 3.3 API, but the version reported by
+glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
+glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
+Some drivers don't support all the features required in OpenGL 3.3.  OpenGL
+3.3 is <strong>only</strong> available if requested at context creation
+because compatibility contexts are not supported.
+</p>
+
+<h2>SHA256 checksums</h2>
+<pre>
+TBD
+</pre>
+
+<h2>New features</h2>
+<p>None</p>
+
+<h2>Bug fixes</h2>
+
+<p>This list is likely incomplete.</p>
+
+<ul>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=77493";>Bug 77493</a> - lp_test_arit fails with llvm &gt;= llvm-3.5svn r206094</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82539";>Bug 82539</a> - vmw_screen_dri.lo In file included from vmw_screen_dri.c:41: vmwgfx_drm.h:32:17: error: drm.h: No such file or directory</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82882";>Bug 82882</a> - [swrast] piglit glsl-fs-uniform-bool-1 regression</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=83432";>Bug 83432</a> - r600_query.c:269:r600_emit_query_end: Assertion `ctx-&gt;num_pipelinestat_queries &gt; 0' failed [Gallium HUD]</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=83567";>Bug 83567</a> - Mesa 10.2.6 does not compile with llvm 3.5</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=83735";>Bug 83735</a> - [mesa-10.2.x] broken with llvm-3.5 and old CPUs</li>
+
+</ul>
+
+<h2>Changes</h2>
+<p>Aaron Watry (1):</p>
+<ul>
+  <li>gallivm: Fix build after LLVM commit 211259</li>
+</ul>
+
+<p>Christoph Bumiller (2):</p>
+<ul>
+  <li>nv50/ir/util: fix BitSet issues</li>
+  <li>nvc0/ir: clarify recursion fix to finding first tex uses</li>
+</ul>
+
+<p>Emil Velikov (3):</p>
+<ul>
+  <li>docs: Add sha256 sums for the 10.2.7 release</li>
+  <li>configure: bail out if building svga without libdrm</li>
+  <li>Update VERSION to 10.2.8</li>
+</ul>
+
+<p>Ilia Mirkin (4):</p>
+<ul>
+  <li>nv50/ir: avoid array overrun when checking for supported mods</li>
+  <li>nouveau: only enable the depth test if there actually is a depth buffer</li>
+  <li>nouveau: only enable stencil func if the visual has stencil bits</li>
+  <li>nouveau: change internal variables to avoid conflicts with macro args</li>
+</ul>
+
+<p>Jonathan Gray (1):</p>
+<ul>
+  <li>configure.ac: strip _GNU_SOURCE from llvm-config output</li>
+</ul>
+
+<p>José Fonseca (1):</p>
+<ul>
+  <li>gallivm: Disable workaround for PR12833 on LLVM 3.2+.</li>
+</ul>
+
+<p>Maarten Lankhorst (4):</p>
+<ul>
+  <li>nouveau: re-allocate bo's on overflow</li>
+  <li>nouveau: fix MPEG4 hw decoding</li>
+  <li>nouveau: rework reference frame handling</li>
+  <li>nouveau: remove unneeded assert</li>
+</ul>
+
+<p>Marek Olšák (3):</p>
+<ul>
+  <li>r600g,radeonsi: make sure there's enough CS space before resuming queries</li>
+  <li>mesa: set UniformBooleanTrue = 1.0f by default</li>
+  <li>st/mesa: use 1.0f as boolean true on drivers without integer support</li>
+</ul>
+
+<p>Richard Sandiford (1):</p>
+<ul>
+  <li>gallivm: Fix uses of 2^24</li>
+</ul>
+
+<p>Roland Scheidegger (1):</p>
+<ul>
+  <li>gallivm: set mcpu when initializing llvm execution engine</li>
+</ul>
+
+<p>Thomas Hellstrom (1):</p>
+<ul>
+  <li>winsys/svga: Fix incorrect type usage in IOCTL v2</li>
+</ul>
+
+</div>
+</body>
+</html>

commit d2fba17b3dfb2f6470ff2a2545bd35923a729fb3
Author: Emil Velikov <emil.l.velikov@gmail.com>
Date:   Fri Sep 19 18:21:08 2014 +0100

    Update VERSION to 10.2.8
    
    Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>

diff --git a/VERSION b/VERSION
index db28e98..23f56c8 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-10.2.7
+10.2.8

commit c68183afef3ee29e56f6d0b5571ad6e79664247b
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Jun 19 03:27:26 2014 +0200

    gallivm: set mcpu when initializing llvm execution engine
    
    Previously llvm detected cpu features automatically when the execution engine
    was created (based on host cpu). This is no longer the case, which meant llvm
    was then not able to emit some of the intrinsics we used as we didn't specify
    any sse attributes (only on avx supporting systems this was not a problem since
    despite at least some llvm versions enabling it anyway we always set this
    manually). So, instead of trying to figure out which MAttrs to set just set
    MCPU.
    
    This fixes https://bugs.freedesktop.org/show_bug.cgi?id=77493.
    
    Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
    Tested-by: Vinson Lee <vlee@freedesktop.org>
    (cherry picked from commit cad60420d5ea36a4b6fa2e6c91317f71423aa63e)
    
    Conflicts:
    	src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
    Nominated-by: Laurent Carlier <lordheavym@gmail.com>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83735

diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
index 45c985d..87247eb 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
+++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
@@ -73,6 +73,10 @@
 #include <llvm/Support/CBindingWrapping.h>
 #endif
 
+#if HAVE_LLVM >= 0x0305
+#include <llvm/Support/Host.h>
+#endif
+
 #include "pipe/p_config.h"
 #include "util/u_debug.h"
 #include "util/u_cpu_detect.h"
@@ -309,8 +313,8 @@ lp_build_create_jit_compiler_for_module(LLVMExecutionEngineRef *OutJIT,
       /*
        * AVX feature is not automatically detected from CPUID by the X86 target
        * yet, because the old (yet default) JIT engine is not capable of
-       * emitting the opcodes.  But as we're using MCJIT here, it is safe to
-       * add set this attribute.
+       * emitting the opcodes. On newer llvm versions it is and at least some
+       * versions (tested with 3.3) will emit avx opcodes without this anyway.
        */
       MAttrs.push_back("+avx");
       if (util_cpu_caps.has_f16c) {
@@ -320,7 +324,25 @@ lp_build_create_jit_compiler_for_module(LLVMExecutionEngineRef *OutJIT,
    }
    builder.setJITMemoryManager(JITMemoryManager::CreateDefaultMemManager());
 
+#if HAVE_LLVM >= 0x0305
+   StringRef MCPU = llvm::sys::getHostCPUName();
+   /*
+    * The cpu bits are no longer set automatically, so need to set mcpu manually.
+    * Note that the MAttrs set above will be sort of ignored (since we should
+    * not set any which would not be set by specifying the cpu anyway).
+    * It ought to be safe though since getHostCPUName() should include bits
+    * not only from the cpu but environment as well (for instance if it's safe
+    * to use avx instructions which need OS support). According to
+    * http://llvm.org/bugs/show_bug.cgi?id=19429 however if I understand this
+    * right it may be necessary to specify older cpu (or disable mattrs) though
+    * when not using MCJIT so no instructions are generated which the old JIT
+    * can't handle. Not entirely sure if we really need to do anything yet.
+    */
+   builder.setMCPU(MCPU);
+#endif
+
    ExecutionEngine *JIT;
+
 #if HAVE_LLVM >= 0x0302
    JIT = builder.create();
 #else

commit ff935f267ea67933bbafb661f2b8257179435450
Author: José Fonseca <jfonseca@vmware.com>
Date:   Wed May 14 12:55:50 2014 +0100

    gallivm: Disable workaround for PR12833 on LLVM 3.2+.
    
    Fixed upstream.
    
    (cherry picked from commit 172ef0c5a5a97c211702eb4033eeaac20993350e)
    Nominated-by: Evangelos Foutras <evangelos@foutrelis.com>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83735

diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
index d85adfb..45c985d 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
+++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
@@ -321,11 +321,11 @@ lp_build_create_jit_compiler_for_module(LLVMExecutionEngineRef *OutJIT,
    builder.setJITMemoryManager(JITMemoryManager::CreateDefaultMemManager());
 
    ExecutionEngine *JIT;
-#if 0
+#if HAVE_LLVM >= 0x0302
    JIT = builder.create();
 #else
    /*
-    * Workaround http://llvm.org/bugs/show_bug.cgi?id=12833
+    * Workaround http://llvm.org/PR12833
     */
    StringRef MArch = "";
    StringRef MCPU = "";

commit be5e98ac2b639e60abae848929121db32cb426b3
Author: Richard Sandiford <rsandifo@linux.vnet.ibm.com>
Date:   Mon Jul 21 16:53:35 2014 +0100

    gallivm: Fix uses of 2^24
    
    Fallback cases in lp_bld_arit.c used 2^24 to mean "2 to the power 24",
    but in C it's "2 xor 24", i.e. 26.  Fixed by using 1<< instead.
    
    Signed-off-by: Richard Sandiford <rsandifo@linux.vnet.ibm.com>
    Reviewed-by: Roland Scheidegger <sroland@vmware.com>
    Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
    Signed-off-by: Dave Airlie <airlied@redhat.com>
    (cherry picked from commit 1a65629ccc590fe04a97b6df63d73e349b793619)

diff --git a/src/gallium/auxiliary/gallivm/lp_bld_arit.c b/src/gallium/auxiliary/gallivm/lp_bld_arit.c
index e516ae8..dbda7bf 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_arit.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_arit.c
@@ -1852,7 +1852,7 @@ lp_build_trunc(struct lp_build_context *bld,
       const struct lp_type type = bld->type;
       struct lp_type inttype;
       struct lp_build_context intbld;
-      LLVMValueRef cmpval = lp_build_const_vec(bld->gallivm, type, 2^24);
+      LLVMValueRef cmpval = lp_build_const_vec(bld->gallivm, type, 1<<24);
       LLVMValueRef trunc, res, anosign, mask;
       LLVMTypeRef int_vec_type = bld->int_vec_type;
       LLVMTypeRef vec_type = bld->vec_type;
@@ -1907,7 +1907,7 @@ lp_build_round(struct lp_build_context *bld,
       const struct lp_type type = bld->type;
       struct lp_type inttype;
       struct lp_build_context intbld;
-      LLVMValueRef cmpval = lp_build_const_vec(bld->gallivm, type, 2^24);
+      LLVMValueRef cmpval = lp_build_const_vec(bld->gallivm, type, 1<<24);
       LLVMValueRef res, anosign, mask;
       LLVMTypeRef int_vec_type = bld->int_vec_type;
       LLVMTypeRef vec_type = bld->vec_type;
@@ -1960,7 +1960,7 @@ lp_build_floor(struct lp_build_context *bld,
       const struct lp_type type = bld->type;
       struct lp_type inttype;
       struct lp_build_context intbld;
-      LLVMValueRef cmpval = lp_build_const_vec(bld->gallivm, type, 2^24);
+      LLVMValueRef cmpval = lp_build_const_vec(bld->gallivm, type, 1<<24);
       LLVMValueRef trunc, res, anosign, mask;
       LLVMTypeRef int_vec_type = bld->int_vec_type;
       LLVMTypeRef vec_type = bld->vec_type;
@@ -2029,7 +2029,7 @@ lp_build_ceil(struct lp_build_context *bld,
       const struct lp_type type = bld->type;
       struct lp_type inttype;
       struct lp_build_context intbld;
-      LLVMValueRef cmpval = lp_build_const_vec(bld->gallivm, type, 2^24);
+      LLVMValueRef cmpval = lp_build_const_vec(bld->gallivm, type, 1<<24);
       LLVMValueRef trunc, res, anosign, mask, tmp;
       LLVMTypeRef int_vec_type = bld->int_vec_type;
       LLVMTypeRef vec_type = bld->vec_type;

commit 804e3fc92cb9d6d086253ec8d41ce182f999c0ff
Author: Ilia Mirkin <imirkin@alum.mit.edu>
Date:   Sat Sep 13 10:45:08 2014 -0400

    nouveau: change internal variables to avoid conflicts with macro args
    
    Reported by Coverity
    
    Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
    Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
    (cherry picked from commit b13a4ca3f7f622cbf688eec14d3f4156533af44e)

diff --git a/src/mesa/drivers/dri/nouveau/nouveau_render_t.c b/src/mesa/drivers/dri/nouveau/nouveau_render_t.c
index 0063dac..1625a87 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_render_t.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_render_t.c
@@ -56,21 +56,21 @@
  */
 #define EMIT_VBO(out, ctx, start, delta, n) do {			\
 		struct nouveau_render_state *render = to_render_state(ctx); \
-		int npush = n;						\
+		int _npush = n;						\
 									\
-		while (npush) {						\
-			int npack = MIN2(npush, MAX_PACKET * MAX_OUT_##out); \
-			npush -= npack;					\
+		while (_npush) {						\
+			int _npack = MIN2(_npush, MAX_PACKET * MAX_OUT_##out); \
+			_npush -= _npack;					\
 									\
-			BATCH_PACKET_##out((npack + MAX_OUT_##out - 1)	\
+			BATCH_PACKET_##out((_npack + MAX_OUT_##out - 1)	\
 					   / MAX_OUT_##out);		\
-			while (npack) {					\
-				int nout = MIN2(npack, MAX_OUT_##out);	\
-				npack -= nout;				\
+			while (_npack) {				\
+				int _nout = MIN2(_npack, MAX_OUT_##out);\
+				_npack -= _nout;			\
 									\
 				OUT_INDICES_##out(render, start, delta, \
-						  nout);		\
-				start += nout;				\
+						  _nout);		\
+				start += _nout;				\
 			}						\
 		}							\
 	} while (0)

commit 6eaa23d1ff693aaed127c5dc4c1ec503fc09afd8
Author: Ilia Mirkin <imirkin@alum.mit.edu>
Date:   Sat Aug 16 12:48:09 2014 -0400

    nouveau: only enable stencil func if the visual has stencil bits
    
    The _Enabled property already has the relevant information.
    
    Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
    Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
    (cherry picked from commit 3c81de58512f0615df1d90aa79a22c9a44c7189e)

diff --git a/src/mesa/drivers/dri/nouveau/nv04_state_raster.c b/src/mesa/drivers/dri/nouveau/nv04_state_raster.c
index 26cf32f..fbcc840 100644
--- a/src/mesa/drivers/dri/nouveau/nv04_state_raster.c
+++ b/src/mesa/drivers/dri/nouveau/nv04_state_raster.c
@@ -175,7 +175,7 @@ nv04_emit_control(struct gl_context *ctx, int emit)
 	if (ctx->Stencil.WriteMask[0])
 		nv04->ctrl[0] |= NV04_MULTITEX_TRIANGLE_CONTROL0_STENCIL_WRITE;
 
-	if (ctx->Stencil.Enabled)
+	if (ctx->Stencil._Enabled)
 		nv04->ctrl[1] |= NV04_MULTITEX_TRIANGLE_CONTROL1_STENCIL_ENABLE;
 
 	nv04->ctrl[1] |= get_comparison_op(ctx->Stencil.Function[0]) << 4 |
diff --git a/src/mesa/drivers/dri/nouveau/nv10_state_raster.c b/src/mesa/drivers/dri/nouveau/nv10_state_raster.c
index d34cf91..ffde87a 100644
--- a/src/mesa/drivers/dri/nouveau/nv10_state_raster.c
+++ b/src/mesa/drivers/dri/nouveau/nv10_state_raster.c
@@ -145,7 +145,7 @@ nv10_emit_stencil_func(struct gl_context *ctx, int emit)
 	struct nouveau_pushbuf *push = context_push(ctx);
 
 	BEGIN_NV04(push, NV10_3D(STENCIL_ENABLE), 1);
-	PUSH_DATAb(push, ctx->Stencil.Enabled);
+	PUSH_DATAb(push, ctx->Stencil._Enabled);
 
 	BEGIN_NV04(push, NV10_3D(STENCIL_FUNC_FUNC), 3);
 	PUSH_DATA (push, nvgl_comparison_op(ctx->Stencil.Function[0]));

commit e221e797b5fc6cfa072452fc3f6b13ee71afbf79
Author: Ilia Mirkin <imirkin@alum.mit.edu>
Date:   Fri Aug 15 01:25:06 2014 -0400

    nouveau: only enable the depth test if there actually is a depth buffer
    
    Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
    Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
    (cherry picked from commit 79959e5de518c59b327a9df4a6fa80a68213b873)

diff --git a/src/mesa/drivers/dri/nouveau/nv04_state_fb.c b/src/mesa/drivers/dri/nouveau/nv04_state_fb.c
index 8b0857d..4c17190 100644
--- a/src/mesa/drivers/dri/nouveau/nv04_state_fb.c
+++ b/src/mesa/drivers/dri/nouveau/nv04_state_fb.c
@@ -93,6 +93,7 @@ nv04_emit_framebuffer(struct gl_context *ctx, int emit)
 
 	/* Recompute the scissor state. */
 	context_dirty(ctx, SCISSOR);
+	context_dirty(ctx, CONTROL);
 }
 
 void
diff --git a/src/mesa/drivers/dri/nouveau/nv04_state_raster.c b/src/mesa/drivers/dri/nouveau/nv04_state_raster.c
index 4126119..26cf32f 100644
--- a/src/mesa/drivers/dri/nouveau/nv04_state_raster.c
+++ b/src/mesa/drivers/dri/nouveau/nv04_state_raster.c
@@ -123,6 +123,7 @@ void
 nv04_emit_control(struct gl_context *ctx, int emit)
 {
 	struct nv04_context *nv04 = to_nv04_context(ctx);
+	struct gl_framebuffer *fb = ctx->DrawBuffer;
 	int cull = ctx->Polygon.CullFaceMode;
 	int front = ctx->Polygon.FrontFace;
 
@@ -146,9 +147,9 @@ nv04_emit_control(struct gl_context *ctx, int emit)
 				 NV04_TEXTURED_TRIANGLE_CONTROL_CULL_MODE_CCW;
 
 	/* Depth test. */
-	if (ctx->Depth.Test)
+	if (ctx->Depth.Test && fb->Visual.depthBits > 0)
 		nv04->ctrl[0] |= NV04_TEXTURED_TRIANGLE_CONTROL_Z_ENABLE;
-	if (ctx->Depth.Mask)
+	if (ctx->Depth.Mask && fb->Visual.depthBits > 0)
 		nv04->ctrl[0] |= NV04_TEXTURED_TRIANGLE_CONTROL_Z_WRITE;
 
 	nv04->ctrl[0] |= get_comparison_op(ctx->Depth.Func) << 16;
diff --git a/src/mesa/drivers/dri/nouveau/nv10_state_fb.c b/src/mesa/drivers/dri/nouveau/nv10_state_fb.c
index fb66b2d..7593184 100644
--- a/src/mesa/drivers/dri/nouveau/nv10_state_fb.c
+++ b/src/mesa/drivers/dri/nouveau/nv10_state_fb.c
@@ -152,6 +152,7 @@ nv10_emit_framebuffer(struct gl_context *ctx, int emit)
 
 	context_dirty(ctx, VIEWPORT);
 	context_dirty(ctx, SCISSOR);
+	context_dirty(ctx, DEPTH);
 }
 
 void
diff --git a/src/mesa/drivers/dri/nouveau/nv10_state_raster.c b/src/mesa/drivers/dri/nouveau/nv10_state_raster.c
index da414a0..d34cf91 100644
--- a/src/mesa/drivers/dri/nouveau/nv10_state_raster.c
+++ b/src/mesa/drivers/dri/nouveau/nv10_state_raster.c
@@ -97,11 +97,12 @@ void
 nv10_emit_depth(struct gl_context *ctx, int emit)
 {
 	struct nouveau_pushbuf *push = context_push(ctx);
+	struct gl_framebuffer *fb = ctx->DrawBuffer;
 
 	BEGIN_NV04(push, NV10_3D(DEPTH_TEST_ENABLE), 1);
-	PUSH_DATAb(push, ctx->Depth.Test);
+	PUSH_DATAb(push, ctx->Depth.Test && fb->Visual.depthBits > 0);
 	BEGIN_NV04(push, NV10_3D(DEPTH_WRITE_ENABLE), 1);
-	PUSH_DATAb(push, ctx->Depth.Mask);
+	PUSH_DATAb(push, ctx->Depth.Mask && fb->Visual.depthBits > 0);
 	BEGIN_NV04(push, NV10_3D(DEPTH_FUNC), 1);
 	PUSH_DATA (push, nvgl_comparison_op(ctx->Depth.Func));
 }
diff --git a/src/mesa/drivers/dri/nouveau/nv20_state_fb.c b/src/mesa/drivers/dri/nouveau/nv20_state_fb.c
index 6e3049e..cc6b6b0 100644
--- a/src/mesa/drivers/dri/nouveau/nv20_state_fb.c
+++ b/src/mesa/drivers/dri/nouveau/nv20_state_fb.c
@@ -128,6 +128,7 @@ nv20_emit_framebuffer(struct gl_context *ctx, int emit)
 	/* Recompute the viewport/scissor state. */
 	context_dirty(ctx, VIEWPORT);
 	context_dirty(ctx, SCISSOR);
+	context_dirty(ctx, DEPTH);
 }
 
 void

commit e1c04225c1164f1d3fe68d8015fb85f0061b0978
Author: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Date:   Wed Sep 10 17:06:34 2014 +0200

    nouveau: remove unneeded assert
    
    No idea why it was added, but the code runs fine even on videos
    where it triggers.
    
    Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
    Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
    (cherry picked from commit 8ab85bfcd5ddd44c50e5b384222731cb2a1a1496)

diff --git a/src/gallium/drivers/nouveau/nouveau_vp3_video_vp.c b/src/gallium/drivers/nouveau/nouveau_vp3_video_vp.c
index edbc82b..25283b7 100644
--- a/src/gallium/drivers/nouveau/nouveau_vp3_video_vp.c
+++ b/src/gallium/drivers/nouveau/nouveau_vp3_video_vp.c
@@ -271,7 +271,6 @@ nouveau_vp3_fill_picparm_mpeg4_vp(struct nouveau_vp3_decoder *dec,
 {
    struct mpeg4_picparm_vp pic_vp_stub = {}, *pic_vp = &pic_vp_stub;
    uint32_t ring, ret = 0x01014; // !async_shutdown << 16 | watchdog << 12 | irq_record << 4 | unk;
-   assert(!(dec->base.width & 0xf));
    *is_ref = desc->vop_coding_type <= 1;
 
    pic_vp->width = dec->base.width;

commit 768fac116dcbc25f36bdfde83b8507493641c714
Author: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Date:   Wed Sep 10 13:20:53 2014 +0200

    nouveau: rework reference frame handling
    
    Fixes a regression from "nouveau/vdec: small fixes to h264 handling"
    
    New picking order for frames:
     1. Vidbuf pointer matches.
     2. Take the first kicked ref.
     3. If that fails, take a ref that has a different last_used.
    
    Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
    Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
    (cherry picked from commit a41aad843108cec1901c88a76d5ceb4ede2e062b)

diff --git a/src/gallium/drivers/nouveau/nouveau_vp3_video_vp.c b/src/gallium/drivers/nouveau/nouveau_vp3_video_vp.c
index 06d7046..edbc82b 100644
--- a/src/gallium/drivers/nouveau/nouveau_vp3_video_vp.c
+++ b/src/gallium/drivers/nouveau/nouveau_vp3_video_vp.c
@@ -196,11 +196,15 @@ nouveau_vp3_handle_references(struct nouveau_vp3_decoder *dec, struct nouveau_vp
    /* Try to find a real empty spot first, there should be one..
     */
    for (i = 0; i < dec->base.max_references + 1; ++i) {
-      if (dec->refs[i].last_used != seq) {
+      if (dec->refs[i].vidbuf == target) {
          empty_spot = i;
          break;
-      }
+      } else if (!dec->refs[i].last_used) {
+         empty_spot = i;
+      } else if (empty_spot == ~0U && dec->refs[i].last_used != seq)
+         empty_spot = i;
    }
+
    assert(empty_spot < dec->base.max_references+1);
    dec->refs[empty_spot].last_used = seq;
 //   debug_printf("Kicked %p to add %p to slot %i\n", dec->refs[empty_spot].vidbuf, target, empty_spot);
@@ -463,14 +467,45 @@ void nouveau_vp3_vp_caps(struct nouveau_vp3_decoder *dec, union pipe_desc desc,
    case PIPE_VIDEO_FORMAT_MPEG12:
       *caps = nouveau_vp3_fill_picparm_mpeg12_vp(dec, desc.mpeg12, refs, is_ref, vp);
       nouveau_vp3_handle_references(dec, refs, dec->fence_seq, target);
+      switch (desc.mpeg12->picture_structure) {
+      case PIPE_MPEG12_PICTURE_STRUCTURE_FIELD_TOP:
+         dec->refs[target->valid_ref].decoded_top = 1;
+         break;
+      case PIPE_MPEG12_PICTURE_STRUCTURE_FIELD_BOTTOM:
+         dec->refs[target->valid_ref].decoded_bottom = 1;
+         break;
+      default:
+         dec->refs[target->valid_ref].decoded_top = 1;
+         dec->refs[target->valid_ref].decoded_bottom = 1;
+         break;
+      }
       return;
    case PIPE_VIDEO_FORMAT_MPEG4:
       *caps = nouveau_vp3_fill_picparm_mpeg4_vp(dec, desc.mpeg4, refs, is_ref, vp);
       nouveau_vp3_handle_references(dec, refs, dec->fence_seq, target);
+      // XXX: Correct?
+      if (!desc.mpeg4->interlaced) {
+         dec->refs[target->valid_ref].decoded_top = 1;
+         dec->refs[target->valid_ref].decoded_bottom = 1;
+      } else if (desc.mpeg4->top_field_first) {
+         if (!dec->refs[target->valid_ref].decoded_top)
+            dec->refs[target->valid_ref].decoded_top = 1;
+         else
+            dec->refs[target->valid_ref].decoded_bottom = 1;
+      } else {
+         if (!dec->refs[target->valid_ref].decoded_bottom)
+            dec->refs[target->valid_ref].decoded_bottom = 1;
+         else
+            dec->refs[target->valid_ref].decoded_top = 1;
+      }
       return;
    case PIPE_VIDEO_FORMAT_VC1: {
       *caps = nouveau_vp3_fill_picparm_vc1_vp(dec, desc.vc1, refs, is_ref, vp);
       nouveau_vp3_handle_references(dec, refs, dec->fence_seq, target);
+      if (desc.vc1->frame_coding_mode == 3)
+         debug_printf("Field-Interlaced possibly incorrectly handled\n");
+      dec->refs[target->valid_ref].decoded_top = 1;
+      dec->refs[target->valid_ref].decoded_bottom = 1;
       return;
    }
    case PIPE_VIDEO_FORMAT_MPEG4_AVC: {
diff --git a/src/gallium/drivers/nouveau/nv50/nv98_video_vp.c b/src/gallium/drivers/nouveau/nv50/nv98_video_vp.c
index 9cdb40b..e74abe2 100644
--- a/src/gallium/drivers/nouveau/nv50/nv98_video_vp.c
+++ b/src/gallium/drivers/nouveau/nv50/nv98_video_vp.c
@@ -59,7 +59,6 @@ static void dump_comm_vp(struct nouveau_vp3_decoder *dec, struct comm *comm, u32
 static void
 nv98_decoder_kick_ref(struct nouveau_vp3_decoder *dec, struct nouveau_vp3_video_buffer *target)
 {
-   dec->refs[target->valid_ref].vidbuf = NULL;
    dec->refs[target->valid_ref].last_used = 0;
 //   debug_printf("Unreffed %p\n", target);
 }
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_video_vp.c b/src/gallium/drivers/nouveau/nvc0/nvc0_video_vp.c
index 07170a0..33c7375 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_video_vp.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_video_vp.c
@@ -59,7 +59,6 @@ static void dump_comm_vp(struct nouveau_vp3_decoder *dec, struct comm *comm, u32
 static void
 nvc0_decoder_kick_ref(struct nouveau_vp3_decoder *dec, struct nouveau_vp3_video_buffer *target)
 {
-   dec->refs[target->valid_ref].vidbuf = NULL;
    dec->refs[target->valid_ref].last_used = 0;
 //   debug_printf("Unreffed %p\n", target);
 }

commit 4027062a3ce5fd4130b3a66498f69464170a276d
Author: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Date:   Wed Sep 10 13:18:54 2014 +0200

    nouveau: fix MPEG4 hw decoding
    
    Reorder some fields to make I-frame decoding work correctly.
    
    Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
    Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
    (cherry picked from commit 121ceb38f45daacc938349d9d5aa82776b78dbab)

diff --git a/src/gallium/drivers/nouveau/nouveau_vp3_video_vp.c b/src/gallium/drivers/nouveau/nouveau_vp3_video_vp.c
index 1dcb99c..06d7046 100644
--- a/src/gallium/drivers/nouveau/nouveau_vp3_video_vp.c
+++ b/src/gallium/drivers/nouveau/nouveau_vp3_video_vp.c
@@ -78,10 +78,10 @@ struct mpeg4_picparm_vp {
 	uint8_t top_field_first; // bool, written to vuc
 
 	uint8_t pad4[3]; // 59, 5a, 5b, contains garbage on blob
-	uint32_t pad5[0x10]; // 5c...9c non-inclusive, but WHY?
 
-	uint32_t intra[0x10]; // 9c
-	uint32_t non_intra[0x10]; // bc
+	uint32_t intra[0x10]; // 5c
+	uint32_t non_intra[0x10]; // 9c
+	uint32_t pad5[0x10]; // bc what does this do?
 	// udc..uff pad?
 };
 

commit d3c45235b62e35d6717294c6ee9999ee60f20e1e
Author: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Date:   Wed Sep 10 13:17:13 2014 +0200

    nouveau: re-allocate bo's on overflow
    
    The BSP bo might be too small to contain all of the bsp data,
    bump its size on overflow. Also bump inter_bo when this happens,
    it might be too small otherwise.
    
    Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
    Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
    (cherry picked from commit f6afed7076a6ef446dbec7cb10c8f8c60efafccd)

diff --git a/src/gallium/drivers/nouveau/nouveau_vp3_video.h b/src/gallium/drivers/nouveau/nouveau_vp3_video.h
index 5c1af71..279a1ce 100644
--- a/src/gallium/drivers/nouveau/nouveau_vp3_video.h
+++ b/src/gallium/drivers/nouveau/nouveau_vp3_video.h
@@ -39,6 +39,8 @@ struct nouveau_vp3_video_buffer {
 #define VP_OFFSET 0x200
 #define COMM_OFFSET 0x500
 
+#define NOUVEAU_VP3_BSP_RESERVED_SIZE 0x700
+
 #define NOUVEAU_VP3_DEBUG_FENCE 0
 
 #if NOUVEAU_VP3_DEBUG_FENCE
diff --git a/src/gallium/drivers/nouveau/nv50/nv98_video_bsp.c b/src/gallium/drivers/nouveau/nv50/nv98_video_bsp.c
index 97d4119..6058c22 100644
--- a/src/gallium/drivers/nouveau/nv50/nv98_video_bsp.c
+++ b/src/gallium/drivers/nouveau/nv50/nv98_video_bsp.c
@@ -42,8 +42,8 @@ nv98_decoder_bsp(struct nouveau_vp3_decoder *dec, union pipe_desc desc,
    struct nouveau_pushbuf *push = dec->pushbuf[0];
    enum pipe_video_format codec = u_reduce_video_profile(dec->base.profile);
    uint32_t bsp_addr, comm_addr, inter_addr;
-   uint32_t slice_size, bucket_size, ring_size;
-   uint32_t caps;
+   uint32_t slice_size, bucket_size, ring_size, bsp_size;
+   uint32_t caps, i;
    int ret;
    struct nouveau_bo *bsp_bo = dec->bsp_bo[comm_seq % NOUVEAU_VP3_VIDEO_QDEPTH];
    struct nouveau_bo *inter_bo = dec->inter_bo[comm_seq & 1];
@@ -65,6 +65,41 @@ nv98_decoder_bsp(struct nouveau_vp3_decoder *dec, union pipe_desc desc,
    fence_extra = 4;
 #endif
 
+   bsp_size = NOUVEAU_VP3_BSP_RESERVED_SIZE;
+   for (i = 0; i < num_buffers; i++)
+      bsp_size += num_bytes[i];
+   bsp_size += 256; /* the 4 end markers */
+
+   if (!bsp_bo || bsp_size > bsp_bo->size) {
+      struct nouveau_bo *tmp_bo = NULL;
+
+      /* round up to the nearest mb */
+      bsp_size += (1 << 20) - 1;
+      bsp_size &= ~((1 << 20) - 1);
+
+      ret = nouveau_bo_new(dec->bitplane_bo->device, NOUVEAU_BO_VRAM, 0, bsp_size, NULL, &tmp_bo);
+      if (ret) {
+         debug_printf("reallocating bsp %u -> %u failed with %i\n",
+                      bsp_bo ? (unsigned)bsp_bo->size : 0, bsp_size, ret);
+         return -1;
+      }
+      nouveau_bo_ref(NULL, &bsp_bo);
+      bo_refs[0].bo = dec->bsp_bo[comm_seq % NOUVEAU_VP3_VIDEO_QDEPTH] = bsp_bo = tmp_bo;
+   }
+
+   if (!inter_bo || bsp_bo->size * 4 > inter_bo->size) {
+      struct nouveau_bo *tmp_bo = NULL;
+
+      ret = nouveau_bo_new(dec->bitplane_bo->device, NOUVEAU_BO_VRAM, 0, bsp_bo->size * 4, NULL, &tmp_bo);
+      if (ret) {
+         debug_printf("reallocating inter %u -> %u failed with %i\n",
+                      inter_bo ? (unsigned)inter_bo->size : 0, (unsigned)bsp_bo->size * 4, ret);
+         return -1;
+      }
+      nouveau_bo_ref(NULL, &inter_bo);
+      bo_refs[1].bo = dec->inter_bo[comm_seq & 1] = inter_bo = tmp_bo;
+   }
+
    ret = nouveau_bo_map(bsp_bo, NOUVEAU_BO_WR, dec->client);
    if (ret) {
       debug_printf("map failed: %i %s\n", ret, strerror(-ret));
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_video.c b/src/gallium/drivers/nouveau/nvc0/nvc0_video.c
index 5871f59..48ffac1 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_video.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_video.c
@@ -173,16 +173,12 @@ nvc0_create_decoder(struct pipe_context *context,
       ret = nouveau_bo_new(screen->device, NOUVEAU_BO_VRAM,
                            0x100, 4 << 20, &cfg, &dec->inter_bo[0]);
    if (!ret) {
-      if (!kepler)
-         nouveau_bo_ref(dec->inter_bo[0], &dec->inter_bo[1]);
-      else
-         ret = nouveau_bo_new(screen->device, NOUVEAU_BO_VRAM,
-                              0x100, dec->inter_bo[0]->size, &cfg,
-                              &dec->inter_bo[1]);
+      ret = nouveau_bo_new(screen->device, NOUVEAU_BO_VRAM,
+                           0x100, dec->inter_bo[0]->size, &cfg,
+                           &dec->inter_bo[1]);
    }
    if (ret)
       goto fail;
-
    switch (u_reduce_video_profile(templ->profile)) {
    case PIPE_VIDEO_FORMAT_MPEG12: {
       codec = 1;
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_video_bsp.c b/src/gallium/drivers/nouveau/nvc0/nvc0_video_bsp.c
index 40696fa..9139bc1 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_video_bsp.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_video_bsp.c
@@ -42,8 +42,8 @@ nvc0_decoder_bsp(struct nouveau_vp3_decoder *dec, union pipe_desc desc,
    struct nouveau_pushbuf *push = dec->pushbuf[0];
    enum pipe_video_format codec = u_reduce_video_profile(dec->base.profile);
    uint32_t bsp_addr, comm_addr, inter_addr;
-   uint32_t slice_size, bucket_size, ring_size;
-   uint32_t caps;
+   uint32_t slice_size, bucket_size, ring_size, bsp_size;
+   uint32_t caps, i;
    int ret;
    struct nouveau_bo *bsp_bo = dec->bsp_bo[comm_seq % NOUVEAU_VP3_VIDEO_QDEPTH];
    struct nouveau_bo *inter_bo = dec->inter_bo[comm_seq & 1];
@@ -65,6 +65,49 @@ nvc0_decoder_bsp(struct nouveau_vp3_decoder *dec, union pipe_desc desc,
    fence_extra = 4;
 #endif
 
+   bsp_size = NOUVEAU_VP3_BSP_RESERVED_SIZE;
+   for (i = 0; i < num_buffers; i++)
+      bsp_size += num_bytes[i];
+   bsp_size += 256; /* the 4 end markers */
+
+   if (!bsp_bo || bsp_size > bsp_bo->size) {
+      union nouveau_bo_config cfg;
+      struct nouveau_bo *tmp_bo = NULL;
+
+      cfg.nvc0.tile_mode = 0x10;
+      cfg.nvc0.memtype = 0xfe;
+
+      /* round up to the nearest mb */
+      bsp_size += (1 << 20) - 1;
+      bsp_size &= ~((1 << 20) - 1);
+
+      ret = nouveau_bo_new(dec->bitplane_bo->device, NOUVEAU_BO_VRAM, 0, bsp_size, &cfg, &tmp_bo);
+      if (ret) {
+         debug_printf("reallocating bsp %u -> %u failed with %i\n",
+                      bsp_bo ? (unsigned)bsp_bo->size : 0, bsp_size, ret);
+         return -1;
+      }
+      nouveau_bo_ref(NULL, &bsp_bo);
+      bo_refs[0].bo = dec->bsp_bo[comm_seq % NOUVEAU_VP3_VIDEO_QDEPTH] = bsp_bo = tmp_bo;
+   }
+
+   if (!inter_bo || bsp_bo->size * 4 > inter_bo->size) {
+      union nouveau_bo_config cfg;
+      struct nouveau_bo *tmp_bo = NULL;
+
+      cfg.nvc0.tile_mode = 0x10;
+      cfg.nvc0.memtype = 0xfe;
+
+      ret = nouveau_bo_new(dec->bitplane_bo->device, NOUVEAU_BO_VRAM, 0, bsp_bo->size * 4, &cfg, &tmp_bo);
+      if (ret) {
+         debug_printf("reallocating inter %u -> %u failed with %i\n",
+                      inter_bo ? (unsigned)inter_bo->size : 0, (unsigned)bsp_bo->size * 4, ret);
+         return -1;
+      }
+      nouveau_bo_ref(NULL, &inter_bo);
+      bo_refs[1].bo = dec->inter_bo[comm_seq & 1] = inter_bo = tmp_bo;
+   }
+
    ret = nouveau_bo_map(bsp_bo, NOUVEAU_BO_WR, dec->client);
    if (ret) {
       debug_printf("map failed: %i %s\n", ret, strerror(-ret));

commit e4752221679c4fd67d8b5688b5735d2a4d45275a
Author: Jonathan Gray <jsg@jsg.id.au>
Date:   Sat Sep 6 01:44:41 2014 +1000

    configure.ac: strip _GNU_SOURCE from llvm-config output
    
    Mesa already defines _GNU_SOURCE for glibc based systems and defining
    _GNU_SOURCE will break the Mesa build on other systems such as OpenBSD.
    
    _GNU_SOURCE only seems to be included in llvm-config output when
    LLVM is built via autoconf and not when it is built by cmake.
    
    Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
    Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
    (cherry picked from commit c68073e65f15b0df43bec2df1d7470ed4cddd761)

diff --git a/configure.ac b/configure.ac
index 812cf65..c7212b7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1583,6 +1583,7 @@ strip_unwanted_llvm_flags() {
     # Use \> (marks the end of the word)
     echo `$1` | sed \
 	-e 's/-DNDEBUG\>//g' \
+	-e 's/-D_GNU_SOURCE\>//g' \
 	-e 's/-pedantic\>//g' \
 	-e 's/-Wcovered-switch-default\>//g' \
 	-e 's/-O.\>//g' \

commit af2a612912f008d0b65ecc96043ba876c5a0115d
Author: Emil Velikov <emil.l.velikov@gmail.com>
Date:   Fri Sep 5 14:06:20 2014 +0100

    configure: bail out if building svga without libdrm
    
    With recent commit we removed the NEED_NONNULL_WINSYS checks when
    selecting the hardware (inc svga) winsys. svga has only one winsys
    that explicitly requires libdrm (via it's bundled version of
    vmwgfx_drm.h) but configure.ac never really checks for it.
    
    Add the check early to prevent people from shooting themselves when
    they select the driver but lack libdrm.
    
    $ ./autogen.sh --disable-dri --disable-egl --disable-gallium-llvm
    --with-dri-drivers=swrast --with-gallium-drivers=svga,swrast
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82539
    Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
    Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
    (cherry picked from commit 40bb6f93139971a459dadf88d6dfc05791071e37)

diff --git a/configure.ac b/configure.ac
index dbfc4fc..812cf65 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1814,6 +1814,9 @@ if test -n "$with_gallium_drivers"; then
         case "x$driver" in
         xsvga)
             HAVE_GALLIUM_SVGA=yes
+            if test "x$have_libdrm" != xyes; then
+                AC_MSG_ERROR([Building svga requires libdrm >= $LIBDRM_REQUIRED])
+            fi
             GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS svga softpipe"
             gallium_require_drm_loader
             gallium_check_st "svga/drm" "dri-vmwgfx" ""

commit b8971318e75b4c9723cdbbd8be2fad03b80a358d
Author: Ilia Mirkin <imirkin@alum.mit.edu>
Date:   Sat Sep 6 11:41:36 2014 -0400

    nv50/ir: avoid array overrun when checking for supported mods
    
    Reported by Coverity
    
    Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
    Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
    (cherry picked from commit 874a9396c5adfdcff63139bf6ababb55c1253402)

diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_target_nv50.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_target_nv50.cpp
index c844fa4..ee2869c 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_target_nv50.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_target_nv50.cpp
@@ -448,7 +448,7 @@ TargetNV50::isModSupported(const Instruction *insn, int s, Modifier mod) const
          return false;
       }
    }
-   if (s > 3)
+   if (s >= 3)
       return false;
    return (mod & Modifier(opInfo[insn->op].srcMods[s])) == mod;
 }
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_target_nvc0.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_target_nvc0.cpp
index 395d5b5..fdff17c 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_target_nvc0.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_target_nvc0.cpp
@@ -417,7 +417,7 @@ TargetNVC0::isModSupported(const Instruction *insn, int s, Modifier mod) const
          return false;
       }
    }
-   if (s > 3)
+   if (s >= 3)
       return false;
    return (mod & Modifier(opInfo[insn->op].srcMods[s])) == mod;


Reply to: