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

mesa: Changes to 'debian-experimental'



 Android.common.mk                                 |    2 
 VERSION                                           |    2 
 debian/changelog                                  |   22 +
 debian/libegl1-mesa.symbols                       |    2 
 debian/libgl1-mesa-glx.symbols                    |    2 
 docs/relnotes/13.0.0.html                         |    3 
 docs/relnotes/13.0.1.html                         |  187 ++++++++++
 src/amd/addrlib/addrtypes.h                       |    6 
 src/amd/common/ac_nir_to_llvm.c                   |   29 +
 src/amd/vulkan/.gitignore                         |    1 
 src/amd/vulkan/Makefile.am                        |   11 
 src/amd/vulkan/radeon_icd.json                    |    7 
 src/amd/vulkan/radeon_icd.json.in                 |    7 
 src/amd/vulkan/radv_device.c                      |   44 ++
 src/amd/vulkan/radv_pipeline.c                    |   80 +++-
 src/compiler/Makefile.sources                     |    1 
 src/compiler/glsl/linker.cpp                      |   78 ++--
 src/compiler/glsl/lower_ubo_reference.cpp         |   10 
 src/compiler/glsl/standalone.cpp                  |    2 
 src/compiler/glsl/standalone_scaffolding.cpp      |   10 
 src/compiler/glsl/standalone_scaffolding.h        |    3 
 src/compiler/nir/nir.h                            |    2 
 src/compiler/nir/nir_lower_wpos_ytransform.c      |   24 +
 src/compiler/nir/nir_opt_conditional_discard.c    |  125 +++++++
 src/egl/drivers/dri2/egl_dri2.h                   |    2 
 src/egl/main/eglapi.c                             |    4 
 src/egl/main/egldefines.h                         |    5 
 src/gallium/auxiliary/hud/hud_cpufreq.c           |   26 -
 src/gallium/auxiliary/hud/hud_diskstat.c          |   31 -
 src/gallium/auxiliary/hud/hud_nic.c               |   26 -
 src/gallium/auxiliary/hud/hud_sensors_temp.c      |   28 -
 src/gallium/drivers/radeonsi/si_blit.c            |    4 
 src/gallium/drivers/radeonsi/si_shader_tgsi_alu.c |   37 +-
 src/gallium/drivers/vc4/vc4_program.c             |    2 
 src/gallium/state_trackers/vdpau/output.c         |    2 
 src/glx/g_glxglvnddispatchfuncs.c                 |  254 +++++++-------
 src/glx/g_glxglvnddispatchindices.h               |   36 +-
 src/glx/glxcmds.c                                 |    4 
 src/glx/glxglvnd.c                                |    3 
 src/glx/windows/Makefile.am                       |    3 
 src/intel/blorp/blorp.c                           |   28 -
 src/intel/blorp/blorp.h                           |    5 
 src/intel/blorp/blorp_blit.c                      |    4 
 src/intel/blorp/blorp_clear.c                     |    4 
 src/intel/blorp/blorp_genX_exec.h                 |   36 +-
 src/intel/blorp/blorp_priv.h                      |   31 -
 src/intel/common/gen_device_info.c                |   33 +
 src/intel/vulkan/anv_allocator.c                  |  118 ++----
 src/intel/vulkan/anv_batch_chain.c                |  387 +++++++++++++++-------
 src/intel/vulkan/anv_blorp.c                      |    9 
 src/intel/vulkan/anv_cmd_buffer.c                 |    2 
 src/intel/vulkan/anv_device.c                     |  106 +++---
 src/intel/vulkan/anv_intel.c                      |   11 
 src/intel/vulkan/anv_pipeline.c                   |   20 -
 src/intel/vulkan/anv_pipeline_cache.c             |   79 ++--
 src/intel/vulkan/anv_private.h                    |   77 ++--
 src/intel/vulkan/genX_cmd_buffer.c                |   33 -
 src/mesa/drivers/dri/i965/brw_blorp.c             |    3 
 src/mesa/drivers/dri/i965/brw_fs.cpp              |    6 
 src/mesa/main/shaderobj.c                         |   23 -
 src/mesa/main/shaderobj.h                         |    3 
 src/mesa/program/ir_to_mesa.cpp                   |    2 
 src/mesa/state_tracker/st_glsl_to_tgsi.cpp        |   10 
 src/mesa/state_tracker/st_sampler_view.c          |   15 
 src/mesa/state_tracker/st_texture.h               |    9 
 src/mesa/state_tracker/st_vdpau.c                 |   20 -
 src/vulkan/wsi/wsi_common_x11.c                   |    6 
 67 files changed, 1447 insertions(+), 760 deletions(-)

New commits:
commit c21eb9918a199653ccc5279852124e071a1ea55d
Author: Andreas Boll <andreas.boll.dev@gmail.com>
Date:   Mon Nov 14 16:23:58 2016 +0100

    Upload to experimental.

diff --git a/debian/changelog b/debian/changelog
index 961a2fe..553e537 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,8 +1,8 @@
-mesa (13.0.1-1) UNRELEASED; urgency=medium
+mesa (13.0.1-1) experimental; urgency=medium
 
   * New upstream release.
 
- -- Andreas Boll <andreas.boll.dev@gmail.com>  Mon, 14 Nov 2016 14:12:16 +0100
+ -- Andreas Boll <andreas.boll.dev@gmail.com>  Mon, 14 Nov 2016 16:23:42 +0100
 
 mesa (13.0.0-1) experimental; urgency=medium
 

commit 052eba27a850fe602f5c4fd3cee44a5522ba1c10
Author: Andreas Boll <andreas.boll.dev@gmail.com>
Date:   Mon Nov 14 14:12:29 2016 +0100

    Bump changelog

diff --git a/debian/changelog b/debian/changelog
index fe564e0..961a2fe 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+mesa (13.0.1-1) UNRELEASED; urgency=medium
+
+  * New upstream release.
+
+ -- Andreas Boll <andreas.boll.dev@gmail.com>  Mon, 14 Nov 2016 14:12:16 +0100
+
 mesa (13.0.0-1) experimental; urgency=medium
 
   * New upstream release.

commit f2f487ebbb808010528edd69000694bfe525f87b
Author: Emil Velikov <emil.velikov@collabora.com>
Date:   Mon Nov 14 10:58:11 2016 +0000

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

diff --git a/docs/relnotes/13.0.1.html b/docs/relnotes/13.0.1.html
new file mode 100644
index 0000000..d317adb
--- /dev/null
+++ b/docs/relnotes/13.0.1.html
@@ -0,0 +1,187 @@
+<!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.1 Release Notes / November 14, 2016</h1>
+
+<p>
+Mesa 13.0.1 is a bug fix release which fixes bugs found since the 13.0.0 release.
+</p>
+<p>
+Mesa 13.0.1 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=97715";>Bug 97715</a> - [ILK,G45,G965] piglit.spec.arb_separate_shader_objects.misc api error checks</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=98012";>Bug 98012</a> - [IVB] Segfault when running Dolphin twice with Vulkan</li>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=98512";>Bug 98512</a> - radeon r600 vdpau: Invalid command stream: texture bo too small</li>
+
+</ul>
+
+
+<h2>Changes</h2>
+
+<p>Adam Jackson (2):</p>
+<ul>
+  <li>glx/glvnd: Don't modify the dummy slot in the dispatch table</li>
+  <li>glx/glvnd: Fix dispatch function names and indices</li>
+</ul>
+
+<p>Andreas Boll (1):</p>
+<ul>
+  <li>glx/windows: Add wgl.h to the sources list</li>
+</ul>
+
+<p>Anuj Phogat (1):</p>
+<ul>
+  <li>i965: Fix GPU hang related to multiple render targets and alpha testing</li>
+</ul>
+
+<p>Chih-Wei Huang (1):</p>
+<ul>
+  <li>android: avoid using libdrm with host modules</li>
+</ul>
+
+<p>Darren Salt (1):</p>
+<ul>
+  <li>radv/pipeline: Don't dereference NULL dynamic state pointers</li>
+</ul>
+
+<p>Dave Airlie (8):</p>
+<ul>
+  <li>radv: expose xlib platform extension</li>
+  <li>radv: fix dual source blending</li>
+  <li>Revert "st/vdpau: use linear layout for output surfaces"</li>
+  <li>radv: emit correct last export when Z/stencil export is enabled</li>
+  <li>ac/nir: add support for discard_if intrinsic (v2)</li>
+  <li>nir: add conditional discard optimisation (v4)</li>
+  <li>radv: enable conditional discard optimisation on radv.</li>
+  <li>radv: fix GetFenceStatus for signaled fences</li>
+</ul>
+
+<p>Emil Velikov (6):</p>
+<ul>
+  <li>docs: add sha256 checksums for 13.0.0</li>
+  <li>amd/addrlib: limit fastcall/regparm to GCC i386</li>
+  <li>anv: use correct .specVersion for extensions</li>
+  <li>radv: use correct .specVersion for extensions</li>
+  <li>radv: Suffix the radeon_icd file with the host CPU</li>
+  <li>Update version to 13.0.1</li>
+</ul>
+
+<p>Eric Anholt (1):</p>
+<ul>
+  <li>vc4: Use Newton-Raphson on the 1/W write to fix glmark2 terrain.</li>
+</ul>
+
+<p>Francisco Jerez (1):</p>
+<ul>
+  <li>nir: Flip gl_SamplePosition in nir_lower_wpos_ytransform().</li>
+</ul>
+
+<p>Fredrik Höglund (1):</p>
+<ul>
+  <li>radv: add support for anisotropic filtering on VI+</li>
+</ul>
+
+<p>Jason Ekstrand (21):</p>
+<ul>
+  <li>anv/device: Return DEVICE_LOST if execbuf2 fails</li>
+  <li>vulkan/wsi/x11: Better handle wsi_x11_connection_create failure</li>
+  <li>vulkan/wsi/x11: Clean up connections in finish_wsi</li>
+  <li>anv: Better handle return codes from anv_physical_device_init</li>
+  <li>intel/blorp: Use wm_prog_data instead of hand-rolling our own</li>
+  <li>intel/blorp: Pass a brw_stage_prog_data to upload_shader</li>
+  <li>anv/pipeline: Put actual pointers in anv_shader_bin</li>
+  <li>anv/pipeline: Properly cache prog_data::param</li>
+  <li>intel/blorp: Emit all the binding tables</li>
+  <li>anv/device: Add an execbuf wrapper</li>
+  <li>anv: Add a cmd_buffer_execbuf helper</li>
+  <li>anv: Don't presume to know what address is in a surface relocation</li>
+  <li>anv: Add a new bo_pool_init helper</li>
+  <li>anv/allocator: Simplify anv_scratch_pool</li>
+  <li>anv: Initialize anv_bo::offset to -1</li>
+  <li>anv/batch_chain: Improve write_reloc</li>
+  <li>anv: Add an anv_execbuf helper struct</li>
+  <li>anv/batch: Move last_ss_pool_bo_offset to the command buffer</li>
+  <li>anv: Move relocation handling from EndCommandBuffer to QueueSubmit</li>
+  <li>anv/cmd_buffer: Take a command buffer instead of a batch in two helpers</li>
+  <li>anv/cmd_buffer: Enable a CS stall workaround for Sky Lake gt4</li>
+</ul>
+
+<p>Kenneth Graunke (2):</p>
+<ul>
+  <li>glsl: Update deref types when resizing implicitly sized arrays.</li>
+  <li>mesa: Fix pixel shader scratch space allocation on Gen9+ platforms.</li>
+</ul>
+
+<p>Kristian Høgsberg (1):</p>
+<ul>
+  <li>anv: Do relocations in userspace before execbuf ioctl</li>
+</ul>
+
+<p>Marek Olšák (4):</p>
+<ul>
+  <li>egl: use util/macros.h</li>
+  <li>egl: make interop ABI visible again</li>
+  <li>glx: make interop ABI visible again</li>
+  <li>radeonsi: fix an assertion failure in si_decompress_sampler_color_textures</li>
+</ul>
+
+<p>Nicolai Hähnle (4):</p>
+<ul>
+  <li>radeonsi: fix BFE/BFI lowering for GLSL semantics</li>
+  <li>glsl: fix lowering of UBO references of named blocks</li>
+  <li>st/glsl_to_tgsi: fix dvec[34] loads from SSBO</li>
+  <li>st/mesa: fix the layer of VDPAU surface samplers</li>
+</ul>
+
+<p>Steven Toth (3):</p>
+<ul>
+  <li>gallium/hud: fix a problem where objects are free'd while in use.</li>
+  <li>gallium/hud: close a previously opened handle</li>
+  <li>gallium/hud: protect against and initialization race</li>
+</ul>
+
+<p>Timothy Arceri (1):</p>
+<ul>
+  <li>mesa/glsl: delete previously linked shaders earlier when linking</li>
+</ul>
+
+
+</div>
+</body>
+</html>

commit 11b9cdfcf91dc34416784f6617026a75929cbbdc
Author: Emil Velikov <emil.velikov@collabora.com>
Date:   Mon Nov 14 10:43:20 2016 +0000

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

diff --git a/VERSION b/VERSION
index 02161ca..5cb7d85 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-13.0.0
+13.0.1

commit 42d221723bd7acef0336402f36853c4c287cc67f
Author: Darren Salt <devspam@moreofthesa.me.uk>
Date:   Sun Oct 16 20:32:19 2016 +0100

    radv/pipeline: Don't dereference NULL dynamic state pointers
    
    This is a port of commit a4a59172482d50318a5ae7f99021bcf0125e0f53:
    
       Add guards to prevent dereferencing NULL dynamic pipeline state. Asserts
       of pCreateInfo members are moved to the earliest points at which they
       should not be NULL.
    
    This fixes a segfault, related to pColorBlendState, seen in Talos Principle
    which I've observed after startup is completed and when exiting the menus,
    depending on when Vulkan rendering is selected.
    
    v2: moved the NULL check in radv_pipeline_init_blend_state to after the
    declarations.
    Acked-by: Edward O'Callaghan <funfunctor@folklore1984.net>
    Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
    
    (cherry picked from commit 9b121512ac0f78d0996613664b456005d88370d2)

diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c
index 2cc256c..7c10b78 100644
--- a/src/amd/vulkan/radv_pipeline.c
+++ b/src/amd/vulkan/radv_pipeline.c
@@ -722,6 +722,10 @@ radv_pipeline_init_blend_state(struct radv_pipeline *pipeline,
 	bool blend_mrt0_is_dual_src = false;
 	int i;
 	bool single_cb_enable = false;
+
+	if (!vkblend)
+		return;
+
 	if (extra && extra->custom_blend_mode) {
 		single_cb_enable = true;
 		mode = extra->custom_blend_mode;
@@ -1076,18 +1080,27 @@ radv_pipeline_init_dynamic_state(struct radv_pipeline *pipeline,
 
 	struct radv_dynamic_state *dynamic = &pipeline->dynamic_state;
 
-	dynamic->viewport.count = pCreateInfo->pViewportState->viewportCount;
-	if (states & (1 << VK_DYNAMIC_STATE_VIEWPORT)) {
-		typed_memcpy(dynamic->viewport.viewports,
-			     pCreateInfo->pViewportState->pViewports,
-			     pCreateInfo->pViewportState->viewportCount);
-	}
+	/* Section 9.2 of the Vulkan 1.0.15 spec says:
+	 *
+	 *    pViewportState is [...] NULL if the pipeline
+	 *    has rasterization disabled.
+	 */
+	if (!pCreateInfo->pRasterizationState->rasterizerDiscardEnable) {
+		assert(pCreateInfo->pViewportState);
+
+		dynamic->viewport.count = pCreateInfo->pViewportState->viewportCount;
+		if (states & (1 << VK_DYNAMIC_STATE_VIEWPORT)) {
+			typed_memcpy(dynamic->viewport.viewports,
+				     pCreateInfo->pViewportState->pViewports,
+				     pCreateInfo->pViewportState->viewportCount);
+		}
 
-	dynamic->scissor.count = pCreateInfo->pViewportState->scissorCount;
-	if (states & (1 << VK_DYNAMIC_STATE_SCISSOR)) {
-		typed_memcpy(dynamic->scissor.scissors,
-			     pCreateInfo->pViewportState->pScissors,
-			     pCreateInfo->pViewportState->scissorCount);
+		dynamic->scissor.count = pCreateInfo->pViewportState->scissorCount;
+		if (states & (1 << VK_DYNAMIC_STATE_SCISSOR)) {
+			typed_memcpy(dynamic->scissor.scissors,
+				     pCreateInfo->pViewportState->pScissors,
+				     pCreateInfo->pViewportState->scissorCount);
+		}
 	}
 
 	if (states & (1 << VK_DYNAMIC_STATE_LINE_WIDTH)) {
@@ -1105,7 +1118,21 @@ radv_pipeline_init_dynamic_state(struct radv_pipeline *pipeline,
 			pCreateInfo->pRasterizationState->depthBiasSlopeFactor;
 	}
 
-	if (states & (1 << VK_DYNAMIC_STATE_BLEND_CONSTANTS)) {
+	/* Section 9.2 of the Vulkan 1.0.15 spec says:
+	 *
+	 *    pColorBlendState is [...] NULL if the pipeline has rasterization
+	 *    disabled or if the subpass of the render pass the pipeline is
+	 *    created against does not use any color attachments.
+	 */
+	bool uses_color_att = false;
+	for (unsigned i = 0; i < subpass->color_count; ++i) {
+		if (subpass->color_attachments[i].attachment != VK_ATTACHMENT_UNUSED) {
+			uses_color_att = true;
+			break;
+		}
+	}
+
+	if (uses_color_att && states & (1 << VK_DYNAMIC_STATE_BLEND_CONSTANTS)) {
 		assert(pCreateInfo->pColorBlendState);
 		typed_memcpy(dynamic->blend_constants,
 			     pCreateInfo->pColorBlendState->blendConstants, 4);
@@ -1117,14 +1144,17 @@ radv_pipeline_init_dynamic_state(struct radv_pipeline *pipeline,
 	 * no need to override the depthstencil defaults in
 	 * radv_pipeline::dynamic_state when there is no depthstencil attachment.
 	 *
-	 * From the Vulkan spec (20 Oct 2015, git-aa308cb):
+	 * Section 9.2 of the Vulkan 1.0.15 spec says:
 	 *
-	 *    pDepthStencilState [...] may only be NULL if renderPass and subpass
-	 *    specify a subpass that has no depth/stencil attachment.
+	 *    pDepthStencilState is [...] NULL if the pipeline has rasterization
+	 *    disabled or if the subpass of the render pass the pipeline is created
+	 *    against does not use a depth/stencil attachment.
 	 */
-	if (subpass->depth_stencil_attachment.attachment != VK_ATTACHMENT_UNUSED) {
+	if (!pCreateInfo->pRasterizationState->rasterizerDiscardEnable &&
+	    subpass->depth_stencil_attachment.attachment != VK_ATTACHMENT_UNUSED) {
+		assert(pCreateInfo->pDepthStencilState);
+
 		if (states & (1 << VK_DYNAMIC_STATE_DEPTH_BOUNDS)) {
-			assert(pCreateInfo->pDepthStencilState);
 			dynamic->depth_bounds.min =
 				pCreateInfo->pDepthStencilState->minDepthBounds;
 			dynamic->depth_bounds.max =
@@ -1132,7 +1162,6 @@ radv_pipeline_init_dynamic_state(struct radv_pipeline *pipeline,
 		}
 
 		if (states & (1 << VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK)) {
-			assert(pCreateInfo->pDepthStencilState);
 			dynamic->stencil_compare_mask.front =
 				pCreateInfo->pDepthStencilState->front.compareMask;
 			dynamic->stencil_compare_mask.back =
@@ -1140,7 +1169,6 @@ radv_pipeline_init_dynamic_state(struct radv_pipeline *pipeline,
 		}
 
 		if (states & (1 << VK_DYNAMIC_STATE_STENCIL_WRITE_MASK)) {
-			assert(pCreateInfo->pDepthStencilState);
 			dynamic->stencil_write_mask.front =
 				pCreateInfo->pDepthStencilState->front.writeMask;
 			dynamic->stencil_write_mask.back =
@@ -1148,7 +1176,6 @@ radv_pipeline_init_dynamic_state(struct radv_pipeline *pipeline,
 		}
 
 		if (states & (1 << VK_DYNAMIC_STATE_STENCIL_REFERENCE)) {
-			assert(pCreateInfo->pDepthStencilState);
 			dynamic->stencil_reference.front =
 				pCreateInfo->pDepthStencilState->front.reference;
 			dynamic->stencil_reference.back =

commit d6bcbfb36c9ecd3909ea82f6fb5c71ae77b39c7f
Author: Steven Toth <stoth@kernellabs.com>
Date:   Mon Oct 24 10:10:51 2016 -0400

    gallium/hud: protect against and initialization race
    
    In the event that multiple threads attempt to install a graph
    concurrently, protect the shared list.
    
    Signed-off-by: Steven Toth <stoth@kernellabs.com>
    Reviewed-by: Brian Paul <brianp@vmware.com>
    Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
    (cherry picked from commit 381edca826ee27b1a49f19b0731c777bdf241b20)

diff --git a/src/gallium/auxiliary/hud/hud_cpufreq.c b/src/gallium/auxiliary/hud/hud_cpufreq.c
index e66c3e4..19a6f08 100644
--- a/src/gallium/auxiliary/hud/hud_cpufreq.c
+++ b/src/gallium/auxiliary/hud/hud_cpufreq.c
@@ -36,6 +36,7 @@
 #include "hud/hud_private.h"
 #include "util/list.h"
 #include "os/os_time.h"
+#include "os/os_thread.h"
 #include "util/u_memory.h"
 #include <stdio.h>
 #include <unistd.h>
@@ -61,6 +62,7 @@ struct cpufreq_info
 
 static int gcpufreq_count = 0;
 static struct list_head gcpufreq_list;
+pipe_static_mutex(gcpufreq_mutex);
 
 static struct cpufreq_info *
 find_cfi_by_index(int cpu_index, int mode)
@@ -186,16 +188,21 @@ hud_get_num_cpufreq(bool displayhelp)
    int cpu_index;
 
    /* Return the number of CPU metrics we support. */
-   if (gcpufreq_count)
+   pipe_mutex_lock(gcpufreq_mutex);
+   if (gcpufreq_count) {
+      pipe_mutex_unlock(gcpufreq_mutex);
       return gcpufreq_count;
+   }
 
    /* Scan /sys/devices.../cpu, for every object type we support, create
     * and persist an object to represent its different metrics.
     */
    list_inithead(&gcpufreq_list);
    DIR *dir = opendir("/sys/devices/system/cpu");
-   if (!dir)
+   if (!dir) {
+      pipe_mutex_unlock(gcpufreq_mutex);
       return 0;
+   }
 
    while ((dp = readdir(dir)) != NULL) {
 
@@ -239,6 +246,7 @@ hud_get_num_cpufreq(bool displayhelp)
       }
    }
 
+   pipe_mutex_unlock(gcpufreq_mutex);
    return gcpufreq_count;
 }
 
diff --git a/src/gallium/auxiliary/hud/hud_diskstat.c b/src/gallium/auxiliary/hud/hud_diskstat.c
index d4306cd..af6e62d 100644
--- a/src/gallium/auxiliary/hud/hud_diskstat.c
+++ b/src/gallium/auxiliary/hud/hud_diskstat.c
@@ -35,6 +35,7 @@
 #include "hud/hud_private.h"
 #include "util/list.h"
 #include "os/os_time.h"
+#include "os/os_thread.h"
 #include "util/u_memory.h"
 #include <stdio.h>
 #include <unistd.h>
@@ -81,6 +82,7 @@ struct diskstat_info
  */
 static int gdiskstat_count = 0;
 static struct list_head gdiskstat_list;
+pipe_static_mutex(gdiskstat_mutex);
 
 static struct diskstat_info *
 find_dsi_by_name(const char *n, int mode)
@@ -244,16 +246,21 @@ hud_get_num_disks(bool displayhelp)
    char name[64];
 
    /* Return the number of block devices and partitions. */
-   if (gdiskstat_count)
+   pipe_mutex_lock(gdiskstat_mutex);
+   if (gdiskstat_count) {
+      pipe_mutex_unlock(gdiskstat_mutex);
       return gdiskstat_count;
+   }
 
    /* Scan /sys/block, for every object type we support, create and
     * persist an object to represent its different statistics.
     */
    list_inithead(&gdiskstat_list);
    DIR *dir = opendir("/sys/block/");
-   if (!dir)
+   if (!dir) {
+      pipe_mutex_unlock(gdiskstat_mutex);
       return 0;
+   }
 
    while ((dp = readdir(dir)) != NULL) {
 
@@ -278,6 +285,7 @@ hud_get_num_disks(bool displayhelp)
       struct dirent *dpart;
       DIR *pdir = opendir(basename);
       if (!pdir) {
+         pipe_mutex_unlock(gdiskstat_mutex);
          closedir(dir);
          return 0;
       }
@@ -312,6 +320,7 @@ hud_get_num_disks(bool displayhelp)
          puts(line);
       }
    }
+   pipe_mutex_unlock(gdiskstat_mutex);
 
    return gdiskstat_count;
 }
diff --git a/src/gallium/auxiliary/hud/hud_nic.c b/src/gallium/auxiliary/hud/hud_nic.c
index 2795c93..f9935de 100644
--- a/src/gallium/auxiliary/hud/hud_nic.c
+++ b/src/gallium/auxiliary/hud/hud_nic.c
@@ -35,6 +35,7 @@
 #include "hud/hud_private.h"
 #include "util/list.h"
 #include "os/os_time.h"
+#include "os/os_thread.h"
 #include "util/u_memory.h"
 #include <stdio.h>
 #include <unistd.h>
@@ -66,6 +67,7 @@ struct nic_info
  */
 static int gnic_count = 0;
 static struct list_head gnic_list;
+pipe_static_mutex(gnic_mutex);
 
 static struct nic_info *
 find_nic_by_name(const char *n, int mode)
@@ -329,16 +331,21 @@ hud_get_num_nics(bool displayhelp)
    char name[64];
 
    /* Return the number if network interfaces. */
-   if (gnic_count)
+   pipe_mutex_lock(gnic_mutex);
+   if (gnic_count) {
+      pipe_mutex_unlock(gnic_mutex);
       return gnic_count;
+   }
 
    /* Scan /sys/block, for every object type we support, create and
     * persist an object to represent its different statistics.
     */
    list_inithead(&gnic_list);
    DIR *dir = opendir("/sys/class/net/");
-   if (!dir)
+   if (!dir) {
+      pipe_mutex_unlock(gnic_mutex);
       return 0;
+   }
 
    while ((dp = readdir(dir)) != NULL) {
 
@@ -412,6 +419,7 @@ hud_get_num_nics(bool displayhelp)
 
    }
 
+   pipe_mutex_unlock(gnic_mutex);
    return gnic_count;
 }
 
diff --git a/src/gallium/auxiliary/hud/hud_sensors_temp.c b/src/gallium/auxiliary/hud/hud_sensors_temp.c
index 4a8a4fc..11b8a4c 100644
--- a/src/gallium/auxiliary/hud/hud_sensors_temp.c
+++ b/src/gallium/auxiliary/hud/hud_sensors_temp.c
@@ -32,6 +32,7 @@
 #include "hud/hud_private.h"
 #include "util/list.h"
 #include "os/os_time.h"
+#include "os/os_thread.h"
 #include "util/u_memory.h"
 #include <stdio.h>
 #include <unistd.h>
@@ -49,6 +50,7 @@
  */
 static int gsensors_temp_count = 0;
 static struct list_head gsensors_temp_list;
+pipe_static_mutex(gsensor_temp_mutex);
 
 struct sensors_temp_info
 {
@@ -322,12 +324,17 @@ int
 hud_get_num_sensors(bool displayhelp)
 {
    /* Return the number of sensors detected. */
-   if (gsensors_temp_count)
+   pipe_mutex_lock(gsensor_temp_mutex);
+   if (gsensors_temp_count) {
+      pipe_mutex_unlock(gsensor_temp_mutex);
       return gsensors_temp_count;
+   }
 
    int ret = sensors_init(NULL);
-   if (ret)
+   if (ret) {
+      pipe_mutex_unlock(gsensor_temp_mutex);
       return 0;
+   }
 
    list_inithead(&gsensors_temp_list);
 
@@ -361,6 +368,7 @@ hud_get_num_sensors(bool displayhelp)
       }
    }
 
+   pipe_mutex_unlock(gsensor_temp_mutex);
    return gsensors_temp_count;
 }
 

commit e19ed2971ffde8cc27e5839ae637996ab4074251
Author: Steven Toth <stoth@kernellabs.com>
Date:   Mon Oct 24 10:10:50 2016 -0400

    gallium/hud: close a previously opened handle
    
    We're missing the closedir() to the matching opendir().
    
    Signed-off-by: Steven Toth <stoth@kernellabs.com>
    Reviewed-by: Brian Paul <brianp@vmware.com>
    Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
    (cherry picked from commit 5a58323064b32442e2de23c95642bc421be696f8)

diff --git a/src/gallium/auxiliary/hud/hud_cpufreq.c b/src/gallium/auxiliary/hud/hud_cpufreq.c
index bfc748b..e66c3e4 100644
--- a/src/gallium/auxiliary/hud/hud_cpufreq.c
+++ b/src/gallium/auxiliary/hud/hud_cpufreq.c
@@ -225,6 +225,7 @@ hud_get_num_cpufreq(bool displayhelp)
       snprintf(fn, sizeof(fn), "%s/cpufreq/scaling_max_freq", basename);
       add_object(dp->d_name, fn, CPUFREQ_MAXIMUM, cpu_index);
    }
+   closedir(dir);
 
    if (displayhelp) {
       list_for_each_entry(struct cpufreq_info, cfi, &gcpufreq_list, list) {
diff --git a/src/gallium/auxiliary/hud/hud_diskstat.c b/src/gallium/auxiliary/hud/hud_diskstat.c
index 7d4f500..d4306cd 100644
--- a/src/gallium/auxiliary/hud/hud_diskstat.c
+++ b/src/gallium/auxiliary/hud/hud_diskstat.c
@@ -277,8 +277,10 @@ hud_get_num_disks(bool displayhelp)
       /* Add any partitions */
       struct dirent *dpart;
       DIR *pdir = opendir(basename);
-      if (!pdir)
+      if (!pdir) {
+         closedir(dir);
          return 0;
+      }
 
       while ((dpart = readdir(pdir)) != NULL) {
          /* Avoid 'lo' and '..' and '.' */
@@ -298,6 +300,7 @@ hud_get_num_disks(bool displayhelp)
          add_object_part(basename, dpart->d_name, DISKSTAT_WR);
       }
    }
+   closedir(dir);
 
    if (displayhelp) {
       list_for_each_entry(struct diskstat_info, dsi, &gdiskstat_list, list) {
diff --git a/src/gallium/auxiliary/hud/hud_nic.c b/src/gallium/auxiliary/hud/hud_nic.c
index 719dd04..2795c93 100644
--- a/src/gallium/auxiliary/hud/hud_nic.c
+++ b/src/gallium/auxiliary/hud/hud_nic.c
@@ -399,6 +399,7 @@ hud_get_num_nics(bool displayhelp)
       }
 
    }
+   closedir(dir);
 
    list_for_each_entry(struct nic_info, nic, &gnic_list, list) {
       char line[64];

commit 5fa2b384f04e38b9907a0e7288fbbb44cd56e33d
Author: Steven Toth <stoth@kernellabs.com>
Date:   Mon Oct 24 10:10:49 2016 -0400

    gallium/hud: fix a problem where objects are free'd while in use.
    
    Instead of trying to maintain a reference counted list of valid HUD
    objects, and freeing them accordingly, creating race conditions
    between unanticipated multiple threads, simply accept they're
    allocated once and never released until the process terminates.
    
    They're a shared resource between multiple threads, so accept
    they're always available for use.
    
    Signed-off-by: Steven Toth <stoth@kernellabs.com>
    Reviewed-by: Brian Paul <brianp@vmware.com>
    Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
    (cherry picked from commit 6ffed086795aaa84ab35668bb59d712cdde34da3)

diff --git a/src/gallium/auxiliary/hud/hud_cpufreq.c b/src/gallium/auxiliary/hud/hud_cpufreq.c
index 4501bbb..bfc748b 100644
--- a/src/gallium/auxiliary/hud/hud_cpufreq.c
+++ b/src/gallium/auxiliary/hud/hud_cpufreq.c
@@ -112,14 +112,6 @@ query_cfi_load(struct hud_graph *gr)
    }
 }
 
-static void
-free_query_data(void *p)
-{
-   struct cpufreq_info *cfi = (struct cpufreq_info *)p;
-   list_del(&cfi->list);
-   FREE(cfi);
-}
-
 /**
   * Create and initialize a new object for a specific CPU.
   * \param  pane  parent context.
@@ -162,11 +154,6 @@ hud_cpufreq_graph_install(struct hud_pane *pane, int cpu_index,
    gr->query_data = cfi;
    gr->query_new_value = query_cfi_load;
 
-   /* Don't use free() as our callback as that messes up Gallium's
-    * memory debugger.  Use simple free_query_data() wrapper.
-    */
-   gr->free_query_data = free_query_data;
-
    hud_pane_add_graph(pane, gr);
    hud_pane_set_max_value(pane, 3000000 /* 3 GHz */);
 }
diff --git a/src/gallium/auxiliary/hud/hud_diskstat.c b/src/gallium/auxiliary/hud/hud_diskstat.c
index b248baf..7d4f500 100644
--- a/src/gallium/auxiliary/hud/hud_diskstat.c
+++ b/src/gallium/auxiliary/hud/hud_diskstat.c
@@ -162,14 +162,6 @@ query_dsi_load(struct hud_graph *gr)
    }
 }
 
-static void
-free_query_data(void *p)
-{
-   struct diskstat_info *nic = (struct diskstat_info *) p;
-   list_del(&nic->list);
-   FREE(nic);
-}
-
 /**
   * Create and initialize a new object for a specific block I/O device.
   * \param  pane  parent context.
@@ -208,11 +200,6 @@ hud_diskstat_graph_install(struct hud_pane *pane, const char *dev_name,
    gr->query_data = dsi;
    gr->query_new_value = query_dsi_load;
 
-   /* Don't use free() as our callback as that messes up Gallium's
-    * memory debugger.  Use simple free_query_data() wrapper.
-    */
-   gr->free_query_data = free_query_data;
-
    hud_pane_add_graph(pane, gr);
    hud_pane_set_max_value(pane, 100);
 }
diff --git a/src/gallium/auxiliary/hud/hud_nic.c b/src/gallium/auxiliary/hud/hud_nic.c
index fb6b8c0..719dd04 100644
--- a/src/gallium/auxiliary/hud/hud_nic.c
+++ b/src/gallium/auxiliary/hud/hud_nic.c
@@ -234,14 +234,6 @@ query_nic_load(struct hud_graph *gr)
    }
 }
 
-static void
-free_query_data(void *p)
-{
-   struct nic_info *nic = (struct nic_info *) p;
-   list_del(&nic->list);
-   FREE(nic);
-}
-
 /**
   * Create and initialize a new object for a specific network interface dev.
   * \param  pane  parent context.
@@ -284,11 +276,6 @@ hud_nic_graph_install(struct hud_pane *pane, const char *nic_name,
    gr->query_data = nic;
    gr->query_new_value = query_nic_load;
 
-   /* Don't use free() as our callback as that messes up Gallium's
-    * memory debugger.  Use simple free_query_data() wrapper.
-    */
-   gr->free_query_data = free_query_data;
-
    hud_pane_add_graph(pane, gr);
    hud_pane_set_max_value(pane, 100);
 }
diff --git a/src/gallium/auxiliary/hud/hud_sensors_temp.c b/src/gallium/auxiliary/hud/hud_sensors_temp.c
index e41b847..4a8a4fc 100644
--- a/src/gallium/auxiliary/hud/hud_sensors_temp.c
+++ b/src/gallium/auxiliary/hud/hud_sensors_temp.c
@@ -189,17 +189,6 @@ query_sti_load(struct hud_graph *gr)
    }
 }
 
-static void
-free_query_data(void *p)
-{
-   struct sensors_temp_info *sti = (struct sensors_temp_info *) p;
-   list_del(&sti->list);
-   if (sti->chip)
-      sensors_free_chip_name(sti->chip);
-   FREE(sti);
-   sensors_cleanup();
-}
-
 /**
   * Create and initialize a new object for a specific sensor interface dev.
   * \param  pane  parent context.
@@ -237,11 +226,6 @@ hud_sensors_temp_graph_install(struct hud_pane *pane, const char *dev_name,
    gr->query_data = sti;
    gr->query_new_value = query_sti_load;
 
-   /* Don't use free() as our callback as that messes up Gallium's
-    * memory debugger.  Use simple free_query_data() wrapper.
-    */
-   gr->free_query_data = free_query_data;
-
    hud_pane_add_graph(pane, gr);
    switch (sti->mode) {
    case SENSORS_TEMP_CURRENT:

commit e7de2510e5fc1a4ce602da2d41f1b7d7b9db8873
Author: Kenneth Graunke <kenneth@whitecape.org>
Date:   Mon Nov 7 17:12:54 2016 -0800

    mesa: Fix pixel shader scratch space allocation on Gen9+ platforms.
    
    We had missed a bit of errata - PS scratch needs to be computed as if
    there were 4 subslices per slice, rather than 3.
    
                              Skylake      Broxton        Kabylake
                          GT1 GT2 GT3 GT4  2x6 3x6  GT1 GT1.5 GT2 GT3 GT4
    Actual Slices          1   1   2   3    1   1    1    1    1   2   3
    Total Subslices        3   3   6   9    2   3    2    3    3   6   9
    Subsl. for PS Scratch  4   4   8   12   4   4    4    4    4   8   12
    
    Note that Skylake GT1-3 already worked because we allocated 64 * 9
    (trying to use a value that would work on GT4, with 9 subslices),
    and the actual required values were 64 * 4 or 64 * 8.  However, all
    others (Skylake GT4, Broxton, and Kabylake GT1-4) underallocated,
    which can lead to scratch writes trashing random process memory,
    and rendering corruption or GPU hangs.
    
    Fixes GPU hangs and rendering corruption on Skylake GT4 in shaders that
    spill.  Particularly, dEQP-GLES31.functional.ubo.all_per_block_buffers.*
    now runs successfully with no hangs and renders correctly.  This may
    fix problems on Broxton and Kabylake as well.
    
    Cc: "13.0" <mesa-stable@lists.freedesktop.org>
    Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
    Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
    (cherry picked from commit aaee3daa90578fb711cc89186a65bc3d2c68022f)

diff --git a/src/intel/common/gen_device_info.c b/src/intel/common/gen_device_info.c
index 30df0b2..1dc1769 100644
--- a/src/intel/common/gen_device_info.c
+++ b/src/intel/common/gen_device_info.c
@@ -335,7 +335,6 @@ static const struct gen_device_info gen_device_info_chv = {
    .max_gs_threads = 336,                           \
    .max_tcs_threads = 336,                          \
    .max_tes_threads = 336,                          \
-   .max_wm_threads = 64 * 9,                        \
    .max_cs_threads = 56,                            \
    .urb = {                                         \
       .size = 384,                                  \
@@ -388,7 +387,6 @@ static const struct gen_device_info gen_device_info_bxt = {
    .max_tcs_threads = 112,
    .max_tes_threads = 112,
    .max_gs_threads = 112,
-   .max_wm_threads = 64 * 3,
    .max_cs_threads = 6 * 6,
    .urb = {
       .size = 192,
@@ -411,7 +409,6 @@ static const struct gen_device_info gen_device_info_bxt_2x6 = {
    .max_tcs_threads = 56, /* XXX: guess */
    .max_tes_threads = 56,
    .max_gs_threads = 56,
-   .max_wm_threads = 64 * 2,
    .max_cs_threads = 6 * 6,
    .urb = {
       .size = 128,
@@ -427,18 +424,11 @@ static const struct gen_device_info gen_device_info_bxt_2x6 = {
  * There's no KBL entry. Using the default SKL (GEN9) GS entries value.
  */
 
-/*
- * Both SKL and KBL support a maximum of 64 threads per
- * Pixel Shader Dispatch (PSD) unit.
- */
-#define  KBL_MAX_THREADS_PER_PSD 64
-
 static const struct gen_device_info gen_device_info_kbl_gt1 = {
    GEN9_FEATURES,
    .gt = 1,
 
    .max_cs_threads = 7 * 6,
-   .max_wm_threads = KBL_MAX_THREADS_PER_PSD * 2,
    .urb.size = 192,
    .num_slices = 1,
 };
@@ -448,7 +438,6 @@ static const struct gen_device_info gen_device_info_kbl_gt1_5 = {
    .gt = 1,
 
    .max_cs_threads = 7 * 6,
-   .max_wm_threads = KBL_MAX_THREADS_PER_PSD * 3,
    .num_slices = 1,


Reply to: