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

mesa: Changes to 'ubuntu+1'



Rebased ref, commits from common ancestor:
commit cd14c2b72bbca6196b26fe054e9548db99d8908d
Author: Timo Aaltonen <tjaalton@debian.org>
Date:   Thu May 11 13:53:38 2017 +0300

    update the changelog

diff --git a/debian/changelog b/debian/changelog
index 1f60130..9d1ef22 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+mesa (17.1.0-1ubuntu1) UNRELEASED; urgency=medium
+
+  * Merge from Debian.
+  * i915-dont-default-to-2.1.patch: Dropped, implemented upstream.
+  * Refresh patches, disable Mir vulkan support as it doesn't build.
+
+ -- Timo Aaltonen <tjaalton@debian.org>  Thu, 27 Apr 2017 08:23:14 +0300
+
 mesa (17.1.0-1) experimental; urgency=medium
 
   * New upstream release.
@@ -7,14 +15,6 @@ mesa (17.1.0-1) experimental; urgency=medium
 
  -- Timo Aaltonen <tjaalton@debian.org>  Thu, 11 May 2017 09:59:50 +0300
 
-mesa (17.1.0~rc2-0ubuntu1) UNRELEASED; urgency=medium
-
-  * Merge from Debian.
-  * i915-dont-default-to-2.1.patch: Dropped, implemented upstream.
-  * Refresh patches, disable Mir vulkan support as it doesn't build.
-
- -- Timo Aaltonen <tjaalton@debian.org>  Thu, 27 Apr 2017 08:23:14 +0300
-
 mesa (17.0.5-0ubuntu1) artful; urgency=medium
 
   * New upstream bugfix release. (LP: #1686344)

commit 474be12d2daa9ae177bcfa76ef3385a5b20a2d62
Author: Timo Aaltonen <tjaalton@debian.org>
Date:   Thu May 11 10:00:07 2017 +0300

    release to experimental

diff --git a/debian/changelog b/debian/changelog
index b960c1f..e48498b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,11 +1,11 @@
-mesa (17.1.0-1) UNRELEASED; urgency=medium
+mesa (17.1.0-1) experimental; urgency=medium
 
   * New upstream release.
   * control: Add zlib1g-dev to build-depends.
   * control: Bump libdrm-dev build-dep to 2.4.80.
   * libgbm1.symbols: Updated.
 
- -- Timo Aaltonen <tjaalton@debian.org>  Wed, 26 Apr 2017 09:09:19 +0300
+ -- Timo Aaltonen <tjaalton@debian.org>  Thu, 11 May 2017 09:59:50 +0300
 
 mesa (17.0.4-1) experimental; urgency=medium
 

commit 5b55a4ff570a77d3bf59fb4de2695f86ee9584be
Author: Timo Aaltonen <tjaalton@debian.org>
Date:   Thu May 11 09:50:16 2017 +0300

    bump version

diff --git a/debian/changelog b/debian/changelog
index c7e5d27..b960c1f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,6 @@
-mesa (17.1.0~rc2-1) UNRELEASED; urgency=medium
+mesa (17.1.0-1) UNRELEASED; urgency=medium
 
-  * New upstream release candidate.
+  * New upstream release.
   * control: Add zlib1g-dev to build-depends.
   * control: Bump libdrm-dev build-dep to 2.4.80.
   * libgbm1.symbols: Updated.

commit 15a38605fc3aa49c01943f9ec2be19d58fef4aac
Author: Emil Velikov <emil.velikov@collabora.com>
Date:   Wed May 10 12:11:03 2017 +0100

    docs: Update 17.1.0 release notes
    
    Signed-off-by: Emil Velikov <emil.velikov@collabora.com>

diff --git a/docs/relnotes/17.1.0.html b/docs/relnotes/17.1.0.html
index e7cfe38..af5094d 100644
--- a/docs/relnotes/17.1.0.html
+++ b/docs/relnotes/17.1.0.html
@@ -14,7 +14,7 @@
 <iframe src="../contents.html"></iframe>
 <div class="content">
 
-<h1>Mesa 17.1.0 Release Notes / TBD</h1>
+<h1>Mesa 17.1.0 Release Notes / May 10, 2017</h1>
 
 <p>
 Mesa 17.1.0 is a new development release.
@@ -63,6 +63,147 @@ Note: some of the new features are only available with certain drivers.
 <h2>Bug fixes</h2>
 
 <ul>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=68504";>Bug 68504</a> - 9.2-rc1 workaround for clover build failure on ppc/altivec: cannot convert 'bool' to '__vector(4) __bool int' in return</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=84325";>Bug 84325</a> - X.Org segfaults when starting DE on an Intel+Radeon laptop, caused by libpciaccess cleanup, patch attached</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=93089";>Bug 93089</a> - mesa fails to check for gcc atomic primitives before using them</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=95460";>Bug 95460</a> - Please add more drivers (freedreno, virgl) to features.txt status document</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=96743";>Bug 96743</a> - [BYT, HSW, SKL, BXT, KBL] GPU hangs with GfxBench 4.0 CarChase</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=97102";>Bug 97102</a> - [dri][swr] stack overflow / infinite loop with GALLIUM_DRIVER=swr</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=97338";>Bug 97338</a> - Black squares in the Spec Ops: The Line chapter select screen</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=97524";>Bug 97524</a> - Samplers referring to the same texture unit with different types should raise GL_INVALID_OPERATION</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=97967";>Bug 97967</a> - glsl/tests/cache-test regression</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=97988";>Bug 97988</a> - [radeonsi] playing back videos with VDPAU exhibits deinterlacing/anti-aliasing issues not visible with VA-API</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=98263";>Bug 98263</a> - [radv] The Talos Principle fails to launch with &quot;Fatal error: Cannot set display mode.&quot;</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=98428";>Bug 98428</a> - Undefined non-weak-symbol in dri-drivers</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=98502";>Bug 98502</a> - Delay when starting firefox, thunderbird or chromium and dmesg spam</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=98869";>Bug 98869</a> - Electronic Super Joy graphic artefacts (regression,bisected)</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=98975";>Bug 98975</a> - Wasteland 2 Directors Cut: Hangs. GPU fault</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=99010";>Bug 99010</a> - --disable-gallium-llvm no longer recognized</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=99246";>Bug 99246</a> - [d3dadapter+radeonsi &amp; bisect] EVE-Online : hang on wormhole sight</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=99265";>Bug 99265</a> - i965: Piglit egl_khr_gl_renderbuffer_image-clear-shared-image fails</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=99339";>Bug 99339</a> - Blender line rendering broken after removing XY clipping of lines</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=99401";>Bug 99401</a> - [g33] regression: piglit.spec.!opengl 1_0.gl-1_0-beginend-coverage</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=99450";>Bug 99450</a> - [amdgpu] Payday 2 visual glitches on some models</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=99451";>Bug 99451</a> - polygon offset use after free</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=99456";>Bug 99456</a> - Firefox crashing when opening about:support with WebGL2 enabled</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=99465";>Bug 99465</a> - vtn_vector_construct writing out of bounds when given multiple non-zero length sources</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=99484";>Bug 99484</a> - Crusader Kings 2 - Loading bars, siege bars, morale bars, etc. do not render correctly</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=99532";>Bug 99532</a> - Compute shader doesn't give right result under some circumstances</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=99542";>Bug 99542</a> - vdpau  logging errors since gallium/radeon: adjust the rule for using the LINEAR_ALIGNED layout</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=99631";>Bug 99631</a> - segfault with OSVRTrackerView and openscenegraph git master</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=99633";>Bug 99633</a> - rasterizer/core/clip.h:279:49: error: ‘const struct API_STATE’ has no member named ‘linkageCount’</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=99660";>Bug 99660</a> - Not all of the int64 conversion opcodes got implemented</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=99677";>Bug 99677</a> - heap-use-after-free in glsl</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=99692";>Bug 99692</a> - [radv] Mostly broken on Hawaii PRO/CIK ASICs</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=99701";>Bug 99701</a> - loader.c:353:8: error: implicit declaration of function 'geteuid' is invalid in C99 [-Werror,-Wimplicit-function-declaration]</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=99715";>Bug 99715</a> - Don't print: &quot;Note: Buggy applications may crash, if they do please report to vendor&quot;</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=99789";>Bug 99789</a> - Memory leak on failure to create an ir_constant in calculate_iterations in loop_controls.cpp</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=99817";>Bug 99817</a> - [softpipe] piglit glsl-fs-tan-1 regression</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=99842";>Bug 99842</a> - GL_ARB_transform_feedback2 on i965 gen6</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=99850";>Bug 99850</a> - Tessellation bug on Carrizo</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=99918";>Bug 99918</a> - disk_cache.h:57:20: error: no member named 'st_mtim' in 'struct stat'</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=99953";>Bug 99953</a> - device9.c:122:49: error: ‘PIPE_CAP_USER_INDEX_BUFFERS’ undeclared (first use in this function)</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=99955";>Bug 99955</a> - [r600g] GPU load always displayed at 100% with GALLIUM_HUD=GPU-load</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=100026";>Bug 100026</a> - piglit.spec.arb_shader_subroutine.compiler.direct-call_vert regression</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=100049";>Bug 100049</a> - &quot;ralloc: Make sure ralloc() allocations match malloc()'s alignment.&quot; causes seg fault in 32bit build</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=100060";>Bug 100060</a> - wsi/wsi_common_wayland.c:25:41: fatal error: wayland-drm-client-protocol.h: No such file or directory</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=100061";>Bug 100061</a> - LODQ instruction generated with invalid dst mask</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=100068";>Bug 100068</a> - LLVM ERROR: Cannot select: intrinsic %llvm.amdgcn.buffer.load.format</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=100088";>Bug 100088</a> - piglit.spec.arb_get_texture_sub_image.arb_get_texture_sub_image regressions</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=100091";>Bug 100091</a> - Failure to create folder for on-disk shader cache</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=100133";>Bug 100133</a> - swr_context.cpp:336:44: error: invalid conversion from ‘uint {aka unsigned int}’ to ‘pipe_render_cond_flag’ [-fpermissive]</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=100154";>Bug 100154</a> - test_eu_compact regression</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=100180";>Bug 100180</a> - Build failure in GNOME Continuous</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=100182";>Bug 100182</a> - Flickering in The Talos Principle on Sky Lake GT4.</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=100201";>Bug 100201</a> - Windows scons build with MSVC toolchain and LLVM 4.0 fails</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=100223";>Bug 100223</a> - marshal_generated.c:38:10: fatal error: 'X11/Xlib-xcb.h' file not found</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=100236";>Bug 100236</a> - Undefined symbols for architecture x86_64: &quot;typeinfo for llvm::RTDyldMemoryManager&quot;</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=100259";>Bug 100259</a> - [EGL] [GBM] undefined reference to `gbm_bo_create_with_modifiers'</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=100288";>Bug 100288</a> - clover unable to run OpenCL kernels since 03127bb radeonsi: compile all TGSI compute shaders asynchronously</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=100303";>Bug 100303</a> - Adding a single, meaningless if-else to a shader source leads to different image</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=100391";>Bug 100391</a> - SachaWillems deferredmultisampling asserts</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=100452";>Bug 100452</a> - push_constants host memory leak when resetting command buffer</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=100531";>Bug 100531</a> - [regression] Broken graphics in several games</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=100562";>Bug 100562</a> - u_debug_stack.c:59: undefined reference to `_Ux86_64_getcontext'</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=100569";>Bug 100569</a> - core/resource.cpp:36:33: error: non-constant-expression cannot be narrowed from type 'int' to 'int16_t' (aka 'short') in initializer list [-Wc++11-narrowing]</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=100574";>Bug 100574</a> - anv_device.c:189: undefined reference to `anv_gem_supports_48b_addresses'</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=100582";>Bug 100582</a> - [GEN8+] piglit.spec.arb_stencil_texturing.glblitframebuffer corrupts state.gl_texture* assertions</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=100600";>Bug 100600</a> - anv_device.c:1337: undefined reference to `anv_gem_busy'</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=100620";>Bug 100620</a> - [SKL] 48-bit addresses break DOOM</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=100663";>Bug 100663</a> - commit 61e47d92c5196 breaks RS780</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=100690";>Bug 100690</a> - [Regression, bisected] TotalWar: Warhammer corrupted graphics</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=100892";>Bug 100892</a> - Polaris 12: winsys init bad switch (missing break) initializing addrlib</li>
+
 </ul>
 
 <h2>Changes</h2>

commit 0831cc7c2febc46dbdf07a12aef23eb440130ad2
Author: Emil Velikov <emil.velikov@collabora.com>
Date:   Wed May 10 12:02:52 2017 +0100

    Update version to 17.1.0(final)
    
    Signed-off-by: Emil Velikov <emil.velikov@collabora.com>

diff --git a/VERSION b/VERSION
index 3ae8bb5..d9e5892 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-17.1.0-rc4
+17.1.0

commit 43678114c7bd024e7aa4c4a7ea5b05088895a499
Author: Dave Airlie <airlied@redhat.com>
Date:   Thu May 4 10:51:49 2017 +1000

    radv: don't advertise transfer props unless we can do anything else
    
    There is no reason to advertise transfer ability for formats we can't
    use for anything else. This stops some CTS tests hitting internal
    error for 64-bit types when they see the transfer flags.
    
    Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
    Signed-off-by: Dave Airlie <airlied@redhat.com>
    (cherry picked from commit efa19f5a542709cab7c6aa7f03af959f4394962f)

diff --git a/src/amd/vulkan/radv_formats.c b/src/amd/vulkan/radv_formats.c
index 07942e4..61cc673 100644
--- a/src/amd/vulkan/radv_formats.c
+++ b/src/amd/vulkan/radv_formats.c
@@ -597,13 +597,13 @@ radv_physical_device_get_format_properties(struct radv_physical_device *physical
 				tiled |= VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT;
 			}
 		}
-		if (util_is_power_of_two(vk_format_get_blocksize(format)) && !scaled) {
+		if (tiled && util_is_power_of_two(vk_format_get_blocksize(format)) && !scaled) {
 			tiled |= VK_FORMAT_FEATURE_TRANSFER_SRC_BIT_KHR |
 			         VK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR;
 		}
 	}
 
-	if (util_is_power_of_two(vk_format_get_blocksize(format)) && !scaled) {
+	if (linear && util_is_power_of_two(vk_format_get_blocksize(format)) && !scaled) {
 		linear |= VK_FORMAT_FEATURE_TRANSFER_SRC_BIT_KHR |
 		          VK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR;
 	}

commit 072b1f5270ef76f997ee33a1397e14c9eeecbc35
Author: Dave Airlie <airlied@redhat.com>
Date:   Fri Mar 17 13:38:41 2017 +1000

    radv/ac: canonicalize the output for 32-bit float min/max.
    
    This fixes:
    dEQP-VK.glsl.builtin.precision.min.*
    dEQP-VK.glsl.builtin.precision.max.*
    dEQP-VK.glsl.builtin.precision.clamp.*
    
    The problem is the hw doesn't compare denorms properly,
    so we have to flush them, even though the spec says
    flushing is optional, if you don't flush the results
    should be correct.
    
    The -pro driver changes the shader float mode,
    it would be nice if llvm could grow that perhaps.
    
    Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
    Signed-off-by: Dave Airlie <airlied@redhat.com>
    (cherry picked from commit 3bf3f9866c1387872521242921bb00c7fb7c2834)

diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
index 43d0520..43a79b8 100644
--- a/src/amd/common/ac_nir_to_llvm.c
+++ b/src/amd/common/ac_nir_to_llvm.c
@@ -1653,10 +1653,18 @@ static void visit_alu(struct nir_to_llvm_context *ctx, nir_alu_instr *instr)
 	case nir_op_fmax:
 		result = emit_intrin_2f_param(ctx, "llvm.maxnum",
 		                              to_float_type(ctx, def_type), src[0], src[1]);
+		if (instr->dest.dest.ssa.bit_size == 32)
+			result = emit_intrin_1f_param(ctx, "llvm.canonicalize",
+						      to_float_type(ctx, def_type),
+						      result);
 		break;
 	case nir_op_fmin:
 		result = emit_intrin_2f_param(ctx, "llvm.minnum",
 		                              to_float_type(ctx, def_type), src[0], src[1]);
+		if (instr->dest.dest.ssa.bit_size == 32)
+			result = emit_intrin_1f_param(ctx, "llvm.canonicalize",
+						      to_float_type(ctx, def_type),
+						      result);
 		break;
 	case nir_op_ffma:
 		result = emit_intrin_3f_param(ctx, "llvm.fma",

commit bd79ce435610be9a7ad2eb25bca22dbcb1a384d9
Author: Dave Airlie <airlied@redhat.com>
Date:   Fri Mar 17 12:11:30 2017 +1000

    radv: flush f32->f16 conversion denormals to zero. (v2)
    
    SPIR-V defines the f32->f16 operation as flushing denormals to 0,
    this compares the class using amd class opcode.
    
    Thanks to Matt Arsenault for figuring it out.
    
    This fix is VI+ only, add a TODO for SI/CIK.
    
    This fixes:
    dEQP-VK.spirv_assembly.instruction.compute.opquantize.flush_to_zero
    
    Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
    Signed-off-by: Dave Airlie <airlied@redhat.com>
    (cherry picked from commit 83e58b036e1c34f26c99d04615df2b530f3045d9)

diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
index 9bcd5f6..43d0520 100644
--- a/src/amd/common/ac_nir_to_llvm.c
+++ b/src/amd/common/ac_nir_to_llvm.c
@@ -1230,6 +1230,33 @@ static LLVMValueRef emit_b2f(struct nir_to_llvm_context *ctx,
 	return LLVMBuildAnd(ctx->builder, src0, LLVMBuildBitCast(ctx->builder, LLVMConstReal(ctx->f32, 1.0), ctx->i32, ""), "");
 }
 
+static LLVMValueRef emit_f2f16(struct nir_to_llvm_context *ctx,
+			       LLVMValueRef src0)
+{
+	LLVMValueRef result;
+	LLVMValueRef cond;
+
+	src0 = to_float(ctx, src0);
+	result = LLVMBuildFPTrunc(ctx->builder, src0, ctx->f16, "");
+
+	/* TODO SI/CIK options here */
+	if (ctx->options->chip_class >= VI) {
+		LLVMValueRef args[2];
+		/* Check if the result is a denormal - and flush to 0 if so. */
+		args[0] = result;
+		args[1] = LLVMConstInt(ctx->i32, N_SUBNORMAL | P_SUBNORMAL, false);
+		cond = ac_build_intrinsic(&ctx->ac, "llvm.amdgcn.class.f16", ctx->i1, args, 2, AC_FUNC_ATTR_READNONE);
+	}
+
+	/* need to convert back up to f32 */
+	result = LLVMBuildFPExt(ctx->builder, result, ctx->f32, "");
+
+	if (ctx->options->chip_class >= VI)
+		result = LLVMBuildSelect(ctx->builder, cond, ctx->f32zero, result, "");
+
+	return result;
+}
+
 static LLVMValueRef emit_umul_high(struct nir_to_llvm_context *ctx,
 				   LLVMValueRef src0, LLVMValueRef src1)
 {
@@ -1717,10 +1744,7 @@ static void visit_alu(struct nir_to_llvm_context *ctx, nir_alu_instr *instr)
 		result = emit_b2f(ctx, src[0]);
 		break;
 	case nir_op_fquantize2f16:
-		src[0] = to_float(ctx, src[0]);
-		result = LLVMBuildFPTrunc(ctx->builder, src[0], ctx->f16, "");
-		/* need to convert back up to f32 */
-		result = LLVMBuildFPExt(ctx->builder, result, ctx->f32, "");
+		result = emit_f2f16(ctx, src[0]);
 		break;
 	case nir_op_umul_high:
 		result = emit_umul_high(ctx, src[0], src[1]);
diff --git a/src/amd/common/sid.h b/src/amd/common/sid.h
index 75ba965..b9ddadc 100644
--- a/src/amd/common/sid.h
+++ b/src/amd/common/sid.h
@@ -9094,5 +9094,18 @@
 #define    CIK_SDMA_PACKET_SRBM_WRITE              0xe
 #define    CIK_SDMA_COPY_MAX_SIZE                  0x3fffe0
 
+enum amd_cmp_class_flags {
+	S_NAN = 1 << 0,        // Signaling NaN
+	Q_NAN = 1 << 1,        // Quiet NaN
+	N_INFINITY = 1 << 2,   // Negative infinity
+	N_NORMAL = 1 << 3,     // Negative normal
+	N_SUBNORMAL = 1 << 4,  // Negative subnormal
+	N_ZERO = 1 << 5,       // Negative zero
+	P_ZERO = 1 << 6,       // Positive zero
+	P_SUBNORMAL = 1 << 7,  // Positive subnormal
+	P_NORMAL = 1 << 8,     // Positive normal
+	P_INFINITY = 1 << 9    // Positive infinity
+};
+
 #endif /* _SID_H */
 

commit 0640bae86ce4bde2253667916d45c103ed1b531e
Author: Dave Airlie <airlied@redhat.com>
Date:   Wed May 3 07:13:21 2017 +1000

    radv: flush more stages when semaphore are waiting.
    
    This still doesn't give us complete pWaitDstStageMask support,
    but it should provide enough to be correct if not as efficent as
    possible.
    
    If we have wait semaphores we must flush between submits and
    flush the shaders as well.
    
    This fixes the remaining fails in:
    dEQP-VK.synchronization.op.single_queue.semaphore.*ssbo*
    
    Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
    Signed-off-by: Dave Airlie <airlied@redhat.com>
    (cherry picked from commit a52470402515c46cd9f33a5d83dc8d2bc9f7bae9)

diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
index 8654b1e..4649005 100644
--- a/src/amd/vulkan/radv_device.c
+++ b/src/amd/vulkan/radv_device.c
@@ -1049,6 +1049,22 @@ VkResult radv_CreateDevice(
 			break;
 		}
 		device->ws->cs_finalize(device->flush_cs[family]);
+
+		device->flush_shader_cs[family] = device->ws->cs_create(device->ws, family);
+		switch (family) {
+		case RADV_QUEUE_GENERAL:
+		case RADV_QUEUE_COMPUTE:
+			si_cs_emit_cache_flush(device->flush_shader_cs[family],
+			                       device->physical_device->rad_info.chip_class,
+			                       family == RADV_QUEUE_COMPUTE && device->physical_device->rad_info.chip_class >= CIK,
+					       family == RADV_QUEUE_COMPUTE ? RADV_CMD_FLAG_CS_PARTIAL_FLUSH : (RADV_CMD_FLAG_CS_PARTIAL_FLUSH | RADV_CMD_FLAG_PS_PARTIAL_FLUSH) |
+			                       RADV_CMD_FLAG_INV_ICACHE |
+			                       RADV_CMD_FLAG_INV_SMEM_L1 |
+			                       RADV_CMD_FLAG_INV_VMEM_L1 |
+			                       RADV_CMD_FLAG_INV_GLOBAL_L2);
+			break;
+		}
+		device->ws->cs_finalize(device->flush_shader_cs[family]);
 	}
 
 	if (getenv("RADV_TRACE_FILE")) {
@@ -1124,6 +1140,8 @@ void radv_DestroyDevice(
 			device->ws->cs_destroy(device->empty_cs[i]);
 		if (device->flush_cs[i])
 			device->ws->cs_destroy(device->flush_cs[i]);
+		if (device->flush_shader_cs[i])
+			device->ws->cs_destroy(device->flush_shader_cs[i]);
 	}
 	radv_device_finish_meta(device);
 
@@ -1825,7 +1843,7 @@ VkResult radv_QueueSubmit(
 
 	for (uint32_t i = 0; i < submitCount; i++) {
 		struct radeon_winsys_cs **cs_array;
-		bool do_flush = !i;
+		bool do_flush = !i || pSubmits[i].pWaitDstStageMask;
 		bool can_patch = !do_flush;
 		uint32_t advance;
 
@@ -1852,7 +1870,9 @@ VkResult radv_QueueSubmit(
 					        (pSubmits[i].commandBufferCount + do_flush));
 
 		if(do_flush)
-			cs_array[0] = queue->device->flush_cs[queue->queue_family_index];
+			cs_array[0] = pSubmits[i].waitSemaphoreCount ?
+				queue->device->flush_shader_cs[queue->queue_family_index] :
+				queue->device->flush_cs[queue->queue_family_index];
 
 		for (uint32_t j = 0; j < pSubmits[i].commandBufferCount; j++) {
 			RADV_FROM_HANDLE(radv_cmd_buffer, cmd_buffer,
diff --git a/src/amd/vulkan/radv_private.h b/src/amd/vulkan/radv_private.h
index 4ace068..08f53a1 100644
--- a/src/amd/vulkan/radv_private.h
+++ b/src/amd/vulkan/radv_private.h
@@ -495,7 +495,7 @@ struct radv_device {
 	int queue_count[RADV_MAX_QUEUE_FAMILIES];
 	struct radeon_winsys_cs *empty_cs[RADV_MAX_QUEUE_FAMILIES];
 	struct radeon_winsys_cs *flush_cs[RADV_MAX_QUEUE_FAMILIES];
-
+	struct radeon_winsys_cs *flush_shader_cs[RADV_MAX_QUEUE_FAMILIES];
 	uint64_t debug_flags;
 
 	bool llvm_supports_spill;

commit 9b808c5748ff162be8f3cf2958c7c5ecb5436b25
Author: Dave Airlie <airlied@redhat.com>
Date:   Tue May 2 15:29:28 2017 +1000

    radv: fix stencil only clears.
    
    If we are clearing stencil only, we still need to provide a
    a valid Z output from the vertex shader, we can't rely
    on the depth clear value having any meaning, as we use this
    for the position output, and it could get clipped, so we
    don't end up clearing anything.
    
    Fixes:
    dEQP-VK.renderpass.simple.stencil
    since I added S8 support.
    
    Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
    Signed-off-by: Dave Airlie <airlied@redhat.com>
    (cherry picked from commit 3c730639740f9b1243e95d06e6608cb54649be9a)

diff --git a/src/amd/vulkan/radv_meta_clear.c b/src/amd/vulkan/radv_meta_clear.c
index cbb90a4..a5502ce 100644
--- a/src/amd/vulkan/radv_meta_clear.c
+++ b/src/amd/vulkan/radv_meta_clear.c
@@ -693,6 +693,9 @@ emit_depthstencil_clear(struct radv_cmd_buffer *cmd_buffer,
 			   VK_IMAGE_ASPECT_STENCIL_BIT));
 	assert(pass_att != VK_ATTACHMENT_UNUSED);
 
+	if (!(aspects & VK_IMAGE_ASPECT_DEPTH_BIT))
+		clear_value.depth = 1.0f;
+
 	const struct depthstencil_clear_vattrs vertex_data[3] = {
 		{
 			.position = {

commit 9105e36765baaf242836da95d2e44bdc3ef04233
Author: Dave Airlie <airlied@redhat.com>
Date:   Tue May 2 13:40:36 2017 +1000

    radv/wsi: report presentation error per image request
    
    This ports
    0fcb92c17dee681bd39c08ddf0abc358a27337c7
    anv: wsi: report presentation error per image request
    
    This fixes:
    dEQP-VK.wsi.xlib.incremental_present.scale_none.*
    
    Reviewed-by: Daniel Stone <daniels@collabora.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>
    (cherry picked from commit 09034aab64c7a6022a2c508658fead1442f08576)

diff --git a/src/amd/vulkan/radv_wsi.c b/src/amd/vulkan/radv_wsi.c
index b8999f4..3a8617f 100644
--- a/src/amd/vulkan/radv_wsi.c
+++ b/src/amd/vulkan/radv_wsi.c
@@ -460,16 +460,20 @@ VkResult radv_QueuePresentKHR(
 		RADV_FROM_HANDLE(wsi_swapchain, swapchain, pPresentInfo->pSwapchains[i]);
 		struct radeon_winsys_cs *cs;
 		const VkPresentRegionKHR *region = NULL;
+		VkResult item_result;
 
 		assert(radv_device_from_handle(swapchain->device) == queue->device);
 		if (swapchain->fences[0] == VK_NULL_HANDLE) {
-			result = radv_CreateFence(radv_device_to_handle(queue->device),
+			item_result = radv_CreateFence(radv_device_to_handle(queue->device),
 						  &(VkFenceCreateInfo) {
 							  .sType = VK_STRUCTURE_TYPE_FENCE_CREATE_INFO,
 								  .flags = 0,
 								  }, &swapchain->alloc, &swapchain->fences[0]);
-			if (result != VK_SUCCESS)
-				return result;
+			if (pPresentInfo->pResults != NULL)
+				pPresentInfo->pResults[i] = item_result;
+			result = result == VK_SUCCESS ? item_result : result;
+			if (item_result != VK_SUCCESS)
+				continue;
 		} else {
 			radv_ResetFences(radv_device_to_handle(queue->device),
 					 1, &swapchain->fences[0]);
@@ -493,12 +497,15 @@ VkResult radv_QueuePresentKHR(
 		if (regions && regions->pRegions)
 			region = &regions->pRegions[i];
 
-		result = swapchain->queue_present(swapchain,
+		item_result = swapchain->queue_present(swapchain,
 						  pPresentInfo->pImageIndices[i],
 						  region);
 		/* TODO: What if one of them returns OUT_OF_DATE? */
-		if (result != VK_SUCCESS)
-			return result;
+		if (pPresentInfo->pResults != NULL)
+			pPresentInfo->pResults[i] = item_result;
+		result = result == VK_SUCCESS ? item_result : result;
+		if (item_result != VK_SUCCESS)
+			continue;
 
 		VkFence last = swapchain->fences[2];
 		swapchain->fences[2] = swapchain->fences[1];

commit e1678159b162fcb28b6611dade44b75b528197a2
Author: Daniel Stone <daniels@collabora.com>
Date:   Fri May 5 18:24:44 2017 +0100

    i915: Fix build break with empty unreachable()
    
    Actually put something in unreachable(), so as not to break the build on
    a Friday evening.
    
    Signed-off-by: Daniel Stone <daniels@collabora.com>
    Reported-by: Mark Janes <mark.a.janes@intel.com>
    (cherry picked from commit d4342b1398a001af1192497ca4db3a304f98c309)
    Fixes: 467332a0ab2 ("i965: Use helper function for modifier -> tiling")
    Fixes: 8b8af19065a ("i965: Set modifier for imported and duplicated images")

diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c
index 6a7c7e1..0aba1be 100644
--- a/src/mesa/drivers/dri/i965/intel_screen.c
+++ b/src/mesa/drivers/dri/i965/intel_screen.c
@@ -309,8 +309,7 @@ modifier_to_tiling(uint64_t modifier)
          return tiling_modifier_map[i].tiling;
    }
 
-   assert(0 && "modifier_to_tiling should only receive known modifiers");
-   unreachable();
+   unreachable("modifier_to_tiling should only receive known modifiers");
 }
 
 static uint64_t
@@ -323,8 +322,7 @@ tiling_to_modifier(uint32_t tiling)
          return tiling_modifier_map[i].modifier;
    }
 
-   assert(0 && "tiling_to_modifier received unknown tiling mode");
-   unreachable();
+   unreachable("tiling_to_modifier received unknown tiling mode");
 }
 
 static void

commit da13cc7e4bb1f2fcafadcd3a88f9ee983e1649ee
Author: Emil Velikov <emil.velikov@collabora.com>
Date:   Mon May 8 11:40:34 2017 +0100

    Update version to 17.1.0-rc4
    
    Signed-off-by: Emil Velikov <emil.velikov@collabora.com>

diff --git a/VERSION b/VERSION
index 55c3249..3ae8bb5 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-17.1.0-rc3
+17.1.0-rc4

commit 3db01cd4e7eac377a991c2a5c63adbdf846cb5bf
Author: Dave Airlie <airlied@redhat.com>
Date:   Sat May 6 21:14:11 2017 +0100

    radv: apply the tess+GS hang workaround to Polaris12 as well
    
    As I pointed out for radeonsi, and AMD confirmed, so fix this
    in radv as well.
    
    Cc: "17.1" <mesa-stable@lists.freedesktop.org>
    Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
    Signed-off-by: Dave Airlie <airlied@redhat.com>
    (cherry picked from commit 2add79a73291e40621081b9a12938ac1931b9e96)

diff --git a/src/amd/vulkan/si_cmd_buffer.c b/src/amd/vulkan/si_cmd_buffer.c
index fbb2111..8d7db96 100644
--- a/src/amd/vulkan/si_cmd_buffer.c
+++ b/src/amd/vulkan/si_cmd_buffer.c
@@ -672,7 +672,8 @@ si_get_ia_multi_vgt_param(struct radv_cmd_buffer *cmd_buffer,
 				if (family == CHIP_TONGA ||
 				    family == CHIP_FIJI ||
 				    family == CHIP_POLARIS10 ||
-				    family == CHIP_POLARIS11)
+				    family == CHIP_POLARIS11 ||
+				    family == CHIP_POLARIS12)
 					partial_vs_wave = true;
 			} else {
 				partial_vs_wave = true;

commit 396f9ae52f9622e564a7c0912277411d4228292f
Author: Fredrik Höglund <fredrik@kde.org>
Date:   Tue May 2 17:09:27 2017 +0200

    radv/meta: fix restoring a push descriptor set
    
    radv_bind_descriptor_set cannot be used to bind a push descriptor set
    since a push descriptor set does not have a buffer list. However,
    there is no need to add the buffers again when restoring a set, so
    this fix is also an optimization.
    
    Cc: "17.1" <mesa-stable@lists.freedesktop.org>
    Signed-off-by: Fredrik Höglund <fredrik@kde.org>
    Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
    (cherry picked from commit 5ff48581119258214801de24a327bdd6a29e0ccc)
    [Emil Velikov: resolve trivial conflicts]
    Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
    
    Conflicts:
    	src/amd/vulkan/radv_meta.c

diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c
index 2609adc..66e74c2 100644
--- a/src/amd/vulkan/radv_cmd_buffer.c
+++ b/src/amd/vulkan/radv_cmd_buffer.c
@@ -1903,6 +1903,8 @@ void radv_bind_descriptor_set(struct radv_cmd_buffer *cmd_buffer,
 {
 	struct radeon_winsys *ws = cmd_buffer->device->ws;
 
+	assert(!(set->layout->flags & VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR));
+
 	cmd_buffer->state.descriptors[idx] = set;
 	cmd_buffer->state.descriptors_dirty |= (1 << idx);
 	if (!set)
diff --git a/src/amd/vulkan/radv_meta.c b/src/amd/vulkan/radv_meta.c
index 0098e08..d8d2568 100644
--- a/src/amd/vulkan/radv_meta.c
+++ b/src/amd/vulkan/radv_meta.c
@@ -52,7 +52,9 @@ radv_meta_restore(const struct radv_meta_saved_state *state,
 		  struct radv_cmd_buffer *cmd_buffer)
 {
 	cmd_buffer->state.pipeline = state->old_pipeline;
-	radv_bind_descriptor_set(cmd_buffer, state->old_descriptor_set0, 0);
+
+	cmd_buffer->state.descriptors[0] = state->old_descriptor_set0;
+	cmd_buffer->state.descriptors_dirty |= (1u << 0);
 	memcpy(cmd_buffer->state.vertex_bindings, state->old_vertex_bindings,
 	       sizeof(state->old_vertex_bindings));
 
@@ -110,7 +112,9 @@ radv_meta_restore_compute(const struct radv_meta_saved_compute_state *state,
 {
 	radv_CmdBindPipeline(radv_cmd_buffer_to_handle(cmd_buffer), VK_PIPELINE_BIND_POINT_COMPUTE,
 			     radv_pipeline_to_handle(state->old_pipeline));
-	radv_bind_descriptor_set(cmd_buffer, state->old_descriptor_set0, 0);
+
+	cmd_buffer->state.descriptors[0] = state->old_descriptor_set0;
+	cmd_buffer->state.descriptors_dirty |= (1u << 0);
 
 	if (push_constant_size) {
 		memcpy(cmd_buffer->push_constants, state->push_constants, push_constant_size);

commit 0eaab97f2196d171f542d3fdab446e3aeb62d3dd
Author: Kenneth Graunke <kenneth@whitecape.org>
Date:   Wed May 3 19:24:32 2017 -0700

    i965: Don't try to unmap NULL program cache BO.
    
    When running shader-db with intel_stub and recent Mesa, context creation
    fails when making a logical hardware context.  In this case, we call
    intelDestroyContext(), which gets here and tries to unmap the cache BO.
    
    But there isn't one - we haven't made it yet.  So we try to unmap a
    NULL pointer, which used to be safe (it did nothing), but crashes
    after commit 7c3b8ed87859bfdfb985d21685115a729f9cd138.
    
    The result is that we crash rather than failing context creation with
    a nice message.  Either way nothing works, but this is more polite.
    
    Cc: "17.1" <mesa-stable@lists.freedesktop.org>
    Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
    (cherry picked from commit bc074a45180eddf30ea723bbdf89895e2c7684ca)

diff --git a/src/mesa/drivers/dri/i965/brw_program_cache.c b/src/mesa/drivers/dri/i965/brw_program_cache.c
index c06ee23..b0e2962 100644
--- a/src/mesa/drivers/dri/i965/brw_program_cache.c
+++ b/src/mesa/drivers/dri/i965/brw_program_cache.c
@@ -485,10 +485,13 @@ brw_destroy_cache(struct brw_context *brw, struct brw_cache *cache)
 
    DBG("%s\n", __func__);
 
-   if (brw->has_llc)
-      brw_bo_unmap(cache->bo);
-   brw_bo_unreference(cache->bo);
-   cache->bo = NULL;
+   /* This can be NULL if context creation failed early on */
+   if (cache->bo) {
+      if (brw->has_llc)
+         brw_bo_unmap(cache->bo);
+      brw_bo_unreference(cache->bo);
+      cache->bo = NULL;
+   }
    brw_clear_cache(brw, cache);
    free(cache->items);
    cache->items = NULL;

commit b0394dfe2f8df8fbc748a5d181e1511d68e84afc
Author: Kenneth Graunke <kenneth@whitecape.org>
Date:   Fri May 5 09:20:56 2017 -0700

    Revert "mesa: Require mipmap completeness for glCopyImageSubData(), sometimes."
    
    This reverts commit c5bf7cb52942cb7df9f5d73746ffbf3c102d12cc.
    
    This broke rendering in "Total War: WARHAMMER", which uses a single
    level RGBA_UINT32 texture and the default filter modes of GL_LINEAR
    and GL_NEAREST_MIPMAP_LINEAR.  However, the texture max level is 0,
    so it is actually mipmap complete - it's the integer + linear rule
    that causes the error.
    
    I'm working with Khronos to find a real solution.  However it turns
    out, this patch is not correct and breaks real programs, so let's
    revert it for now.
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100690
    Bugzilla: https://cvs.khronos.org/bugzilla/show_bug.cgi?id=16224
    Cc: "17.1" <mesa-stable@lists.freedesktop.org>
    (cherry picked from commit 1456da91c8a14f77dd347981e2bc95e0644e0fd2)

diff --git a/src/mesa/main/copyimage.c b/src/mesa/main/copyimage.c
index 877c8ac..cf25159 100644
--- a/src/mesa/main/copyimage.c
+++ b/src/mesa/main/copyimage.c
@@ -149,30 +149,9 @@ prepare_target(struct gl_context *ctx, GLuint name, GLenum target,
          return false;
       }
 
-      /* The ARB_copy_image specification says:
-       *
-       *    "INVALID_OPERATION is generated if either object is a texture and
-       *     the texture is not complete (as defined in section 3.9.14)"
-       *
-       * The cited section says:
-       *
-       *    "Using the preceding definitions, a texture is complete unless any
-       *     of the following conditions hold true: [...]
-       *
-       *     * The minification filter requires a mipmap (is neither NEAREST
-       *       nor LINEAR), and the texture is not mipmap complete."
-       *
-       * This imposes the bizarre restriction that glCopyImageSubData requires
-       * mipmap completion at times, which dEQP mandates, and other drivers
-       * appear to implement.  We don't have any texture units here, so we
-       * can't look at any bound separate sampler objects...it appears that
-       * you're supposed to use the sampler object which is built-in to the
-       * texture object.
-       *
-       * See https://cvs.khronos.org/bugzilla/show_bug.cgi?id=16224.
-       */
       _mesa_test_texobj_completeness(ctx, texObj);
-      if (!_mesa_is_texture_complete(texObj, &texObj->Sampler)) {
+      if (!texObj->_BaseComplete ||
+          (level != 0 && !texObj->_MipmapComplete)) {
          _mesa_error(ctx, GL_INVALID_OPERATION,
                      "glCopyImageSubData(%sName incomplete)", dbg_prefix);
          return false;

commit 639481e3406d1a76472387eb483a554342ba4391
Author: Rob Clark <robdclark@gmail.com>
Date:   Sat May 6 14:00:35 2017 -0400

    freedreno/a3xx: fix hang w/ large render targets and small gmem
    
    Possibly other gen's have a similar limit.  Fixes glmark2 -b shadow
    with larger resolutions on devices with small gmem (for example,
    fullscreen 1080p on 8x16/db410c).
    
    Cc: mesa-stable@lists.freedesktop.org
    Signed-off-by: Rob Clark <robdclark@gmail.com>
    (cherry picked from commit 6050d5bf3d8d0043386de35cad4efa77e8be957e)

diff --git a/src/gallium/drivers/freedreno/a3xx/fd3_gmem.c b/src/gallium/drivers/freedreno/a3xx/fd3_gmem.c
index 493fdd2..0ec769b 100644
--- a/src/gallium/drivers/freedreno/a3xx/fd3_gmem.c
+++ b/src/gallium/drivers/freedreno/a3xx/fd3_gmem.c
@@ -149,6 +149,9 @@ use_hw_binning(struct fd_batch *batch)
 	if (gmem->minx || gmem->miny)
 		return false;
 
+	if ((gmem->maxpw * gmem->maxph) > 32)
+		return false;
+
 	return fd_binning_enabled && ((gmem->nbins_x * gmem->nbins_y) > 2);
 }
 
diff --git a/src/gallium/drivers/freedreno/freedreno_gmem.c b/src/gallium/drivers/freedreno/freedreno_gmem.c
index d9f707d..dc86192 100644
--- a/src/gallium/drivers/freedreno/freedreno_gmem.c
+++ b/src/gallium/drivers/freedreno/freedreno_gmem.c
@@ -219,6 +219,9 @@ calculate_tiles(struct fd_batch *batch)
 			div_round_up(nbins_x, tpp_x)) > 8)
 		tpp_x += 1;
 
+	gmem->maxpw = tpp_x;
+	gmem->maxph = tpp_y;
+
 	/* configure pipes: */
 	xoff = yoff = 0;
 	for (i = 0; i < ARRAY_SIZE(ctx->pipe); i++) {
diff --git a/src/gallium/drivers/freedreno/freedreno_gmem.h b/src/gallium/drivers/freedreno/freedreno_gmem.h
index 6598ea9..07e13f5 100644
--- a/src/gallium/drivers/freedreno/freedreno_gmem.h
+++ b/src/gallium/drivers/freedreno/freedreno_gmem.h
@@ -57,6 +57,7 @@ struct fd_gmem_stateobj {
 	uint16_t bin_w, nbins_x;
 	uint16_t minx, miny;
 	uint16_t width, height;
+	uint16_t maxpw, maxph;   /* maximum pipe width/height */
 };
 
 struct fd_batch;

commit ee0254a12fb1cdadcd263ee77b4c25c055100561
Author: Daniel Stone <daniels@collabora.com>
Date:   Wed May 3 09:38:13 2017 +0100

    i965: Set modifier for imported and duplicated images
    
    When a buffer is being created from FD or GEM flink import, the current
    API makes no provision for passing modifier information along with this.
    Set the modifier for such images to DRM_FORMAT_MOD_INVALID.
    
    Also preserve the modifier when duplicating an image, as will be done by
    GBM when importing from a wl_buffer.
    
    This doubly tripped up Wayland, as the images would first have been
    created (as wl_buffers) with a 0 modifier, and then lost what modifier
    they would've had when being duplicated into gbm_bos.
    
    Fixes: d78a36ea624 ("i965/dri: Handle the linear fb modifier")
    Signed-off-by: Daniel Stone <daniels@collabora.com>
    Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
    (cherry picked from commit 8b8af19065a5bfd06fd0d97b891cfff807704935)

diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c
index cd07baf..6a7c7e1 100644
--- a/src/mesa/drivers/dri/i965/intel_screen.c
+++ b/src/mesa/drivers/dri/i965/intel_screen.c
@@ -313,6 +313,20 @@ modifier_to_tiling(uint64_t modifier)
    unreachable();
 }
 
+static uint64_t
+tiling_to_modifier(uint32_t tiling)
+{
+   int i;
+
+   for (i = 0; i < ARRAY_SIZE(tiling_modifier_map); i++) {
+      if (tiling_modifier_map[i].tiling == tiling)
+         return tiling_modifier_map[i].modifier;
+   }
+
+   assert(0 && "tiling_to_modifier received unknown tiling mode");
+   unreachable();
+}
+
 static void
 intel_image_warn_if_unaligned(__DRIimage *image, const char *func)
 {
@@ -430,6 +444,7 @@ intel_create_image_from_name(__DRIscreen *dri_screen,
        free(image);
        return NULL;
     }
+    image->modifier = tiling_to_modifier(image->bo->tiling_mode);
 
     return image;
 }
@@ -458,6 +473,7 @@ intel_create_image_from_renderbuffer(__DRIcontext *context,
 
    image->internal_format = rb->InternalFormat;


Reply to: