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

mesa: Changes to 'upstream-unstable'



Rebased ref, commits from common ancestor:
commit e60d010ef41f049df84d683a6465d1e5bf0cbb3d
Author: Andres Gomez <agomez@igalia.com>
Date:   Fri Jun 30 20:11:50 2017 +0300

    docs: add release notes for 17.1.4
    
    Signed-off-by: Andres Gomez <agomez@igalia.com>

diff --git a/docs/relnotes/17.1.4.html b/docs/relnotes/17.1.4.html
new file mode 100644
index 0000000..7d4673b
--- /dev/null
+++ b/docs/relnotes/17.1.4.html
@@ -0,0 +1,219 @@
+<!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 17.1.4 Release Notes / June 30, 2017</h1>
+
+<p>
+Mesa 17.1.4 is a bug fix release which fixes bugs found since the 17.1.3 release.
+</p>
+<p>
+Mesa 17.1.4 implements the OpenGL 4.5 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.5.  OpenGL
+4.5 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=77240";>Bug 77240</a> - khrplatform.h not installed if EGL is disabled</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=95530";>Bug 95530</a> - Stellaris - colored overlay of sectors doesn't render on i965</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=96958";>Bug 96958</a> - [SKL] Improper rendering in Europa Universalis IV</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=99467";>Bug 99467</a> - [radv] DOOM 2016 + wine. Green screen everywhere (but can be started)</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=101071";>Bug 101071</a> - compiling glsl fails with undefined reference to `pthread_create'</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=101252";>Bug 101252</a> - eglGetDisplay() is not thread safe</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=101294";>Bug 101294</a> - radeonsi minecraft forge splash freeze since 17.1</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=101451";>Bug 101451</a> - [G33] ES2-CTS.functional.clipping.polygon regression</li>
+
+</ul>
+
+
+<h2>Changes</h2>
+
+<p>Alex Deucher (1):</p>
+<ul>
+  <li>radeonsi: add new polaris12 pci id</li>
+</ul>
+
+<p>Andres Gomez (3):</p>
+<ul>
+  <li>cherry-ignore: 17.1.4 rejected commits</li>
+  <li>cherry-ignore: bin/get-fixes-pick-list.sh: better identify multiple "fixes:" tags</li>
+  <li>Update version to 17.1.4</li>
+</ul>
+
+<p>Anuj Phogat (2):</p>
+<ul>
+  <li>i965: Add and initialize l3_banks field for gen7+</li>
+  <li>i965: Fix broxton 2x6 l3 config</li>
+</ul>
+
+<p>Ben Crocker (1):</p>
+<ul>
+  <li>egl_dri2: swrastGetDrawableInfo: set *x, common.py [v2]</li>
+</ul>
+
+<p>Brian Paul (2):</p>
+<ul>
+  <li>svga: check return value from svga_set_shader( SVGA3D_SHADERTYPE_GS, NULL)</li>
+  <li>gallium/vbuf: avoid segfault when we get invalid glDrawRangeElements()</li>
+</ul>
+
+<p>Chad Versace (1):</p>
+<ul>
+  <li>egl/android: Change order of EGLConfig generation (v2)</li>
+</ul>
+
+<p>Chandu Babu N (1):</p>
+<ul>
+  <li>change va max_entrypoints</li>
+</ul>
+
+<p>Charmaine Lee (1):</p>
+<ul>
+  <li>svga: use the winsys interface to invalidate surface</li>
+</ul>
+
+<p>Emil Velikov (3):</p>
+<ul>
+  <li>docs: add sha256 checksums for 17.1.3</li>
+  <li>configure.ac: add -pthread to PTHREAD_LIBS</li>
+  <li>radeonsi: include ac_binary.h for struct ac_shader_binary</li>
+</ul>
+
+<p>Eric Engestrom (3):</p>
+<ul>
+  <li>egl: properly count configs</li>
+  <li>egl/display: only detect the platform once</li>
+  <li>egl/display: make platform detection thread-safe</li>
+</ul>
+
+<p>Eric Le Bihan (1):</p>
+<ul>
+  <li>Fix khrplatform.h not installed if EGL is disabled.</li>
+</ul>
+
+<p>Iago Toral Quiroga (1):</p>
+<ul>
+  <li>i965: update MaxTextureRectSize to match PRMs and comply with OpenGL 4.1+</li>
+</ul>
+
+<p>Ilia Mirkin (2):</p>
+<ul>
+  <li>nv50/ir: fetch indirect sources BEFORE the op that uses them</li>
+  <li>nv50/ir: fix combineLd/St to update existing records as necessary</li>
+</ul>
+
+<p>Jason Ekstrand (10):</p>
+<ul>
+  <li>i965: Flush around state base address</li>
+  <li>i965: Take a uint64_t immediate in emit_pipe_control_write</li>
+  <li>i965: Unify the two emit_pipe_control functions</li>
+  <li>i965: Do an end-of-pipe sync prior to STATE_BASE_ADDRESS</li>
+  <li>i965/blorp: Do an end-of-pipe sync around CCS ops</li>
+  <li>i965: Do an end-of-pipe sync after flushes</li>
+  <li>i965: Disable the interleaved vertex optimization when instancing</li>
+  <li>i965: Set step_rate = 0 for interleaved vertex buffers</li>
+  <li>spirv: Work around the Doom shader bug</li>
+  <li>i965: Clamp clear colors to the representable range</li>
+</ul>
+
+<p>Jonas Kulla (1):</p>
+<ul>
+  <li>anv: Fix L3 cache programming on Bay Trail</li>
+</ul>
+
+<p>Kenneth Graunke (1):</p>
+<ul>
+  <li>i965: Ignore anisotropic filtering in nearest mode.</li>
+</ul>
+
+<p>Lucas Stach (7):</p>
+<ul>
+  <li>etnaviv: don't try RS blit if blit region is unaligned</li>
+  <li>etnaviv: use padded width/height for resource copies</li>
+  <li>etnaviv: remove bogus assert</li>
+  <li>etnaviv: replace translate_clear_color with util_pack_color</li>
+  <li>etnaviv: mask correct channel for RB swapped rendertargets</li>
+  <li>etnaviv: advertise correct max LOD bias</li>
+  <li>etnaviv: only flush resource to self if no scanout buffer exists</li>
+</ul>
+
+<p>Marek Olšák (4):</p>
+<ul>
+  <li>winsys/amdgpu: fix a deadlock when waiting for submission_in_progress</li>
+  <li>mesa: flush vertices before changing viewports</li>
+  <li>mesa: flush vertices before updating ctx-&gt;_Shader</li>
+  <li>st/mesa: fix pipe_rasterizer_state::scissor with multiple viewports</li>
+</ul>
+
+<p>Michel Dänzer (1):</p>
+<ul>
+  <li>gallium/util: Break recursion in pipe_resource_reference</li>
+</ul>
+
+<p>Nicolai Hähnle (2):</p>
+<ul>
+  <li>gallium/radeon/gfx9: fix PBO texture uploads to compressed textures</li>
+  <li>amd/common: fix off-by-one in sid_tables.py</li>
+</ul>
+
+<p>Pierre Moreau (1):</p>
+<ul>
+  <li>nv50/ir: Properly fold constants in SPLIT operation</li>
+</ul>
+
+<p>Rob Herring (1):</p>
+<ul>
+  <li>Android: major/minor/makedev live in &lt;sys/sysmacros.h&gt;</li>
+</ul>
+
+<p>Topi Pohjolainen (2):</p>
+<ul>
+  <li>i965: Add an end-of-pipe sync helper</li>
+  <li>i965/gen4: Set depth offset when there is stencil attachment only</li>
+</ul>
+
+<p>Ville Syrjälä (2):</p>
+<ul>
+  <li>i915: Fix gl_Fragcoord interpolation</li>
+  <li>i915: Fix wpos_tex vs. -1 comparison</li>
+</ul>
+
+</div>
+</body>
+</html>

commit 9bb03507523041b2d1eb84ad7b2fe8ed1dcb5ff0
Author: Andres Gomez <agomez@igalia.com>
Date:   Fri Jun 30 20:09:16 2017 +0300

    Update version to 17.1.4
    
    Signed-off-by: Andres Gomez <agomez@igalia.com>

diff --git a/VERSION b/VERSION
index 0558d32..e7bcd48 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-17.1.3
+17.1.4

commit 03a0fdbdea137ed803cb5afdf122f0cd592475f5
Author: Andres Gomez <agomez@igalia.com>
Date:   Tue Jun 27 22:38:36 2017 +0300

    cherry-ignore: bin/get-fixes-pick-list.sh: better identify multiple "fixes:" tags
    
    fixes: Genuine false positive.
    
    Signed-off-by: Andres Gomez <agomez@igalia.com>

diff --git a/bin/.cherry-ignore b/bin/.cherry-ignore
index 936e570..95fe622 100644
--- a/bin/.cherry-ignore
+++ b/bin/.cherry-ignore
@@ -1,7 +1,8 @@
 # stable: This commit depends on 9fd9a7d0ba3 and 678d568c7b2, neither
 #         of which is in branch.
 b84b631c6381d9b36bca5d0e7cc67dd23af188c1 radeonsi: load patch_id for TES-as-ES when exporting for PS
-# This commit addressed an earlier commit 126d5ad which did not land in branch.
+# fixes:  This commit addressed an earlier commit 126d5ad which did not
+#         land in branch.
 9da104593386f6e8ddec8f0d9d288aceb8908fe1 radv: fix regression in descriptor set freeing.
 # stable: This commit addressed an earlier commit 944455217b which did
 #         not land in branch.
@@ -9,3 +10,5 @@ b28938ffce0580e89e6012826900da2b6013b0df st/glsl_to_tgsi: use correct writemask
 # stable: This commit depends on 330d0607e and 61d8f3387d, neither of
 #         which is in branch.
 c12f8305a8ae4fd5d78a9ab8bbda790a711d5bed nv50,nvc0: remove IDX from bufctx immediately, to avoid conflicts with clear
+# fixes:  Genuine false positive.
+5d87667fed1bd5ab850abdfb3a10db8c8c21c330 bin/get-fixes-pick-list.sh: better identify multiple "fixes:" tags" has more than one Fixes tag

commit 02b5d52bc3d6a8c1eeab7670d36551cc56e92d8c
Author: Andres Gomez <agomez@igalia.com>
Date:   Fri Jun 23 02:14:24 2017 +0300

    cherry-ignore: 17.1.4 rejected commits
    
    stable: rejected commits.
    
    Signed-off-by: Andres Gomez <agomez@igalia.com>

diff --git a/bin/.cherry-ignore b/bin/.cherry-ignore
index fc9bf36..936e570 100644
--- a/bin/.cherry-ignore
+++ b/bin/.cherry-ignore
@@ -1,4 +1,11 @@
-# This commit depends on 9fd9a7d0ba3 and 678d568c7b2, neither of which is in branch.
+# stable: This commit depends on 9fd9a7d0ba3 and 678d568c7b2, neither
+#         of which is in branch.
 b84b631c6381d9b36bca5d0e7cc67dd23af188c1 radeonsi: load patch_id for TES-as-ES when exporting for PS
 # This commit addressed an earlier commit 126d5ad which did not land in branch.
 9da104593386f6e8ddec8f0d9d288aceb8908fe1 radv: fix regression in descriptor set freeing.
+# stable: This commit addressed an earlier commit 944455217b which did
+#         not land in branch.
+b28938ffce0580e89e6012826900da2b6013b0df st/glsl_to_tgsi: use correct writemask when converting generic intrinsics
+# stable: This commit depends on 330d0607e and 61d8f3387d, neither of
+#         which is in branch.
+c12f8305a8ae4fd5d78a9ab8bbda790a711d5bed nv50,nvc0: remove IDX from bufctx immediately, to avoid conflicts with clear

commit 0069a613ac3b6ca75315cbb2fd3d86b0f6c9ede4
Author: Eric Le Bihan <eric.le.bihan.dev@free.fr>
Date:   Mon Jun 12 12:00:07 2017 +0100

    Fix khrplatform.h not installed if EGL is disabled.
    
    KHR/khrplatform.h is required by the EGL, GLES and VG headers, but is
    only installed if Mesa3d is compiled with EGL support.
    
    This patch installs this header file unconditionally.
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77240
    Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr>
    Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
    (cherry picked from commit 2154defcd698c7f9862bd235925cac75c0d5a520)

diff --git a/src/egl/Makefile.am b/src/egl/Makefile.am
index 14fd77f..8109038 100644
--- a/src/egl/Makefile.am
+++ b/src/egl/Makefile.am
@@ -163,9 +163,6 @@ pkgconfigdir = $(libdir)/pkgconfig
 
 pkgconfig_DATA = main/egl.pc
 
-khrdir = $(includedir)/KHR
-khr_HEADERS = $(top_srcdir)/include/KHR/khrplatform.h
-
 egldir = $(includedir)/EGL
 egl_HEADERS = \
 	$(top_srcdir)/include/EGL/eglext.h \
diff --git a/src/mapi/Makefile.am b/src/mapi/Makefile.am
index 7ebe14f..3133462 100644
--- a/src/mapi/Makefile.am
+++ b/src/mapi/Makefile.am
@@ -245,3 +245,6 @@ es2api/glapi_mapi_tmp.h: glapi/gen/gl_and_es_API.xml $(glapi_gen_mapi_deps)
 		$(srcdir)/glapi/gen/gl_and_es_API.xml > $@
 
 include $(top_srcdir)/install-lib-links.mk
+
+khrdir = $(includedir)/KHR
+khr_HEADERS = $(top_srcdir)/include/KHR/khrplatform.h

commit b7ad1fc50b057027afeaee895580f84eeb2c2731
Author: Rob Herring <robh@kernel.org>
Date:   Tue May 30 07:22:18 2017 -0500

    Android: major/minor/makedev live in <sys/sysmacros.h>
    
    sysmacros.h was getting implicitly included in types.h until recently in
    AOSP master. Define MAJOR_IN_SYSMACROS to explicitly include sysmacros.h.
    
    Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
    Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
    Signed-off-by: Rob Herring <robh@kernel.org>
    (cherry picked from commit e8f82bfd520e7f7185d178cdbecbb9b1bf2b2c1c)

diff --git a/Android.common.mk b/Android.common.mk
index 8acb0cc..e899a31 100644
--- a/Android.common.mk
+++ b/Android.common.mk
@@ -59,6 +59,7 @@ LOCAL_CFLAGS += \
 	-DHAVE_PTHREAD=1 \
 	-DHAVE_DLOPEN \
 	-DHAVE_DL_ITERATE_PHDR \
+	-DMAJOR_IN_SYSMACROS \
 	-fvisibility=hidden \
 	-Wno-sign-compare
 

commit 2cce0c2971797f6f45057156ce025c8736c9a11a
Author: Emil Velikov <emil.velikov@collabora.com>
Date:   Fri Jun 16 19:53:50 2017 +0100

    radeonsi: include ac_binary.h for struct ac_shader_binary
    
    The header embeds the struct so it needs the header inclusion instead of
    the dummy forward declaration.
    
    Cc: Nicolai Hähnle <nicolai.haehnle@amd.com>
    Cc: Marek Olšák <marek.olsak@amd.com>
    Cc: Tom Stellard <tstellar@redhat.com>
    Fixes: 32206c5e560 ("radeonsi: Add radeon_shader_binary member to struct
    si_shader")
    Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
    Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
    Tested-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
    
    (cherry picked from commit 1f958c1337290b4062a77f79fc101bb9f4bdf515)

diff --git a/src/gallium/drivers/radeonsi/si_shader.h b/src/gallium/drivers/radeonsi/si_shader.h
index cfa691b..2aac424 100644
--- a/src/gallium/drivers/radeonsi/si_shader.h
+++ b/src/gallium/drivers/radeonsi/si_shader.h
@@ -72,9 +72,9 @@
 #include <llvm-c/TargetMachine.h>
 #include "tgsi/tgsi_scan.h"
 #include "util/u_queue.h"
-#include "si_state.h"
 
-struct ac_shader_binary;
+#include "ac_binary.h"
+#include "si_state.h"
 
 #define SI_MAX_VS_OUTPUTS	40
 

commit 065643fe67e5b6ac7e7f0437d3a4a93474615b6c
Author: Ilia Mirkin <imirkin@alum.mit.edu>
Date:   Sat Jun 24 18:35:29 2017 -0400

    nv50/ir: fix combineLd/St to update existing records as necessary
    
    Previously the logic would decide that the record is kept, which
    translates into keep = false in the caller, which meant that these
    passes did not run.
    
    While it's right that keep = false which means that a new record does
    not need to be added, we do still have to perform the usual list
    maintenance. It's easiest to do this pre-merge rather than post.
    
    The lowering that clip/cull distance passes produce triggers this bug in
    TCS (since reading outputs is done differently in other stages), but it
    should be possible to achieve it with the right sequence of regular
    reads/writes.
    
    Fixes: KHR-GL45.cull_distance.functional
    Fixes: generated_tests/spec/arb_tessellation_shader/execution/tes-input/tes-input-gl_ClipDistance.shader_test
    Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
    Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
    Cc: mesa-stable@lists.freedesktop.org
    (cherry picked from commit 4a79f2be337cef920fc8ea5048fabc106bac492e)

diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
index 5dac2f6..0fbf6b8 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
@@ -2486,6 +2486,10 @@ MemoryOpt::combineLd(Record *rec, Instruction *ld)
 
    assert(sizeRc + sizeLd <= 16 && offRc != offLd);
 
+   // lock any stores that overlap with the load being merged into the
+   // existing record.
+   lockStores(ld);
+
    for (j = 0; sizeRc; sizeRc -= rec->insn->getDef(j)->reg.size, ++j);
 
    if (offLd < offRc) {
@@ -2542,6 +2546,10 @@ MemoryOpt::combineSt(Record *rec, Instruction *st)
    if (prog->getType() == Program::TYPE_COMPUTE && rec->rel[0])
       return false;
 
+   // remove any existing load/store records for the store being merged into
+   // the existing record.
+   purgeRecords(st, DATA_FILE_COUNT);
+
    st->takeExtraSources(0, extra); // save predicate and indirect address
 
    if (offRc < offSt) {

commit f47380a530d6fad530ecb84bd0ab136b39ec81c4
Author: Ilia Mirkin <imirkin@alum.mit.edu>
Date:   Sat Jun 24 12:08:52 2017 -0400

    nv50/ir: fetch indirect sources BEFORE the op that uses them
    
    All the BuildUtil helpers just insert the operation into the current BB.
    So we have to take care that any fetchSrc() operations happen before the
    operation whose setIndirect() it goes into.
    
    Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
    Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
    Cc: mesa-stable@lists.freedesktop.org
    (cherry picked from commit 8c02ee4a8b0bea5dda3ced341dce81f340457c95)

diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp
index 92cc13d..617e9a3 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp
@@ -2628,6 +2628,10 @@ Converter::handleLOAD(Value *dst0[4])
    const int r = tgsi.getSrc(0).getIndex(0);
    int c;
    std::vector<Value *> off, src, ldv, def;
+   Value *ind = NULL;
+
+   if (tgsi.getSrc(0).isIndirect(0))
+      ind = fetchSrc(tgsi.getSrc(0).getIndirect(0), 0, 0);
 
    switch (tgsi.getSrc(0).getFile()) {
    case TGSI_FILE_BUFFER:
@@ -2654,8 +2658,8 @@ Converter::handleLOAD(Value *dst0[4])
 
          Instruction *ld = mkLoad(TYPE_U32, dst0[c], sym, off);
          ld->cache = tgsi.getCacheMode();
-         if (tgsi.getSrc(0).isIndirect(0))
-            ld->setIndirect(0, 1, fetchSrc(tgsi.getSrc(0).getIndirect(0), 0, 0));
+         if (ind)
+            ld->setIndirect(0, 1, ind);
       }
       break;
    case TGSI_FILE_IMAGE: {
@@ -2677,8 +2681,8 @@ Converter::handleLOAD(Value *dst0[4])
       ld->tex.mask = tgsi.getDst(0).getMask();
       ld->tex.format = getImageFormat(code, r);
       ld->cache = tgsi.getCacheMode();
-      if (tgsi.getSrc(0).isIndirect(0))
-         ld->setIndirectR(fetchSrc(tgsi.getSrc(0).getIndirect(0), 0, NULL));
+      if (ind)
+         ld->setIndirectR(ind);
 
       FOR_EACH_DST_ENABLED_CHANNEL(0, c, tgsi)
          if (dst0[c] != def[c])
@@ -2766,6 +2770,10 @@ Converter::handleSTORE()
    const int r = tgsi.getDst(0).getIndex(0);
    int c;
    std::vector<Value *> off, src, dummy;
+   Value *ind = NULL;
+
+   if (tgsi.getDst(0).isIndirect(0))
+      ind = fetchSrc(tgsi.getDst(0).getIndirect(0), 0, 0);
 
    switch (tgsi.getDst(0).getFile()) {
    case TGSI_FILE_BUFFER:
@@ -2788,8 +2796,8 @@ Converter::handleSTORE()
 
          Instruction *st = mkStore(OP_STORE, TYPE_U32, sym, off, fetchSrc(1, c));
          st->cache = tgsi.getCacheMode();
-         if (tgsi.getDst(0).isIndirect(0))
-            st->setIndirect(0, 1, fetchSrc(tgsi.getDst(0).getIndirect(0), 0, 0));
+         if (ind)
+            st->setIndirect(0, 1, ind);
       }
       break;
    case TGSI_FILE_IMAGE: {
@@ -2807,8 +2815,8 @@ Converter::handleSTORE()
       st->tex.mask = tgsi.getDst(0).getMask();
       st->tex.format = getImageFormat(code, r);
       st->cache = tgsi.getCacheMode();
-      if (tgsi.getDst(0).isIndirect(0))
-         st->setIndirectR(fetchSrc(tgsi.getDst(0).getIndirect(0), 0, NULL));
+      if (ind)
+         st->setIndirectR(ind);
       }
       break;
    default:
@@ -2877,6 +2885,10 @@ Converter::handleATOM(Value *dst0[4], DataType ty, uint16_t subOp)
    std::vector<Value *> srcv;
    std::vector<Value *> defv;
    LValue *dst = getScratch();
+   Value *ind = NULL;
+
+   if (tgsi.getSrc(0).isIndirect(0))
+      ind = fetchSrc(tgsi.getSrc(0).getIndirect(0), 0, 0);
 
    switch (tgsi.getSrc(0).getFile()) {
    case TGSI_FILE_BUFFER:
@@ -2886,23 +2898,21 @@ Converter::handleATOM(Value *dst0[4], DataType ty, uint16_t subOp)
             continue;
 
          Instruction *insn;
-         Value *off = fetchSrc(1, c), *off2 = NULL;
+         Value *off = fetchSrc(1, c);
          Value *sym;
          if (tgsi.getSrc(1).getFile() == TGSI_FILE_IMMEDIATE)
             sym = makeSym(tgsi.getSrc(0).getFile(), r, -1, c,
                           tgsi.getSrc(1).getValueU32(c, info));
          else
             sym = makeSym(tgsi.getSrc(0).getFile(), r, -1, c, 0);
-         if (tgsi.getSrc(0).isIndirect(0))
-            off2 = fetchSrc(tgsi.getSrc(0).getIndirect(0), 0, 0);
          if (subOp == NV50_IR_SUBOP_ATOM_CAS)
             insn = mkOp3(OP_ATOM, ty, dst, sym, fetchSrc(2, c), fetchSrc(3, c));
          else
             insn = mkOp2(OP_ATOM, ty, dst, sym, fetchSrc(2, c));
          if (tgsi.getSrc(1).getFile() != TGSI_FILE_IMMEDIATE)
             insn->setIndirect(0, 0, off);
-         if (off2)
-            insn->setIndirect(0, 1, off2);
+         if (ind)
+            insn->setIndirect(0, 1, ind);
          insn->subOp = subOp;
       }
       for (int c = 0; c < 4; ++c)
@@ -2925,8 +2935,8 @@ Converter::handleATOM(Value *dst0[4], DataType ty, uint16_t subOp)
       tex->tex.mask = 1;
       tex->tex.format = getImageFormat(code, r);
       tex->setType(ty);
-      if (tgsi.getSrc(0).isIndirect(0))
-         tex->setIndirectR(fetchSrc(tgsi.getSrc(0).getIndirect(0), 0, NULL));
+      if (ind)
+         tex->setIndirectR(ind);
 
       for (int c = 0; c < 4; ++c)
          if (dst0[c])
@@ -3798,12 +3808,14 @@ Converter::handleInstruction(const struct tgsi_full_instruction *insn)
       break;
    case TGSI_OPCODE_RESQ:
       if (tgsi.getSrc(0).getFile() == TGSI_FILE_BUFFER) {
+         Value *ind = NULL;
+         if (tgsi.getSrc(0).isIndirect(0))
+            ind = fetchSrc(tgsi.getSrc(0).getIndirect(0), 0, 0);
          geni = mkOp1(OP_BUFQ, TYPE_U32, dst0[0],
                       makeSym(tgsi.getSrc(0).getFile(),
                               tgsi.getSrc(0).getIndex(0), -1, 0, 0));
-         if (tgsi.getSrc(0).isIndirect(0))
-            geni->setIndirect(0, 1,
-                              fetchSrc(tgsi.getSrc(0).getIndirect(0), 0, 0));
+         if (ind)
+            geni->setIndirect(0, 1, ind);
       } else {
          assert(tgsi.getSrc(0).getFile() == TGSI_FILE_IMAGE);
 
@@ -3816,10 +3828,11 @@ Converter::handleInstruction(const struct tgsi_full_instruction *insn)
          }
          texi->tex.r = tgsi.getSrc(0).getIndex(0);
          texi->tex.target = getImageTarget(code, texi->tex.r);
-         bb->insertTail(texi);
 
          if (tgsi.getSrc(0).isIndirect(0))
             texi->setIndirectR(fetchSrc(tgsi.getSrc(0).getIndirect(0), 0, NULL));
+
+         bb->insertTail(texi);
       }
       break;
    case TGSI_OPCODE_IBFE:

commit 8943444b03e485dea1362064c8073222440c24f3
Author: Iago Toral Quiroga <itoral@igalia.com>
Date:   Fri Jun 16 09:27:43 2017 +0200

    i965: update MaxTextureRectSize to match PRMs and comply with OpenGL 4.1+
    
    We were exposing 4096, but we can do up to 8192 in Gen4-6 and up to
    16384 in gen7+. OpenGL 4.1+ requires at least 16384.
    
    Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
    (cherry picked from commit b72b7c541dd81890e04652373f24840f580123ed)

diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c
index 1247d03..782543e 100644
--- a/src/mesa/drivers/dri/i965/brw_context.c
+++ b/src/mesa/drivers/dri/i965/brw_context.c
@@ -555,7 +555,7 @@ brw_initialize_context_constants(struct brw_context *brw)
    ctx->Const.Max3DTextureLevels = 12; /* 2048 */
    ctx->Const.MaxArrayTextureLayers = brw->gen >= 7 ? 2048 : 512;
    ctx->Const.MaxTextureMbytes = 1536;
-   ctx->Const.MaxTextureRectSize = 1 << 12;
+   ctx->Const.MaxTextureRectSize = brw->gen >= 7 ? 16384 : 8192;
    ctx->Const.MaxTextureMaxAnisotropy = 16.0;
    ctx->Const.MaxTextureLodBias = 15.0;
    ctx->Const.StripTextureBorder = true;

commit 8d5debbcc64b5e31d9f39b1a4de73f1df6f86eb1
Author: Nicolai Hähnle <nicolai.haehnle@amd.com>
Date:   Tue Jun 6 19:17:49 2017 +0200

    amd/common: fix off-by-one in sid_tables.py
    
    The very last entry in the sid_strings_offsets table ended up missing,
    leading to out-of-bounds reads and potential crashes.
    
    Reviewed-by: Marek Olšák <marek.olsak@amd.com>
    (cherry picked from commit 67e49a7f6570b8691d9405cb65f263b87817fe71)

diff --git a/src/amd/common/sid_tables.py b/src/amd/common/sid_tables.py
index fd88d3c..0a2b7ef 100644
--- a/src/amd/common/sid_tables.py
+++ b/src/amd/common/sid_tables.py
@@ -110,7 +110,7 @@ class IntTable:
         [static] const typename name[] = { ... };
         to filp.
         """
-        idxs = sorted(self.idxs) + [-1]
+        idxs = sorted(self.idxs) + [len(self.table)]
 
         fragments = [
             ('\t/* %s */ %s' % (

commit c2ed6935015655fa21772284a9998b918e406f04
Author: Eric Engestrom <eric@engestrom.ch>
Date:   Thu Jun 15 23:53:55 2017 +0100

    egl/display: make platform detection thread-safe
    
    Imagine there are 2 threads that both call _eglGetNativePlatform()
    simultaneously:
    - thread 1 completes the first "if (native_platform ==
      _EGL_INVALID_PLATFORM)" check and is preempted to do something else
    - thread 2 executes the whole function, does "native_platform =
      _EGL_NATIVE_PLATFORM" and just before returning it's preempted
    - thread 1 wakes up and calls _eglGetNativePlatformFromEnv() which
      returns _EGL_INVALID_PLATFORM because no env vars are set, updates
      native_platform and then gets preempted again
    - thread 2 wakes up and returns wrong _EGL_INVALID_PLATFORM
    
    Solve this by doing the detection in a local var and only overwriting
    the global one at the end, if no other thread has updated it since.
    
    This means the platform detected in the thread might not be the platform
    returned by the function, but this is a different issue that will need
    to be discussed when this becomes possible.
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101252
    Signed-off-by: Eric Engestrom <eric@engestrom.ch>
    Reviewed-by: Grazvydas Ignotas <notasas@gmail.com>
    Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
    (cherry picked from commit 311c09165881111c4a596ca7e7b4bce89b059e0f)

diff --git a/src/egl/main/egldisplay.c b/src/egl/main/egldisplay.c
index a6d41db..bb5076c 100644
--- a/src/egl/main/egldisplay.c
+++ b/src/egl/main/egldisplay.c
@@ -36,6 +36,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include "c11/threads.h"
+#include "util/u_atomic.h"
 
 #include "eglcontext.h"
 #include "eglcurrent.h"
@@ -181,25 +182,29 @@ _EGLPlatformType
 _eglGetNativePlatform(void *nativeDisplay)
 {
    static _EGLPlatformType native_platform = _EGL_INVALID_PLATFORM;
+   _EGLPlatformType detected_platform = native_platform;
 
-   if (native_platform == _EGL_INVALID_PLATFORM) {
+   if (detected_platform == _EGL_INVALID_PLATFORM) {
       const char *detection_method;
 
-      native_platform = _eglGetNativePlatformFromEnv();
+      detected_platform = _eglGetNativePlatformFromEnv();
       detection_method = "environment overwrite";
 
-      if (native_platform == _EGL_INVALID_PLATFORM) {
-         native_platform = _eglNativePlatformDetectNativeDisplay(nativeDisplay);
+      if (detected_platform == _EGL_INVALID_PLATFORM) {
+         detected_platform = _eglNativePlatformDetectNativeDisplay(nativeDisplay);
          detection_method = "autodetected";
       }
 
-      if (native_platform == _EGL_INVALID_PLATFORM) {
-         native_platform = _EGL_NATIVE_PLATFORM;
+      if (detected_platform == _EGL_INVALID_PLATFORM) {
+         detected_platform = _EGL_NATIVE_PLATFORM;
          detection_method = "build-time configuration";
       }
 
       _eglLog(_EGL_DEBUG, "Native platform type: %s (%s)",
-              egl_platforms[native_platform].name, detection_method);
+              egl_platforms[detected_platform].name, detection_method);
+
+      p_atomic_cmpxchg(&native_platform, _EGL_INVALID_PLATFORM,
+                       detected_platform);
    }
 
    return native_platform;

commit f9c7c9f48acd85ce759262fd40d9b11277bbc2b2
Author: Eric Engestrom <eric@engestrom.ch>
Date:   Thu Jun 15 23:53:54 2017 +0100

    egl/display: only detect the platform once
    
    My refactor missed the fact that `native_platform` is static.
    Add the proper guard around the detection code, as it might not be
    necessary, and only print the debug message when a detection was
    actually performed.
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101252
    Fixes: 7adb9b094894a512c019 ("egl/display: remove unnecessary code and
                                  make it easier to read")
    Signed-off-by: Eric Engestrom <eric@engestrom.ch>
    Reviewed-by: Grazvydas Ignotas <notasas@gmail.com>
    Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
    
    (cherry picked from commit 4ca9ae587c083b6f03feb65b4ce84929109d5d59)

diff --git a/src/egl/main/egldisplay.c b/src/egl/main/egldisplay.c
index 1d724b4..a6d41db 100644
--- a/src/egl/main/egldisplay.c
+++ b/src/egl/main/egldisplay.c
@@ -180,24 +180,27 @@ _eglNativePlatformDetectNativeDisplay(void *nativeDisplay)
 _EGLPlatformType
 _eglGetNativePlatform(void *nativeDisplay)
 {
-   static _EGLPlatformType native_platform;
-   char *detection_method;
-
-   native_platform = _eglGetNativePlatformFromEnv();
-   detection_method = "environment overwrite";
+   static _EGLPlatformType native_platform = _EGL_INVALID_PLATFORM;
 
    if (native_platform == _EGL_INVALID_PLATFORM) {
-      native_platform = _eglNativePlatformDetectNativeDisplay(nativeDisplay);
-      detection_method = "autodetected";
-   }
+      const char *detection_method;
 
-   if (native_platform == _EGL_INVALID_PLATFORM) {
-      native_platform = _EGL_NATIVE_PLATFORM;
-      detection_method = "build-time configuration";
-   }
+      native_platform = _eglGetNativePlatformFromEnv();
+      detection_method = "environment overwrite";
 
-   _eglLog(_EGL_DEBUG, "Native platform type: %s (%s)",
-           egl_platforms[native_platform].name, detection_method);
+      if (native_platform == _EGL_INVALID_PLATFORM) {
+         native_platform = _eglNativePlatformDetectNativeDisplay(nativeDisplay);
+         detection_method = "autodetected";
+      }
+
+      if (native_platform == _EGL_INVALID_PLATFORM) {
+         native_platform = _EGL_NATIVE_PLATFORM;
+         detection_method = "build-time configuration";
+      }
+
+      _eglLog(_EGL_DEBUG, "Native platform type: %s (%s)",
+              egl_platforms[native_platform].name, detection_method);
+   }
 
    return native_platform;
 }

commit 3700dc5f9719313aabbace50eb7c2f4009906fe5
Author: Michel Dänzer <michel.daenzer@amd.com>
Date:   Tue Jun 13 12:02:59 2017 +0900

    gallium/util: Break recursion in pipe_resource_reference
    
    It calling itself recursively prevented it from being inlined, resulting
    in a copy being generated in every compilation unit referencing it. This
    bloated the text segment of the Gallium mega-driver *_dri.so by ~4%,
    and might also have impacted performance.
    
    Fixes: ecd6fce2611e ("mesa/st: support lowering multi-planar YUV")
    v2:
    * Add comment above pipe_resource_next_reference [Samuel Pitoiset]
    v3:
    * Use loop to unreference the full chain of resources referenced via
      the next members [Timothy Arceri]
    v4:
    * Stop chasing ->next chain at the first sub-resource which isn't
      destroyed [Nicolai Hähnle]
    
    Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
    Reviewed-by: Marek Olšák <marek.olsak@amd.com>
    (cherry picked from commit 176e761513f9f9502248c0c8dad133d2d9f28d2d)

diff --git a/src/gallium/auxiliary/util/u_inlines.h b/src/gallium/auxiliary/util/u_inlines.h
index 6bc5e66..1ca3e53 100644
--- a/src/gallium/auxiliary/util/u_inlines.h
+++ b/src/gallium/auxiliary/util/u_inlines.h
@@ -137,8 +137,14 @@ pipe_resource_reference(struct pipe_resource **ptr, struct pipe_resource *tex)
 
    if (pipe_reference_described(&(*ptr)->reference, &tex->reference, 
                                 (debug_reference_descriptor)debug_describe_resource)) {
-      pipe_resource_reference(&old_tex->next, NULL);
-      old_tex->screen->resource_destroy(old_tex->screen, old_tex);
+      /* Avoid recursion, which would prevent inlining this function */
+      do {
+         struct pipe_resource *next = old_tex->next;
+
+         old_tex->screen->resource_destroy(old_tex->screen, old_tex);
+         old_tex = next;
+      } while (pipe_reference_described(&old_tex->reference, NULL,
+                                        (debug_reference_descriptor)debug_describe_resource));
    }
    *ptr = tex;
 }

commit e8eb5e80f162dc40b48eb20b844a3190c5b2b86c
Author: Ville Syrjälä <ville.syrjala@linux.intel.com>
Date:   Mon Jun 5 14:01:58 2017 +0300

    i915: Fix wpos_tex vs. -1 comparison
    
    wpos_tex used to be a GLuint so assigning -1 to it and
    later comparing with -1 worked correctly, but commit
    c349031c27b7 ("i915: Fix texcoord vs. varying collision in
    fragment programs") changed wpos_tex to uint8_t and hence
    broke the comparison. To fix this define a more explicit
    invalid value for wpos_tex.
    
    gcc warns us:
    i915_fragprog.c:1255:57: warning: comparison is always true due to limited range of data type [-Wtype-limits]
        if (inputsRead & VARYING_BITS_TEX_ANY || p->wpos_tex != -1) {
                                                             ^
    
    And clang says:
    i915_fragprog.c:1255:57: warning: comparison of constant -1 with expression of type 'uint8_t' (aka 'unsigned char') is always true [-Wtautological-constant-out-of-range-compare]
       if (inputsRead & VARYING_BITS_TEX_ANY || p->wpos_tex != -1) {
                                                ~~~~~~~~~~~ ^  ~~
    
    Cc: Chih-Wei Huang <cwhuang@android-x86.org>
    Cc: Eric Anholt <eric@anholt.net>
    Cc: Ian Romanick <ian.d.romanick@intel.com>
    Cc: mesa-stable@lists.freedesktop.org
    Fixes: c349031c27b7 ("i915: Fix texcoord vs. varying collision in fragment programs")
    Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
    Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
    (cherry picked from commit c1eedb43f32f6a3733f26e7918eb028f68bd60a4)
    
    Squashed with commit:
    
    i915: Always emit W on gen3
    
    Unlike the older gen2 hardware, gen3 performs perspective
    correct interpolation even for the primary/secondary colors.
    To do that it naturally needs us to emit W for the vertices.
    
    Currently we emit W only when at least one texture coordinate
    set gets emitted. This means the interpolation of color will
    change depending on whether texcoords/varyings are used or not.
    That's probably not what anyone would expect, so let's just
    always emit W to get consistent behaviour. Trying to avoid
    emitting W seems like more hassle than it's worth, especially
    as bspec seems to suggest that the hardware will perform the
    perspective division anyway.
    
    This used to be broken until it was accidentally fixed it in
    commit c349031c27b7 ("i915: Fix texcoord vs. varying collision
    in fragment programs") by introducing a bug that made the driver
    always emit W. After fixing that bug in commit c1eedb43f32f
    ("i915: Fix wpos_tex vs. -1 comparison") we went back to the
    old behaviour and caused an apparent regression.
    
    Fixes: c1eedb43f32f ("i915: Fix wpos_tex vs. -1 comparison")
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101451
    Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
    Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
    (cherry picked from commit 0eef03a6f2f7fa7968accaa2ab2c3d7431e984b8)

diff --git a/src/mesa/drivers/dri/i915/i915_context.h b/src/mesa/drivers/dri/i915/i915_context.h
index 30ca250..4e68d11 100644
--- a/src/mesa/drivers/dri/i915/i915_context.h
+++ b/src/mesa/drivers/dri/i915/i915_context.h
@@ -117,6 +117,7 @@ enum {
 };
 
 #define I915_TEX_UNITS 8
+#define I915_WPOS_TEX_INVALID 0xff
 
 #define I915_MAX_CONSTANT      32
 #define I915_CONSTANT_SIZE     (2+(4*I915_MAX_CONSTANT))
diff --git a/src/mesa/drivers/dri/i915/i915_fragprog.c b/src/mesa/drivers/dri/i915/i915_fragprog.c
index e2d462a..2e04319 100644
--- a/src/mesa/drivers/dri/i915/i915_fragprog.c
+++ b/src/mesa/drivers/dri/i915/i915_fragprog.c
@@ -1063,7 +1063,7 @@ check_wpos(struct i915_fragment_program *p)
    GLint i;
    unsigned unit = 0;
 
-   p->wpos_tex = -1;
+   p->wpos_tex = I915_WPOS_TEX_INVALID;
 
    if ((inputs & VARYING_BIT_POS) == 0)
       return;
@@ -1253,12 +1253,10 @@ i915ValidateFragmentProgram(struct i915_context *i915)
    intel->coloroffset = 0;
    intel->specoffset = 0;
 
-   if (inputsRead & VARYING_BITS_TEX_ANY || p->wpos_tex != -1) {
-      EMIT_ATTR(_TNL_ATTRIB_POS, EMIT_4F_VIEWPORT, S4_VFMT_XYZW, 16);
-   }
-   else {
-      EMIT_ATTR(_TNL_ATTRIB_POS, EMIT_3F_VIEWPORT, S4_VFMT_XYZ, 12);
-   }
+   /* Always emit W to get consistent perspective
+    * correct interpolation of primary/secondary colors.
+    */
+   EMIT_ATTR(_TNL_ATTRIB_POS, EMIT_4F_VIEWPORT, S4_VFMT_XYZW, 16);
 
    /* Handle gl_PointSize builtin var here */
    if (ctx->Point._Attenuated || ctx->VertexProgram.PointSizeEnabled)
diff --git a/src/mesa/drivers/dri/i915/i915_program.c b/src/mesa/drivers/dri/i915/i915_program.c
index a8f693f..20a4780 100644
--- a/src/mesa/drivers/dri/i915/i915_program.c
+++ b/src/mesa/drivers/dri/i915/i915_program.c
@@ -482,7 +482,7 @@ i915_init_program(struct i915_context *i915, struct i915_fragment_program *p)
    p->decl_t = 0;
    p->temp_flag = 0xffff000;
    p->utemp_flag = ~0x7;
-   p->wpos_tex = -1;
+   p->wpos_tex = I915_WPOS_TEX_INVALID;
    p->depth_written = 0;
    p->nr_params = 0;
 

commit 62cbd6d1ddb00fd12721c2bfa9d494ba47e45491


Reply to: