VERSION                                                               |    2 
 bin/.cherry-ignore                                                    |    3 
 debian/changelog                                                      |   58 +
 debian/compat                                                         |    2 
 debian/control                                                        |    9 
 debian/patches/r600-sb-Fix-loop-optimization-related-hangs-on-eg.diff |  387 
++++++++++
 debian/patches/series                                                 |    3 
 debian/patches/vl-zscan-fix-Fix-trivial-sign-compare-warnings.diff    |   28 
 debian/patches/workaround-binutils-mips-844357.diff                   |   43 +
 debian/rules                                                          |   19 
 debian/source/format                                                  |    1 
 docs/relnotes/13.0.1.html                                             |    3 
 docs/relnotes/13.0.2.html                                             |  189 
++++
 docs/relnotes/13.0.3.html                                             |  176 
++++
 include/pci_ids/i965_pci_ids.h                                        |   24 
 src/amd/common/ac_nir_to_llvm.c                                       |   28 
 src/amd/vulkan/radv_cmd_buffer.c                                      |    1 
 src/amd/vulkan/radv_device.c                                          |   21 
 src/amd/vulkan/radv_formats.c                                         |    1 
 src/amd/vulkan/radv_image.c                                           |   35 
 src/amd/vulkan/radv_meta_bufimage.c                                   |   27 
 src/amd/vulkan/radv_meta_clear.c                                      |    2 
 src/amd/vulkan/radv_wsi.c                                             |    3 
 src/compiler/Makefile.glsl.am                                         |    5 
 src/compiler/glsl/builtin_functions.cpp                               |   12 
 src/compiler/glsl/cache.c                                             |   11 
 src/compiler/glsl/glcpp/glcpp-parse.y                                 |   25 
 src/compiler/glsl/glcpp/glcpp.h                                       |    9 
 src/compiler/glsl/glsl_lexer.ll                                       |    4 
 src/compiler/glsl/link_uniforms.cpp                                   |    2 
 src/compiler/glsl/linker.cpp                                          |    1 
 src/compiler/glsl/lower_output_reads.cpp                              |    1 
 src/compiler/nir/nir_opt_undef.c                                      |    4 
 src/compiler/spirv/vtn_glsl450.c                                      |   23 
 src/compiler/spirv/vtn_variables.c                                    |    8 
 src/egl/main/eglapi.c                                                 |    4 
 src/gallium/auxiliary/cso_cache/cso_cache.c                           |    4 
 src/gallium/auxiliary/tgsi/tgsi_info.c                                |    1 
 src/gallium/drivers/radeon/r600_pipe_common.c                         |    6 
 src/gallium/drivers/radeonsi/si_compute.c                             |   14 
 src/gallium/drivers/radeonsi/si_descriptors.c                         |   19 
 src/gallium/drivers/radeonsi/si_pipe.c                                |    5 
 src/gallium/drivers/radeonsi/si_shader.c                              |  183 
+++-
 src/gallium/drivers/radeonsi/si_shader.h                              |    2 
 src/gallium/drivers/radeonsi/si_state.c                               |   25 
 src/gallium/drivers/radeonsi/si_state_draw.c                          |   24 
 src/gallium/drivers/radeonsi/si_state_shaders.c                       |    7 
 src/gallium/drivers/vc4/vc4_context.h                                 |    8 
 src/gallium/drivers/vc4/vc4_draw.c                                    |    5 
 src/gallium/drivers/vc4/vc4_program.c                                 |   54 +
 src/gallium/drivers/vc4/vc4_qir.h                                     |    1 
 src/gallium/drivers/vc4/vc4_qpu_emit.c                                |    5 
 src/gallium/drivers/vc4/vc4_register_allocate.c                       |    5 
 src/gbm/backends/dri/gbm_dri.c                                        |    2 
 src/intel/common/gen_device_info.c                                    |   48 +
 src/intel/genxml/gen9.xml                                             |    2 
 src/intel/isl/isl.c                                                   |    2 
 src/intel/vulkan/anv_allocator.c                                      |   27 
 src/intel/vulkan/anv_blorp.c                                          |   24 
 src/intel/vulkan/anv_cmd_buffer.c                                     |    6 
 src/intel/vulkan/anv_descriptor_set.c                                 |   13 
 src/intel/vulkan/anv_device.c                                         |  244 
+++++-
 src/intel/vulkan/anv_formats.c                                        |    3 
 src/intel/vulkan/anv_gem.c                                            |    6 
 src/intel/vulkan/anv_genX.h                                           |    2 
 src/intel/vulkan/anv_image.c                                          |   28 
 src/intel/vulkan/anv_intel.c                                          |    2 
 src/intel/vulkan/anv_pass.c                                           |    3 
 src/intel/vulkan/anv_pipeline.c                                       |    6 
 src/intel/vulkan/anv_pipeline_cache.c                                 |    3 
 src/intel/vulkan/anv_private.h                                        |   28 
 src/intel/vulkan/anv_query.c                                          |    3 
 src/intel/vulkan/anv_wsi.c                                            |   19 
 src/intel/vulkan/gen8_cmd_buffer.c                                    |   29 
 src/intel/vulkan/genX_blorp_exec.c                                    |    2 
 src/intel/vulkan/genX_cmd_buffer.c                                    |   97 ++
 src/mesa/drivers/dri/i965/Makefile.am                                 |    7 
 src/mesa/drivers/dri/i965/brw_cs.c                                    |    2 
 src/mesa/drivers/dri/i965/brw_fs.cpp                                  |   10 
 src/mesa/drivers/dri/i965/brw_fs.h                                    |    6 
 src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp                 |   19 
 src/mesa/drivers/dri/i965/brw_fs_nir.cpp                              |    2 
 src/mesa/drivers/dri/i965/brw_sampler_state.c                         |   18 
 src/mesa/drivers/dri/i965/brw_state.h                                 |    9 
 src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.cpp                     |   11 
 src/mesa/drivers/dri/i965/intel_mipmap_tree.c                         |    2 
 src/mesa/drivers/dri/i965/test_fs_copy_propagation.cpp                |  213 
+++++
 src/mesa/main/api_validate.c                                          |    2 
 src/mesa/main/arbprogram.c                                            |   12 
 src/mesa/main/fbobject.c                                              |    1 
 src/mesa/main/hash.c                                                  |   18 
 src/mesa/main/pipelineobj.c                                           |    3 
 src/mesa/main/program_resource.c                                      |  111 --
 src/mesa/main/shaderapi.c                                             |   43 -
 src/vulkan/wsi/Makefile.sources                                       |    3 
 src/vulkan/wsi/wsi_common.h                                           |    1 
 src/vulkan/wsi/wsi_common_queue.h                                     |  155 
++++
 src/vulkan/wsi/wsi_common_wayland.c                                   |   56 -
 src/vulkan/wsi/wsi_common_x11.c                                       |  290 
++++++-
 99 files changed, 2571 insertions(+), 564 deletions(-)

New commits:
commit 00fde3033cb32579517ef4bb80ddbdf8522867a3
Author: Timo Aaltonen <tjaal...@debian.org>
Date:   Tue Jan 10 17:38:41 2017 +0200

    release to sid

diff --git a/debian/changelog b/debian/changelog
index 58a0d1e..f48b6ea 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-mesa (13.0.3-1) UNRELEASED; urgency=medium
+mesa (13.0.3-1) unstable; urgency=medium
 
   [ Timo Aaltonen ]
   * New upstream release.
@@ -12,7 +12,7 @@ mesa (13.0.3-1) UNRELEASED; urgency=medium
     GPU hangs on r600g (Evergreen and Northern Islands GPUs) in many
     games.
 
- -- Timo Aaltonen <tjaal...@debian.org>  Tue, 10 Jan 2017 14:42:30 +0200
+ -- Timo Aaltonen <tjaal...@debian.org>  Tue, 10 Jan 2017 17:38:23 +0200
 
 mesa (13.0.2-3) unstable; urgency=medium
 

commit 287b94855c2afa1f56bbdc6678f12706f64e3d99
Author: Andreas Boll <andreas.boll....@gmail.com>
Date:   Tue Jan 10 14:04:42 2017 +0100

    Add r600-sb-Fix-loop-optimization-related-hangs-on-eg.diff
    
    Fixes GPU hangs on r600g (Evergreen and Northern Islands GPUs) in many
    games.

diff --git a/debian/changelog b/debian/changelog
index 14215c6..58a0d1e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -8,6 +8,9 @@ mesa (13.0.3-1) UNRELEASED; urgency=medium
     decoding on radeon GPUs without native mpeg2 support (Closes:
     #846297).  Thanks to Jörg-Volker Peetz for reporting and tracking
     down this regression!
+  * Add r600-sb-Fix-loop-optimization-related-hangs-on-eg.diff: Fixes
+    GPU hangs on r600g (Evergreen and Northern Islands GPUs) in many
+    games.
 
  -- Timo Aaltonen <tjaal...@debian.org>  Tue, 10 Jan 2017 14:42:30 +0200
 
diff --git 
a/debian/patches/r600-sb-Fix-loop-optimization-related-hangs-on-eg.diff 
b/debian/patches/r600-sb-Fix-loop-optimization-related-hangs-on-eg.diff
new file mode 100644
index 0000000..f4c8e6a
--- /dev/null
+++ b/debian/patches/r600-sb-Fix-loop-optimization-related-hangs-on-eg.diff
@@ -0,0 +1,387 @@
+commit e933246013eef376804662f3fcf4646c143c6c88
+Author: Heiko Przybyl <lil_...@web.de>
+Date:   Sun Nov 20 14:42:28 2016 +0100
+
+    r600/sb: Fix loop optimization related hangs on eg
+    
+    Make sure unused ops and their references are removed, prior to entering
+    the GCM (global code motion) pass, to stop GCM from breaking the loop
+    logic and thus hanging the GPU.
+    
+    Turns out, that sb has problems with loops and node optimizations
+    regarding associative folding:
+    
+    - the global code motion (gcm) pass moves ops up a loop level/basic block
+    until they've fulfilled their total usage count
+    - if there are ops folded into others, the usage count won't be
+    fulfilled and thus the op moved way up to the top
+    - within GCM the op would be visited and their deps would be moved
+    alongside it, to fulfill the src constaints
+    - in a loop, an unused op is moved out of the loop and GCM would move
+    the src value ops up as well
+    - now here arises the problem: if the loop counter is one of the src
+    values it would get moved up as well, the loop break condition would
+    never get hit and the shader turn into an endless loop, resulting in the
+    GPU hanging and being reset
+    
+    A reduced (albeit nonsense) piglit example would be:
+    
+    [require]
+    GLSL >= 1.20
+    
+    [fragment shader]
+    
+    uniform int SIZE;
+    uniform vec4 lights[512];
+    
+    void main()
+    {
+        float x = 0;
+        for(int i = 0; i < SIZE; i++)
+            x += lights[2*i+1].x;
+    }
+    
+    [test]
+    uniform int SIZE 1
+    draw rect -1 -1 2 2
+    
+    Which gets optimized to:
+    
+    ===== SHADER #12 OPT ================================== PS/BARTS/EVERGREEN 
=====
+    ===== 42 dw ===== 1 gprs ===== 2 stack 
=========================================
+    ALU 3 @24
+         1      y: MOV                R0.y,  0
+                t: MULLO_UINT         R0.w,  [0x00000002 2.8026e-45].x, R0.z
+    
+    LOOP_START_DX10 @22
+    PUSH @6
+    ALU 1 @30 KC0[CB0:0-15]
+         2 M    x: PRED_SETGE_INT     __.x,  R0.z, KC0[0].x
+    JUMP @14 POP:1
+    LOOP_BREAK @20
+    POP @14 POP:1
+    ALU 2 @32
+         3      x: ADD_INT            R0.x,  R0.w, [0x00000002 2.8026e-45].x
+    
+    TEX 1 @36
+                   VFETCH             R0.x___, R0.x,   RID:0   MFC:16 UCF:0 
FMT[..]
+    ALU 1 @40
+         4      y: ADD                R0.y,  R0.y, R0.x
+    LOOP_END @4
+    EXPORT_DONE        PIXEL 0     R0.____  EOP
+    ===== SHADER_END 
===============================================================
+    
+    Notice R0.z being the loop counter/break condition relevant register
+    and being never incremented at all. Also some of the loop content
+    has been moved out of it, to fulfill the requirements for the one unused
+    op.
+    
+    With a debug build of mesa this would produce an error like
+    error at : PRED_SETGE_INT     __, __, EM.2,    R1.x.2||FP@R0.z, C0.x
+      : operand value R1.x.2||FP@R0.z was not previously written to its gpr
+    and the compilation would fail due to this. On a release build it gets
+    passed to the GPU.
+    
+    When using this patch, the loop remains intact:
+    
+    ===== SHADER #12 OPT ================================== PS/BARTS/EVERGREEN 
=====
+    ===== 48 dw ===== 1 gprs ===== 2 stack 
=========================================
+    ALU 2 @24
+         1      y: MOV                R0.y,  0
+                z: MOV                R0.z,  0
+    LOOP_START_DX10 @22
+    PUSH @6
+    ALU 1 @28 KC0[CB0:0-15]
+         2 M    x: PRED_SETGE_INT     __.x,  R0.z, KC0[0].x
+    JUMP @14 POP:1
+    LOOP_BREAK @20
+    POP @14 POP:1
+    ALU 4 @30
+         3      t: MULLO_UINT         T0.x,  [0x00000002 2.8026e-45].x, R0.z
+    
+         4      x: ADD_INT            R0.x,  T0.x, [0x00000002 2.8026e-45].x
+    
+    TEX 1 @40
+                   VFETCH             R0.x___, R0.x,   RID:0   MFC:16 UCF:0 
FMT[..]
+    ALU 2 @44
+         5      y: ADD                R0.y,  R0.y, R0.x
+                z: ADD_INT            R0.z,  R0.z, 1
+    LOOP_END @4
+    EXPORT_DONE        PIXEL 0     R0.____  EOP
+    ===== SHADER_END 
===============================================================
+    
+    Piglit: ./piglit summary console -d results/*_gpu_noglx
+            name: unpatched_gpu_noglx patched_gpu_noglx
+            ----  ------------------- -----------------
+            pass:               18016             18021
+            fail:                 748               743
+            crash:                  7                 7
+            skip:                1124              1124
+            timeout:                0                 0
+            warn:                  13                13
+            incomplete:             0                 0
+            dmesg-warn:             0                 0
+            dmesg-fail:             0                 0
+            changes:                0                 5
+            fixes:                  0                 5
+            regressions:            0                 0
+            total:              19908             19908
+    
+    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94900
+    Tested-by: Heiko Przybyl <lil_...@web.de>
+    Tested-on: Barts PRO HD6850
+    Signed-off-by: Heiko Przybyl <lil_...@web.de>
+    Signed-off-by: Marek Olšák <marek.ol...@amd.com>
+
+diff --git a/src/gallium/drivers/r600/sb/sb_dce_cleanup.cpp 
b/src/gallium/drivers/r600/sb/sb_dce_cleanup.cpp
+index 79aef91..abae2bf 100644
+--- a/src/gallium/drivers/r600/sb/sb_dce_cleanup.cpp
++++ b/src/gallium/drivers/r600/sb/sb_dce_cleanup.cpp
+@@ -30,6 +30,18 @@
+ 
+ namespace r600_sb {
+ 
++int dce_cleanup::run() {
++      int r;
++
++      // Run cleanup for as long as there are unused nodes.
++      do {
++              nodes_changed = false;
++              r = vpass::run();
++      } while (r == 0 && nodes_changed);
++
++      return r;
++}
++
+ bool dce_cleanup::visit(node& n, bool enter) {
+       if (enter) {
+       } else {
+@@ -110,7 +122,18 @@ bool dce_cleanup::visit(region_node& n, bool enter) {
+ void dce_cleanup::cleanup_dst(node& n) {
+       if (!cleanup_dst_vec(n.dst) && remove_unused &&
+                       !n.dst.empty() && !(n.flags & NF_DONT_KILL) && n.parent)
++      {
++              // Delete use references to the removed node from the src 
values.
++              for (vvec::iterator I = n.src.begin(), E = n.src.end(); I != E; 
++I) {
++                      value* v = *I;
++                      if (v && v->def && v->uses.size())
++                      {
++                              v->remove_use(&n);
++                      }
++              }
+               n.remove();
++              nodes_changed = true;
++      }
+ }
+ 
+ bool dce_cleanup::visit(container_node& n, bool enter) {
+@@ -130,7 +153,7 @@ bool dce_cleanup::cleanup_dst_vec(vvec& vv) {
+               if (v->gvn_source && v->gvn_source->is_dead())
+                       v->gvn_source = NULL;
+ 
+-              if (v->is_dead() || (remove_unused && !v->is_rel() && !v->uses))
++              if (v->is_dead() || (remove_unused && !v->is_rel() && 
!v->uses.size()))
+                       v = NULL;
+               else
+                       alive = true;
+diff --git a/src/gallium/drivers/r600/sb/sb_gcm.cpp 
b/src/gallium/drivers/r600/sb/sb_gcm.cpp
+index 236b2ea..9c75389 100644
+--- a/src/gallium/drivers/r600/sb/sb_gcm.cpp
++++ b/src/gallium/drivers/r600/sb/sb_gcm.cpp
+@@ -199,10 +199,9 @@ void gcm::td_release_val(value *v) {
+               sblog << "\n";
+       );
+ 
+-      use_info *u = v->uses;
+-      while (u) {
++      for (uselist::iterator I = v->uses.begin(), E = v->uses.end(); I != E; 
++I) {
++              use_info *u = *I;
+               if (u->op->parent != &pending) {
+-                      u = u->next;
+                       continue;
+               }
+ 
+@@ -212,6 +211,7 @@ void gcm::td_release_val(value *v) {
+                       sblog << "\n";
+               );
+ 
++              assert(uses[u->op] > 0);
+               if (--uses[u->op] == 0) {
+                       GCM_DUMP(
+                               sblog << "td        released : ";
+@@ -222,7 +222,6 @@ void gcm::td_release_val(value *v) {
+                       pending.remove_node(u->op);
+                       ready.push_back(u->op);
+               }
+-              u = u->next;
+       }
+ 
+ }
+diff --git a/src/gallium/drivers/r600/sb/sb_ir.cpp 
b/src/gallium/drivers/r600/sb/sb_ir.cpp
+index 5226893..d989dce 100644
+--- a/src/gallium/drivers/r600/sb/sb_ir.cpp
++++ b/src/gallium/drivers/r600/sb/sb_ir.cpp
+@@ -255,7 +255,7 @@ void container_node::expand() {
+ void node::remove() {parent->remove_node(this);
+ }
+ 
+-value_hash node::hash_src() {
++value_hash node::hash_src() const {
+ 
+       value_hash h = 12345;
+ 
+@@ -269,7 +269,7 @@ value_hash node::hash_src() {
+ }
+ 
+ 
+-value_hash node::hash() {
++value_hash node::hash() const {
+ 
+       if (parent && parent->subtype == NST_LOOP_PHI_CONTAINER)
+               return 47451;
+diff --git a/src/gallium/drivers/r600/sb/sb_ir.h 
b/src/gallium/drivers/r600/sb/sb_ir.h
+index 4fc4da2..74c0549 100644
+--- a/src/gallium/drivers/r600/sb/sb_ir.h
++++ b/src/gallium/drivers/r600/sb/sb_ir.h
+@@ -446,15 +446,16 @@ enum use_kind {
+ };
+ 
+ struct use_info {
+-      use_info *next;
+       node *op;
+       use_kind kind;
+       int arg;
+ 
+-      use_info(node *n, use_kind kind, int arg, use_info* next)
+-              : next(next), op(n), kind(kind), arg(arg) {}
++      use_info(node *n, use_kind kind, int arg)
++              : op(n), kind(kind), arg(arg) {}
+ };
+ 
++typedef std::list< use_info * > uselist;
++
+ enum constraint_kind {
+       CK_SAME_REG,
+       CK_PACKED_BS,
+@@ -498,7 +499,7 @@ public:
+       value_hash ghash;
+ 
+       node *def, *adef;
+-      use_info *uses;
++      uselist uses;
+ 
+       ra_constraint *constraint;
+       ra_chunk *chunk;
+@@ -585,6 +586,7 @@ public:
+       }
+ 
+       void add_use(node *n, use_kind kind, int arg);
++      void remove_use(const node *n);
+ 
+       value_hash hash();
+       value_hash rel_hash();
+@@ -790,8 +792,8 @@ public:
+       void replace_with(node *n);
+       void remove();
+ 
+-      virtual value_hash hash();
+-      value_hash hash_src();
++      virtual value_hash hash() const;
++      value_hash hash_src() const;
+ 
+       virtual bool fold_dispatch(expr_handler *ex);
+ 
+diff --git a/src/gallium/drivers/r600/sb/sb_pass.h 
b/src/gallium/drivers/r600/sb/sb_pass.h
+index 0346df1..e878f8c 100644
+--- a/src/gallium/drivers/r600/sb/sb_pass.h
++++ b/src/gallium/drivers/r600/sb/sb_pass.h
+@@ -124,7 +124,9 @@ class dce_cleanup : public vpass {
+ public:
+ 
+       dce_cleanup(shader &s) : vpass(s),
+-              remove_unused(s.dce_flags & DF_REMOVE_UNUSED) {}
++              remove_unused(s.dce_flags & DF_REMOVE_UNUSED), 
nodes_changed(false) {}
++
++      virtual int run();
+ 
+       virtual bool visit(node &n, bool enter);
+       virtual bool visit(alu_group_node &n, bool enter);
+@@ -140,6 +142,8 @@ private:
+       void cleanup_dst(node &n);
+       bool cleanup_dst_vec(vvec &vv);
+ 
++      // Did we alter/remove nodes during a single pass?
++      bool nodes_changed;
+ };
+ 
+ 
+diff --git a/src/gallium/drivers/r600/sb/sb_valtable.cpp 
b/src/gallium/drivers/r600/sb/sb_valtable.cpp
+index eb242b1..a8b7b49 100644
+--- a/src/gallium/drivers/r600/sb/sb_valtable.cpp
++++ b/src/gallium/drivers/r600/sb/sb_valtable.cpp
+@@ -220,17 +220,33 @@ void value::add_use(node* n, use_kind kind, int arg) {
+       dump::dump_op(n);
+       sblog << "     kind " << kind << "    arg " << arg << "\n";
+       }
+-      uses = new use_info(n, kind, arg, uses);
++      uses.push_back(new use_info(n, kind, arg));
+ }
+ 
+-unsigned value::use_count() {
+-      use_info *u = uses;
+-      unsigned c = 0;
+-      while (u) {
+-              ++c;
+-              u = u->next;
++struct use_node_comp {
++      explicit use_node_comp(const node *n) : n(n) {}
++      bool operator() (const use_info *u) {
++              return u->op->hash() == n->hash();
++      }
++
++      private:
++              const node *n;
++};
++
++void value::remove_use(const node *n) {
++      uselist::iterator it =
++              std::find_if(uses.begin(), uses.end(), use_node_comp(n));
++
++      if (it != uses.end())
++      {
++              // TODO assert((*it)->kind == kind) ?
++              // TODO assert((*it)->arg == arg) ?
++              uses.erase(it);
+       }
+-      return c;
++}
++
++unsigned value::use_count() {
++      return uses.size();
+ }
+ 
+ bool value::is_global() {
+@@ -274,13 +290,7 @@ bool value::is_prealloc() {
+ }
+ 
+ void value::delete_uses() {
+-      use_info *u, *c = uses;
+-      while (c) {
+-              u = c->next;
+-              delete c;
+-              c = u;
+-      }
+-      uses = NULL;
++      uses.erase(uses.begin(), uses.end());
+ }
+ 
+ void ra_constraint::update_values() {
+@@ -468,7 +478,7 @@ bool r600_sb::sb_value_set::add_vec(vvec& vv) {
+ bool r600_sb::sb_value_set::contains(value* v) {
+       unsigned b = v->uid - 1;
+       if (b < bs.size())
+-              return bs.get(v->uid - 1);
++              return bs.get(b);
+       else
+               return false;
+ }
diff --git a/debian/patches/series b/debian/patches/series
index 5e113b2..1c14631 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
 07_gallium-fix-build-failure-on-powerpcspe.diff
 workaround-binutils-mips-844357.diff
 vl-zscan-fix-Fix-trivial-sign-compare-warnings.diff
+r600-sb-Fix-loop-optimization-related-hangs-on-eg.diff

commit 345c35a7fd347a3cf87e6ea77c15b1e3c8a2359f
Author: Andreas Boll <andreas.boll....@gmail.com>
Date:   Tue Jan 10 14:03:39 2017 +0100

    Add vl-zscan-fix-Fix-trivial-sign-compare-warnings.diff
    
    Fixes mpeg2 decoding on radeon GPUs without native mpeg2 support
    (Closes: #846297).  Thanks to Jörg-Volker Peetz for reporting and
    tracking down this regression!

diff --git a/debian/changelog b/debian/changelog
index 9f1ae8b..14215c6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,7 +1,14 @@
 mesa (13.0.3-1) UNRELEASED; urgency=medium
 
+  [ Timo Aaltonen ]
   * New upstream release.
 
+  [ Andreas Boll ]
+  * Add vl-zscan-fix-Fix-trivial-sign-compare-warnings.diff: Fixes mpeg2
+    decoding on radeon GPUs without native mpeg2 support (Closes:
+    #846297).  Thanks to Jörg-Volker Peetz for reporting and tracking
+    down this regression!
+
  -- Timo Aaltonen <tjaal...@debian.org>  Tue, 10 Jan 2017 14:42:30 +0200
 
 mesa (13.0.2-3) unstable; urgency=medium
diff --git a/debian/patches/series b/debian/patches/series
index 4f7ab78..5e113b2 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
 07_gallium-fix-build-failure-on-powerpcspe.diff
 workaround-binutils-mips-844357.diff
+vl-zscan-fix-Fix-trivial-sign-compare-warnings.diff
diff --git a/debian/patches/vl-zscan-fix-Fix-trivial-sign-compare-warnings.diff 
b/debian/patches/vl-zscan-fix-Fix-trivial-sign-compare-warnings.diff
new file mode 100644
index 0000000..01e0533
--- /dev/null
+++ b/debian/patches/vl-zscan-fix-Fix-trivial-sign-compare-warnings.diff
@@ -0,0 +1,28 @@
+commit ac57bcda1e0e6dcfa81e24468d5b682686120649
+Author: Christian König <christian.koe...@amd.com>
+Date:   Wed Dec 14 15:03:35 2016 +0100
+
+    vl/zscan: fix "Fix trivial sign compare warnings"
+    
+    The variable actually needs to be signed, otherwise converting it to a
+    float doesn't work as expected.
+    
+    Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=98914
+    Signed-off-by: Christian König <christian.koe...@amd.com>
+    Reviewed-by: Nayan Deshmukh <nayan26deshm...@gmail.com>
+    Cc: "13.0" <mesa-sta...@lists.freedesktop.org>
+    Fixes: 1fb4179f927 ("vl: Fix trivial sign compare warnings")
+
+diff --git a/src/gallium/auxiliary/vl/vl_zscan.c 
b/src/gallium/auxiliary/vl/vl_zscan.c
+index ef05af4..24d6452 100644
+--- a/src/gallium/auxiliary/vl/vl_zscan.c
++++ b/src/gallium/auxiliary/vl/vl_zscan.c
+@@ -152,7 +152,7 @@ create_vert_shader(struct vl_zscan *zscan)
+    for (i = 0; i < zscan->num_channels; ++i) {
+       ureg_ADD(shader, ureg_writemask(tmp, TGSI_WRITEMASK_X), 
ureg_scalar(ureg_src(tmp), TGSI_SWIZZLE_Y),
+                ureg_imm1f(shader, 1.0f / (zscan->blocks_per_line * 
VL_BLOCK_WIDTH)
+-                * (i - (signed)zscan->num_channels / 2)));
++                * ((signed)i - (signed)zscan->num_channels / 2)));
+ 
+       ureg_MAD(shader, ureg_writemask(o_vtex[i], TGSI_WRITEMASK_X), vrect,
+                ureg_imm1f(shader, 1.0f / zscan->blocks_per_line), 
ureg_src(tmp));

commit 1e0422cf3c11f8b9bfb25ffaef75fd16ea4df10d
Author: Timo Aaltonen <tjaal...@debian.org>
Date:   Tue Jan 10 14:42:57 2017 +0200

    update the changelog

diff --git a/debian/changelog b/debian/changelog
index f5ba6d0..9f1ae8b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+mesa (13.0.3-1) UNRELEASED; urgency=medium
+
+  * New upstream release.
+
+ -- Timo Aaltonen <tjaal...@debian.org>  Tue, 10 Jan 2017 14:42:30 +0200
+
 mesa (13.0.2-3) unstable; urgency=medium
 
   * Fix typo to correctly disable asm on x32. Should fix FTBFS on x32.

commit bec04114d2612042bdf61183cfa3416b3a643b68
Author: Emil Velikov <emil.veli...@collabora.com>
Date:   Sat Dec 24 10:06:50 2016 +0000

    docs: add release notes for 13.0.3
    
    Signed-off-by: Emil Velikov <emil.veli...@collabora.com>

diff --git a/docs/relnotes/13.0.3.html b/docs/relnotes/13.0.3.html
new file mode 100644
index 0000000..585dafa
--- /dev/null
+++ b/docs/relnotes/13.0.3.html
@@ -0,0 +1,176 @@
+<!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 13.0.3 Release Notes / January 5, 2017</h1>
+
+<p>
+Mesa 13.0.3 is a bug fix release which fixes bugs found since the 13.0.2 
release.
+</p>
+<p>
+Mesa 13.0.3 implements the OpenGL 4.4 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 4.4.  OpenGL
+4.4 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>
+
+<ul>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=77662";>Bug 77662</a> 
- Fail to render to different faces of depth-stencil cube map</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=92234";>Bug 92234</a> 
- [BDW] GPU hang in Shogun2</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=98329";>Bug 98329</a> 
- [dEQP, EGL, SKL, BDW, BSW] 
dEQP-EGL.functional.image.render_multiple_contexts.gles2_renderbuffer_depth16_depth_buffer</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=99038";>Bug 99038</a> 
- [dEQP, EGL, SKL, BDW, BSW] 
dEQP-EGL.functional.negative_api.create_pixmap_surface crashes</li>
+
+</ul>
+
+
+<h2>Changes</h2>
+
+<p>Chad Versace (2):</p>
+<ul>
+  <li>i965/mt: Disable aux surfaces after making miptree shareable</li>
+  <li>egl: Fix crashes in eglCreate*Surface()</li>
+</ul>
+
+<p>Dave Airlie (4):</p>
+<ul>
+  <li>anv: set maxFragmentDualSrcAttachments to 1</li>
+  <li>radv: set maxFragmentDualSrcAttachments to 1</li>
+  <li>radv: fix another regression since shadow fixes.</li>
+  <li>radv: add missing license file to radv_meta_bufimage.</li>
+</ul>
+
+<p>Emil Velikov (5):</p>
+<ul>
+  <li>docs: add sha256 checksums for 13.0.2</li>
+  <li>anv: don't double-close the same fd</li>
+  <li>anv: don't leak memory if anv_init_wsi() fails</li>
+  <li>radv: don't leak the fd if radv_physical_device_init() succeeds</li>
+  <li>Update version to 13.0.3</li>
+</ul>
+
+<p>Eric Anholt (1):</p>
+<ul>
+  <li>vc4: In a loop break/continue, jump if everyone has taken the path.</li>
+</ul>
+
+<p>Gwan-gyeong Mun (3):</p>
+<ul>
+  <li>anv: Add missing error-checking to anv_block_pool_init (v2)</li>
+  <li>anv: Update the teardown in reverse order of the anv_CreateDevice</li>
+  <li>vulkan/wsi: Fix resource leak in success path of wsi_queue_init()</li>
+</ul>
+
+<p>Haixia Shi (1):</p>
+<ul>
+  <li>compiler/glsl: fix precision problem of tanh</li>
+</ul>
+
+<p>Ilia Mirkin (1):</p>
+<ul>
+  <li>mesa: only verify that enabled arrays have backing buffers</li>
+</ul>
+
+<p>Jason Ekstrand (8):</p>
+<ul>
+  <li>anv/cmd_buffer: Re-emit MEDIA_CURBE_LOAD when CS push constants are 
dirty</li>
+  <li>anv/image: Rename hiz_surface to aux_surface</li>
+  <li>anv/cmd_buffer: Remove the 1-D case from the HiZ QPitch calculation</li>
+  <li>genxml/gen9: Change the default of 
MI_SEMAPHORE_WAIT::RegisterPoleMode</li>
+  <li>anv/device: Return the right error for failed maps</li>
+  <li>anv/device: Implicitly unmap memory objects in FreeMemory</li>
+  <li>anv/descriptor_set: Write the state offset in the surface state free 
list.</li>
+  <li>spirv: Use a simpler and more correct implementaiton of tanh()</li>
+</ul>
+
+<p>Kenneth Graunke (1):</p>
+<ul>
+  <li>i965: Allocate at least some URB space even when max_vertices = 0.</li>
+</ul>
+
+<p>Marek Olšák (17):</p>
+<ul>
+  <li>radeonsi: always set all blend registers</li>
+  <li>radeonsi: set CB_BLEND1_CONTROL.ENABLE for dual source blending</li>
+  <li>radeonsi: disable RB+ blend optimizations for dual source blending</li>
+  <li>radeonsi: consolidate max-work-group-size computation</li>
+  <li>radeonsi: apply a multi-wave workgroup SPI bug workaround to affected 
CIK chips</li>
+  <li>radeonsi: apply a TC L1 write corruption workaround for SI</li>
+  <li>radeonsi: apply a tessellation bug workaround for SI</li>
+  <li>radeonsi: add a tess+GS hang workaround for VI dGPUs</li>
+  <li>radeonsi: apply the double EVENT_WRITE_EOP workaround to VI as well</li>
+  <li>cso: don't release sampler states that are bound</li>
+  <li>radeonsi: always restore sampler states when unbinding sampler views</li>
+  <li>radeonsi: fix incorrect FMASK checking in bind_sampler_states</li>
+  <li>radeonsi: allow specifying simm16 of emit_waitcnt at call sites</li>
+  <li>radeonsi: wait for outstanding memory instructions in TCS barriers</li>
+  <li>tgsi: fix the src type of TGSI_OPCODE_MEMBAR</li>
+  <li>radeonsi: wait for outstanding LDS instructions in memory barriers if 
needed</li>
+  <li>radeonsi: disable the constant engine (CE) on Carrizo and Stoney</li>
+</ul>
+
+<p>Matt Turner (3):</p>
+<ul>
+  <li>i965/fs: Rename opt_copy_propagate -&gt; opt_copy_propagation.</li>
+  <li>i965/fs: Add unit tests for copy propagation pass.</li>
+  <li>i965/fs: Reject copy propagation into SEL if not min/max.</li>
+</ul>
+
+<p>Nanley Chery (1):</p>
+<ul>
+  <li>mesa/fbobject: Update CubeMapFace when reusing textures</li>
+</ul>
+
+<p>Nicolai Hähnle (4):</p>
+<ul>
+  <li>radeonsi: fix isolines tess factor writes to control ring</li>
+  <li>radeonsi: update all GSVS ring descriptors for new buffer 
allocations</li>
+  <li>radeonsi: do not kill GS with memory writes</li>
+  <li>radeonsi: fix an off-by-one error in the bounds check for 
max_vertices</li>
+</ul>
+
+<p>Rhys Kidd (1):</p>
+<ul>
+  <li>glsl: Add pthread libs to cache_test</li>
+</ul>
+
+<p>Timothy Arceri (2):</p>
+<ul>
+  <li>mesa: fix active subroutine uniforms properly</li>
+  <li>Revert "nir: Turn imov/fmov of undef into undef."</li>
+</ul>
+
+
+</div>
+</body>
+</html>

commit a3d0bb354e762bf9e97d3a63a9470e3df1d2815d
Author: Emil Velikov <emil.veli...@collabora.com>
Date:   Sat Dec 24 10:00:26 2016 +0000

    Update version to 13.0.3
    
    Signed-off-by: Emil Velikov <emil.veli...@collabora.com>

diff --git a/VERSION b/VERSION
index 347caf3..2cb4f2f 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-13.0.2
+13.0.3

commit 241dc4634f47113243ddc6d02d4d73fc6f4e98e9
Author: Rhys Kidd <rhysk...@gmail.com>
Date:   Wed Oct 26 00:13:24 2016 -0400

    glsl: Add pthread libs to cache_test
    
    Fixes the following compile error, present when the SHA1 library is 
libgcrypt:
    
      CCLD     glsl/tests/cache-test
    glsl/.libs/libglsl.a(libmesautil_la-mesa-sha1.o): In function `call_once':
    /mesa/src/util/../../include/c11/threads_posix.h:96: undefined reference to 
`pthread_once'
    
    Signed-off-by: Rhys Kidd <rhysk...@gmail.com>
    Reviewed-by: Timothy Arceri <timothy.arc...@collabora.com>
    (cherry picked from commit 5c73ecaac487eba36e15f22be2e9396c4a0ffe46)

diff --git a/src/compiler/Makefile.glsl.am b/src/compiler/Makefile.glsl.am
index 80dfb73..15bea6b 100644
--- a/src/compiler/Makefile.glsl.am
+++ b/src/compiler/Makefile.glsl.am
@@ -62,8 +62,11 @@ glsl_tests_blob_test_LDADD =                         \
 
 glsl_tests_cache_test_SOURCES =                                \
        glsl/tests/cache_test.c
+glsl_tests_cache_test_CFLAGS =                         \
+       $(PTHREAD_CFLAGS)
 glsl_tests_cache_test_LDADD =                          \
-       glsl/libglsl.la
+       glsl/libglsl.la                                 \
+       $(PTHREAD_LIBS)
 
 glsl_tests_general_ir_test_SOURCES =                   \
        glsl/tests/builtin_variable_test.cpp            \

commit e851f2748773f205d89ded0c540378dfcc5ad565
Author: Matt Turner <matts...@gmail.com>
Date:   Mon Nov 28 15:21:51 2016 -0800

    i965/fs: Reject copy propagation into SEL if not min/max.
    
    We shouldn't ever see a SEL with conditional mod other than GE (for max)
    or L (for min), but we might see one with predication and no conditional
    mod.
    
    total instructions in shared programs: 8241806 -> 8241902 (0.00%)
    instructions in affected programs: 13284 -> 13380 (0.72%)
    HURT: 62
    
    total cycles in shared programs: 84165104 -> 84166244 (0.00%)
    cycles in affected programs: 75364 -> 76504 (1.51%)
    helped: 10
    HURT: 34
    
    Fixes generated code in at least Sanctum 2, Borderlands 2, Goat
    Simulator, XCOM: Enemy Unknown, and Shogun 2.
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92234
    Reviewed-by: Jason Ekstrand <ja...@jlekstrand.net>
    (cherry picked from commit 7bed52bb5fb4cfd5f91c902a654b3452f921da17)

diff --git a/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp 
b/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp
index 31ba202..da02fb1 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp
@@ -431,7 +431,9 @@ fs_visitor::try_copy_propagate(fs_inst *inst, int arg, 
acp_entry *entry)
    if (entry->saturate) {
       switch(inst->opcode) {
       case BRW_OPCODE_SEL:
-         if (inst->src[1].file != IMM ||
+         if ((inst->conditional_mod != BRW_CONDITIONAL_GE &&
+              inst->conditional_mod != BRW_CONDITIONAL_L) ||
+             inst->src[1].file != IMM ||
              inst->src[1].f < 0.0 ||
              inst->src[1].f > 1.0) {
             return false;
diff --git a/src/mesa/drivers/dri/i965/test_fs_copy_propagation.cpp 
b/src/mesa/drivers/dri/i965/test_fs_copy_propagation.cpp
index daba123..ed2f1e0 100644
--- a/src/mesa/drivers/dri/i965/test_fs_copy_propagation.cpp
+++ b/src/mesa/drivers/dri/i965/test_fs_copy_propagation.cpp
@@ -163,6 +163,15 @@ TEST_F(copy_propagation_test, maxmax_sat_imm)
       { BRW_CONDITIONAL_L   , -1.5f, false },
       { BRW_CONDITIONAL_GE  ,  1.5f, false },
       { BRW_CONDITIONAL_L   ,  1.5f, false },
+
+      { BRW_CONDITIONAL_NONE, 0.5f, false },
+      { BRW_CONDITIONAL_Z   , 0.5f, false },
+      { BRW_CONDITIONAL_NZ  , 0.5f, false },
+      { BRW_CONDITIONAL_G   , 0.5f, false },
+      { BRW_CONDITIONAL_LE  , 0.5f, false },
+      { BRW_CONDITIONAL_R   , 0.5f, false },
+      { BRW_CONDITIONAL_O   , 0.5f, false },
+      { BRW_CONDITIONAL_U   , 0.5f, false },
    };
 
    for (unsigned i = 0; i < sizeof(test) / sizeof(test[0]); i++) {

commit 4dd3f7c9a09bff9aed35c4be9922e5a784c51b4a
Author: Matt Turner <matts...@gmail.com>
Date:   Mon Nov 28 10:48:53 2016 -0800

    i965/fs: Add unit tests for copy propagation pass.
    
    Pretty basic, but it's a start.
    
    Acked-by: Jason Ekstrand <ja...@jlekstrand.net>
    (cherry picked from commit 091a8a04adb28a2044e3baadba0af52a185b3bd0)
    [Emil Velikov: nir_shader_create() has only three arguments]
    Signed-off-by: Emil Velikov <emil.veli...@collabora.com>

diff --git a/src/mesa/drivers/dri/i965/Makefile.am 
b/src/mesa/drivers/dri/i965/Makefile.am
index a192fc0..4b00977 100644
--- a/src/mesa/drivers/dri/i965/Makefile.am
+++ b/src/mesa/drivers/dri/i965/Makefile.am
@@ -106,6 +106,7 @@ TEST_LIBS = \
 
 TESTS = \
        test_fs_cmod_propagation \
+       test_fs_copy_propagation \
        test_fs_saturate_propagation \
         test_eu_compact \
        test_vf_float_conversions \
@@ -121,6 +122,12 @@ test_fs_cmod_propagation_LDADD = \
        $(top_builddir)/src/gtest/libgtest.la \
        $(TEST_LIBS)
 
+test_fs_copy_propagation_SOURCES = \
+       test_fs_copy_propagation.cpp
+test_fs_copy_propagation_LDADD = \
+       $(top_builddir)/src/gtest/libgtest.la \
+       $(TEST_LIBS)
+
 test_fs_saturate_propagation_SOURCES = \
        test_fs_saturate_propagation.cpp
 test_fs_saturate_propagation_LDADD = \
diff --git a/src/mesa/drivers/dri/i965/test_fs_copy_propagation.cpp 
b/src/mesa/drivers/dri/i965/test_fs_copy_propagation.cpp
new file mode 100644
index 0000000..daba123
--- /dev/null
+++ b/src/mesa/drivers/dri/i965/test_fs_copy_propagation.cpp
@@ -0,0 +1,204 @@
+/*
+ * Copyright © 2016 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation

Reply via email to