Mesa (master): i965/glk: Add l3 banks count for 2x6 configuration

2018-05-21 Thread Mark Janes
Module: Mesa
Branch: master
Commit: 0748383a6014886ef0bf7bda16fd0efef39c405d
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=0748383a6014886ef0bf7bda16fd0efef39c405d

Author: Anuj Phogat 
Date:   Mon May 21 15:21:56 2018 -0700

i965/glk: Add l3 banks count for 2x6 configuration

2x6 configuration with pci-id 0x3185 has same number of
banks (2) as 3x6 configuration (pci-id 0x3184).

Reported-by: Clayton Craft 
Signed-off-by: Anuj Phogat 
Tested-by: Clayton Craft 
Reviewed-by: Lionel Landwerlin 
Fixes: eb23be1d97da "i965: Add and initialize l3_banks field for gen7+"
Cc: Francisco Jerez 

---

 src/intel/dev/gen_device_info.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/intel/dev/gen_device_info.c b/src/intel/dev/gen_device_info.c
index 653cece6d7..8e97132989 100644
--- a/src/intel/dev/gen_device_info.c
+++ b/src/intel/dev/gen_device_info.c
@@ -732,10 +732,10 @@ static const struct gen_device_info gen_device_info_glk = 
{
.l3_banks = 2,
 };
 
-/*TODO: Initialize l3_banks when we know the number. */
 static const struct gen_device_info gen_device_info_glk_2x6 = {
GEN9_LP_FEATURES_2X6,
.is_geminilake = true,
+   .l3_banks = 2,
 };
 
 static const struct gen_device_info gen_device_info_cfl_gt1 = {

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): Revert "anv/device: expose shaderInt16 support in gen8+"

2018-05-03 Thread Mark Janes
Module: Mesa
Branch: master
Commit: 7cf284f18e6774c810ed6db17b98e597bf96f8a5
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=7cf284f18e6774c810ed6db17b98e597bf96f8a5

Author: Mark Janes <mark.a.ja...@intel.com>
Date:   Thu May  3 14:28:22 2018 -0700

Revert "anv/device: expose shaderInt16 support in gen8+"

This reverts commit 0ba0ac815e078185c1f408ec7078fd1efac1a634.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106393
Reviewed-by: Scott D Phillips <scott.d.phill...@intel.com>

---

 src/intel/vulkan/anv_device.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c
index fd516fb846..0563eae5c1 100644
--- a/src/intel/vulkan/anv_device.c
+++ b/src/intel/vulkan/anv_device.c
@@ -759,7 +759,7 @@ void anv_GetPhysicalDeviceFeatures(
   
pdevice->info.has_64bit_types,
   .shaderInt64  = pdevice->info.gen >= 8 &&
   
pdevice->info.has_64bit_types,
-  .shaderInt16  = pdevice->info.gen >= 8,
+  .shaderInt16  = false,
   .shaderResourceMinLod = false,
   .variableMultisampleRate  = true,
   .inheritedQueries = true,

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): Revert "i965/compiler: handle conversion to smaller type in the lowering pass for that"

2018-05-03 Thread Mark Janes
Module: Mesa
Branch: master
Commit: 7b9c15628aae8729118b648f5f473e6ac926b99b
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=7b9c15628aae8729118b648f5f473e6ac926b99b

Author: Mark Janes <mark.a.ja...@intel.com>
Date:   Thu May  3 14:28:00 2018 -0700

Revert "i965/compiler: handle conversion to smaller type in the lowering pass 
for that"

This reverts commit 96b51537908cd2aace85f54b437eeb72e6346b7e.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106393
Reviewed-by: Scott D Phillips <scott.d.phill...@intel.com>

---

 src/intel/compiler/brw_fs_lower_conversions.cpp |  5 +
 src/intel/compiler/brw_fs_nir.cpp   | 14 +++---
 2 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/src/intel/compiler/brw_fs_lower_conversions.cpp 
b/src/intel/compiler/brw_fs_lower_conversions.cpp
index f95b39d3e8..663c9674c4 100644
--- a/src/intel/compiler/brw_fs_lower_conversions.cpp
+++ b/src/intel/compiler/brw_fs_lower_conversions.cpp
@@ -54,7 +54,7 @@ fs_visitor::lower_conversions()
   bool saturate = inst->saturate;
 
   if (supports_type_conversion(inst)) {
- if (type_sz(inst->dst.type) < get_exec_type_size(inst)) {
+ if (get_exec_type_size(inst) == 8 && type_sz(inst->dst.type) < 8) {
 /* From the Broadwell PRM, 3D Media GPGPU, "Double Precision Float 
to
  * Single Precision Float":
  *
@@ -64,9 +64,6 @@ fs_visitor::lower_conversions()
  * So we need to allocate a temporary that's two registers, and 
then do
  * a strided MOV to get the lower DWord of every Qword that has the
  * result.
- *
- * This restriction applies, in general, whenever we convert to
- * a type with a smaller bit-size.
  */
 fs_reg temp = ibld.vgrf(get_exec_type(inst));
 fs_reg strided_temp = subscript(temp, dst.type, 0);
diff --git a/src/intel/compiler/brw_fs_nir.cpp 
b/src/intel/compiler/brw_fs_nir.cpp
index 4c8bcc4ebc..f9fde145a1 100644
--- a/src/intel/compiler/brw_fs_nir.cpp
+++ b/src/intel/compiler/brw_fs_nir.cpp
@@ -755,9 +755,19 @@ fs_visitor::nir_emit_alu(const fs_builder , 
nir_alu_instr *instr)
*/
 
case nir_op_f2f16_undef:
-  inst = bld.MOV(result, op[0]);
+   case nir_op_i2i16:
+   case nir_op_u2u16: {
+  /* TODO: Fixing aligment rules for conversions from 32-bits to
+   * 16-bit types should be moved to lower_conversions
+   */
+  fs_reg tmp = bld.vgrf(op[0].type, 1);
+  tmp = subscript(tmp, result.type, 0);
+  inst = bld.MOV(tmp, op[0]);
+  inst->saturate = instr->dest.saturate;
+  inst = bld.MOV(result, tmp);
   inst->saturate = instr->dest.saturate;
   break;
+   }
 
case nir_op_f2f64:
case nir_op_f2i64:
@@ -797,8 +807,6 @@ fs_visitor::nir_emit_alu(const fs_builder , 
nir_alu_instr *instr)
case nir_op_f2u16:
case nir_op_i2i32:
case nir_op_u2u32:
-   case nir_op_i2i16:
-   case nir_op_u2u16:
case nir_op_i2f16:
case nir_op_u2f16:
   inst = bld.MOV(result, op[0]);

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): Revert "i965: Only emit 3DSTATE_DRAWING_RECTANGLE once on gen8+"

2018-02-28 Thread Mark Janes
Module: Mesa
Branch: master
Commit: 0fc009b8c7bd6fb4a2cc77e9c4d0440acdc58ee1
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=0fc009b8c7bd6fb4a2cc77e9c4d0440acdc58ee1

Author: Mark Janes <mark.a.ja...@intel.com>
Date:   Wed Feb 28 17:26:08 2018 -0800

Revert "i965: Only emit 3DSTATE_DRAWING_RECTANGLE once on gen8+"

This reverts commit a2c1e48f15995a826dc759e064c2603882a37e0c.

On BDWGT3e and KBLGT3e systems, this commit regressed the following
tests:

  piglit.spec.ext_framebuffer_multisample.accuracy 2 stencil_resolve small 
depthstencil
  piglit.spec.ext_framebuffer_multisample.accuracy 4 stencil_resolve small 
depthstencil
  piglit.spec.ext_framebuffer_multisample.accuracy 6 stencil_resolve small 
depthstencil
  piglit.spec.ext_framebuffer_multisample.accuracy 8 stencil_resolve small 
depthstencil
  piglit.spec.ext_framebuffer_multisample.accuracy all_samples stencil_resolve 
small depthstencil

---

 src/mesa/drivers/dri/i965/brw_misc_state.c| 9 -
 src/mesa/drivers/dri/i965/genX_blorp_exec.c   | 2 --
 src/mesa/drivers/dri/i965/genX_state_upload.c | 4 ++--
 3 files changed, 2 insertions(+), 13 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_misc_state.c 
b/src/mesa/drivers/dri/i965/brw_misc_state.c
index 2d2517d2bd..c4ef6812bf 100644
--- a/src/mesa/drivers/dri/i965/brw_misc_state.c
+++ b/src/mesa/drivers/dri/i965/brw_misc_state.c
@@ -573,15 +573,6 @@ brw_upload_invariant_state(struct brw_context *brw)
BEGIN_BATCH(1);
OUT_BATCH(_3DSTATE_VF_STATISTICS << 16 | 1);
ADVANCE_BATCH();
-
-   if (devinfo->gen >= 8) {
-  BEGIN_BATCH(4);
-  OUT_BATCH(_3DSTATE_DRAWING_RECTANGLE << 16 | 1);
-  OUT_BATCH(0);
-  OUT_BATCH(~0);
-  OUT_BATCH(0);
-  ADVANCE_BATCH();
-   }
 }
 
 /**
diff --git a/src/mesa/drivers/dri/i965/genX_blorp_exec.c 
b/src/mesa/drivers/dri/i965/genX_blorp_exec.c
index aa97981dd1..062171af60 100644
--- a/src/mesa/drivers/dri/i965/genX_blorp_exec.c
+++ b/src/mesa/drivers/dri/i965/genX_blorp_exec.c
@@ -276,12 +276,10 @@ retry:
gen8_write_pma_stall_bits(brw, 0);
 #endif
 
-#if GEN_GEN < 8
blorp_emit(batch, GENX(3DSTATE_DRAWING_RECTANGLE), rect) {
   rect.ClippedDrawingRectangleXMax = MAX2(params->x1, params->x0) - 1;
   rect.ClippedDrawingRectangleYMax = MAX2(params->y1, params->y0) - 1;
}
-#endif
 
blorp_exec(batch, params);
 
diff --git a/src/mesa/drivers/dri/i965/genX_state_upload.c 
b/src/mesa/drivers/dri/i965/genX_state_upload.c
index eda812868b..b38b61a874 100644
--- a/src/mesa/drivers/dri/i965/genX_state_upload.c
+++ b/src/mesa/drivers/dri/i965/genX_state_upload.c
@@ -280,7 +280,6 @@ static const struct brw_tracked_state genX(line_stipple) = {
.emit = genX(upload_line_stipple),
 };
 
-#if GEN_GEN < 8
 /* Constant single cliprect for framebuffer object or DRI2 drawing */
 static void
 genX(upload_drawing_rect)(struct brw_context *brw)
@@ -304,7 +303,6 @@ static const struct brw_tracked_state genX(drawing_rect) = {
},
.emit = genX(upload_drawing_rect),
 };
-#endif
 
 static uint32_t *
 genX(emit_vertex_buffer_state)(struct brw_context *brw,
@@ -5658,6 +5656,8 @@ genX(init_atoms)(struct brw_context *brw)
 
   (line_stipple),
 
+  (drawing_rect),
+
   (vf_topology),
 
   _indices,

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): Revert "mesa: reduce the size of gl_texture_image"

2018-02-13 Thread Mark Janes
Module: Mesa
Branch: master
Commit: 3e5758a70a62534fd70c0c6d43ab202ce4be313a
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=3e5758a70a62534fd70c0c6d43ab202ce4be313a

Author: Mark Janes <mark.a.ja...@intel.com>
Date:   Mon Feb 12 23:47:18 2018 -0800

Revert "mesa: reduce the size of gl_texture_image"

This reverts commit f4ea2b2a9e99d93fbf36c3f0e5f6f384be3cdb89.

Several members reduced in size by the offending commit are not large
enough to store the data needed by the i965 driver.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105067

---

 src/mesa/main/mtypes.h | 47 +++
 1 file changed, 23 insertions(+), 24 deletions(-)

diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index b619d5c02d..a589bd4bb2 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -965,36 +965,35 @@ typedef enum
  */
 struct gl_texture_image
 {
-   struct gl_texture_object *TexObject;  /**< Pointer back to parent object */
-
-   GLenum16 InternalFormat;/**< Internal format as given by the user */
+   GLint InternalFormat;   /**< Internal format as given by the user */
GLenum16 _BaseFormat;   /**< Either GL_RGB, GL_RGBA, GL_ALPHA,
-*   GL_LUMINANCE, GL_LUMINANCE_ALPHA,
-*   GL_INTENSITY, GL_DEPTH_COMPONENT or
-*   GL_DEPTH_STENCIL_EXT only. Used for
-*   choosing TexEnv arithmetic.
-*/
-   mesa_format TexFormat:16;/**< The actual texture memory format */
-
-   GLushort Width; /**< = 2^WidthLog2 + 2*Border */
-   GLushort Height;/**< = 2^HeightLog2 + 2*Border */
-   GLushort Depth; /**< = 2^DepthLog2 + 2*Border */
-   GLushort Width2;/**< = Width - 2*Border */
-   GLushort Height2;   /**< = Height - 2*Border */
-   GLushort Depth2;/**< = Depth - 2*Border */
-   GLubyte WidthLog2;  /**< = log2(Width2) */
-   GLubyte HeightLog2; /**< = log2(Height2) */
-   GLubyte DepthLog2;  /**< = log2(Depth2) */
-   GLubyte Border; /**< 0 or 1 */
-   GLubyte MaxNumLevels;   /**< = maximum possible number of mipmap
+ *   GL_LUMINANCE, GL_LUMINANCE_ALPHA,
+ *   GL_INTENSITY, GL_DEPTH_COMPONENT or
+ *   GL_DEPTH_STENCIL_EXT only. Used for
+ *   choosing TexEnv arithmetic.
+ */
+   mesa_format TexFormat; /**< The actual texture memory format */
+
+   GLuint Border;  /**< 0 or 1 */
+   GLuint Width;   /**< = 2^WidthLog2 + 2*Border */
+   GLuint Height;  /**< = 2^HeightLog2 + 2*Border */
+   GLuint Depth;   /**< = 2^DepthLog2 + 2*Border */
+   GLuint Width2;  /**< = Width - 2*Border */
+   GLuint Height2; /**< = Height - 2*Border */
+   GLuint Depth2;  /**< = Depth - 2*Border */
+   GLuint WidthLog2;   /**< = log2(Width2) */
+   GLuint HeightLog2;  /**< = log2(Height2) */
+   GLuint DepthLog2;   /**< = log2(Depth2) */
+   GLuint MaxNumLevels;/**< = maximum possible number of mipmap
levels, computed from the dimensions */
 
-   GLubyte Level;/**< Which mipmap level am I? */
+   struct gl_texture_object *TexObject;  /**< Pointer back to parent object */
+   GLuint Level;/**< Which mipmap level am I? */
/** Cube map face: index into gl_texture_object::Image[] array */
-   GLubyte Face;
+   GLuint Face;
 
/** GL_ARB_texture_multisample */
-   GLubyte NumSamples;/**< Sample count, or 0 for non-multisample 
*/
+   GLuint NumSamples;/**< Sample count, or 0 for non-multisample */
GLboolean FixedSampleLocations; /**< Same sample locations for all pixels? 
*/
 };
 

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): Partially revert "mesa: use GLenum16 in a few more places"

2018-02-13 Thread Mark Janes
Module: Mesa
Branch: master
Commit: d9de7aaca3857122046389d1f86acd249c6a5972
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=d9de7aaca3857122046389d1f86acd249c6a5972

Author: Mark Janes <mark.a.ja...@intel.com>
Date:   Mon Feb 12 22:15:47 2018 -0800

Partially revert "mesa: use GLenum16 in a few more places"

This reverts part of commit ca721b3d894a49d7342f5aa053ed132017e9352a.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105067

---

 src/mesa/main/mtypes.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index a589bd4bb2..7da3240da7 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -1068,7 +1068,7 @@ struct gl_texture_object
GLbyte _MaxLevel;   /**< actual max mipmap level (q in the spec) */
GLfloat _MaxLambda; /**< = _MaxLevel - BaseLevel (q - p in spec) */
GLint CropRect[4];  /**< GL_OES_draw_texture */
-   GLenum16 Swizzle[4];/**< GL_EXT_texture_swizzle */
+   GLenum Swizzle[4];  /**< GL_EXT_texture_swizzle */
GLushort _Swizzle;  /**< same as Swizzle, but SWIZZLE_* format */
GLbyte ImmutableLevels; /**< ES 3.0 / ARB_texture_view */
GLboolean GenerateMipmap;   /**< GL_SGIS_generate_mipmap */

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): mesa: fix compile failure

2018-02-13 Thread Mark Janes
Module: Mesa
Branch: master
Commit: e5809788d674f637f14fdd74cbd0c72055256192
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=e5809788d674f637f14fdd74cbd0c72055256192

Author: Mark Janes <mark.a.ja...@intel.com>
Date:   Mon Feb 12 23:19:35 2018 -0800

mesa: fix compile failure

Missing header triggered a failure in i965 CI buildtest project.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105067
Fixes: e149a0253c12d103805230bc7bc0a36887c3b8df

---

 src/mesa/program/prog_statevars.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/mesa/program/prog_statevars.h 
b/src/mesa/program/prog_statevars.h
index 6cb3531233..f28d2bb4a3 100644
--- a/src/mesa/program/prog_statevars.h
+++ b/src/mesa/program/prog_statevars.h
@@ -27,6 +27,7 @@
 
 
 #include "main/glheader.h"
+#include "compiler/shader_enums.h"
 
 
 #ifdef __cplusplus

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): i965: fix tessellation regressions with gl_state_index16

2018-02-12 Thread Mark Janes
Module: Mesa
Branch: master
Commit: db5f4221696a665e403c8374d6c7d8794d810ae6
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=db5f4221696a665e403c8374d6c7d8794d810ae6

Author: Dave Airlie <airl...@redhat.com>
Date:   Tue Feb 13 12:21:07 2018 +1000

i965: fix tessellation regressions with gl_state_index16

Looks like one conversion was missed.

Fixes: e149a0253 (mesa,glsl,nir: reduce gl_state_index size to 2 bytes)
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105067
Signed-off-by: Dave Airlie <airl...@redhat.com>
Tested-by: Mark Janes <mark.a.ja...@intel.com>

---

 src/mesa/drivers/dri/i965/brw_nir_uniforms.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/brw_nir_uniforms.cpp 
b/src/mesa/drivers/dri/i965/brw_nir_uniforms.cpp
index 9c4fb22a90..10a4ff40e5 100644
--- a/src/mesa/drivers/dri/i965/brw_nir_uniforms.cpp
+++ b/src/mesa/drivers/dri/i965/brw_nir_uniforms.cpp
@@ -251,7 +251,7 @@ brw_nir_lower_patch_vertices_in_to_uniform(nir_shader *nir)
   if (var->data.location != SYSTEM_VALUE_VERTICES_IN)
  continue;
 
-  gl_state_index tokens[STATE_LENGTH] = {
+  gl_state_index16 tokens[STATE_LENGTH] = {
  STATE_INTERNAL,
  nir->info.stage == MESA_SHADER_TESS_CTRL ?
 STATE_TCS_PATCH_VERTICES_IN : STATE_TES_PATCH_VERTICES_IN,

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): Revert "i965: prevent potentially null pointer access"

2018-02-09 Thread Mark Janes
Module: Mesa
Branch: master
Commit: 9a05c66feb0c3c7877999827ce70765c656338f1
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=9a05c66feb0c3c7877999827ce70765c656338f1

Author: Mark Janes <mark.a.ja...@intel.com>
Date:   Fri Feb  9 09:37:57 2018 -0800

Revert "i965: prevent potentially null pointer access"

This reverts commit 712332ed54f14b5ee34c2990e351ca48992488b2, which
caused over 90k failures in Mesa i965 CI.

Reviewed-by: Dylan Baker <dy...@pnwbakers.com>

---

 src/mesa/drivers/dri/i965/intel_screen.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/intel_screen.c 
b/src/mesa/drivers/dri/i965/intel_screen.c
index 3f74ee78f3..1f866cf845 100644
--- a/src/mesa/drivers/dri/i965/intel_screen.c
+++ b/src/mesa/drivers/dri/i965/intel_screen.c
@@ -315,7 +315,7 @@ modifier_is_supported(const struct gen_device_info *devinfo,
int i;
 
/* ISL had better know about the modifier */
-   if (!fmt || !modinfo)
+   if (!modinfo)
   return false;
 
if (modinfo->aux_usage == ISL_AUX_USAGE_CCS_E) {

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): Revert "spirv: consider bitsize when handling OpSwitch cases"

2017-12-21 Thread Mark Janes
Module: Mesa
Branch: master
Commit: 7665383a33f9ce9256aa121cbe4d3bd948dff145
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=7665383a33f9ce9256aa121cbe4d3bd948dff145

Author: Mark Janes <mark.a.ja...@intel.com>
Date:   Thu Dec 21 12:15:40 2017 -0800

Revert "spirv: consider bitsize when handling OpSwitch cases"

This reverts commit 9702fac68e8bd07be8871f7925d7f9fb98da3699, which
hangs vulkancts and crucible on all platforms.

The patch is being reverted because it disables continuous integration
testing.  The patch from bug 104359 does not apply to master.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104359

---

 src/compiler/spirv/vtn_cfg.c | 14 +++---
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/src/compiler/spirv/vtn_cfg.c b/src/compiler/spirv/vtn_cfg.c
index 9c4cbe2e6a..8582c4f0e9 100644
--- a/src/compiler/spirv/vtn_cfg.c
+++ b/src/compiler/spirv/vtn_cfg.c
@@ -513,14 +513,13 @@ vtn_cfg_walk_blocks(struct vtn_builder *b, struct 
list_head *cf_list,
  "Selector of OpSelect must have a type of OpTypeInt");
 
  bool is_default = true;
- const uint bitsize = nir_alu_type_get_type_size(cond_type);
  for (const uint32_t *w = block->branch + 2; w < branch_end;) {
 uint64_t literal = 0;
 if (!is_default) {
-   if (bitsize <= 32) {
+   if (nir_alu_type_get_type_size(cond_type) <= 32) {
   literal = *(w++);
} else {
-  assert(bitsize == 64);
+  assert(nir_alu_type_get_type_size(cond_type) == 64);
   literal = vtn_u64_literal(w);
   w += 2;
}
@@ -545,7 +544,7 @@ vtn_cfg_walk_blocks(struct vtn_builder *b, struct list_head 
*cf_list,
  /* Finally, we walk over all of the cases one more time and put
   * them in fall-through order.
   */
- for (const uint32_t *w = block->branch + 2; w < branch_end;) {
+ for (const uint32_t *w = block->branch + 2; w < branch_end; w += 2) {
 struct vtn_block *case_block =
vtn_value(b, *w, vtn_value_type_block)->block;
 
@@ -555,13 +554,6 @@ vtn_cfg_walk_blocks(struct vtn_builder *b, struct 
list_head *cf_list,
 vtn_assert(case_block->switch_case);
 
 vtn_order_case(swtch, case_block->switch_case);
-
-if (bitsize <= 32) {
-   w += 2;
-} else {
-   assert(bitsize == 64);
-   w += 3;
-}
  }
 
  enum vtn_branch_type branch_type =

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): Revert "egl: Allow creation of per surface out fence"

2017-08-30 Thread Mark Janes
Module: Mesa
Branch: master
Commit: 8c9df0daf20206fafb7df77b1edcbc41b8e91372
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=8c9df0daf20206fafb7df77b1edcbc41b8e91372

Author: Mark Janes <mark.a.ja...@intel.com>
Date:   Wed Aug 30 08:45:36 2017 -0700

Revert "egl: Allow creation of per surface out fence"

This reverts commit 13c23b19d0b3b965d666498eb759e63fc4a625d9.

Mesa CI was brought down by this commit, with:

mesa/drivers/dri/i965/brw_sync.c:491: brw_dri_create_fence_fd:
Assertion `brw->screen->has_exec_fence' failed.

---

 src/egl/drivers/dri2/egl_dri2.c | 71 -
 src/egl/drivers/dri2/egl_dri2.h |  9 
 src/egl/drivers/dri2/platform_android.c | 29 ++--
 src/egl/drivers/dri2/platform_drm.c |  3 +-
 src/egl/drivers/dri2/platform_surfaceless.c |  3 +-
 src/egl/drivers/dri2/platform_wayland.c |  3 +-
 src/egl/drivers/dri2/platform_x11.c |  3 +-
 src/egl/drivers/dri2/platform_x11_dri3.c|  3 +-
 8 files changed, 18 insertions(+), 106 deletions(-)

diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index af238a974c..2667aa5d64 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -1388,45 +1388,6 @@ dri2_destroy_context(_EGLDriver *drv, _EGLDisplay *disp, 
_EGLContext *ctx)
return EGL_TRUE;
 }
 
-EGLBoolean
-dri2_init_surface(_EGLSurface *surf, _EGLDisplay *dpy, EGLint type,
-_EGLConfig *conf, const EGLint *attrib_list, EGLBoolean 
enable_out_fence)
-{
-   struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surf);
-   struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
-
-   dri2_surf->out_fence_fd = -1;
-   dri2_surf->enable_out_fence = false;
-   if (dri2_dpy->fence && dri2_dpy->fence->base.version >= 2 &&
-   dri2_dpy->fence->get_capabilities &&
-   (dri2_dpy->fence->get_capabilities(dri2_dpy->dri_screen) &
-__DRI_FENCE_CAP_NATIVE_FD)) {
-  dri2_surf->enable_out_fence = enable_out_fence;
-   }
-
-   return _eglInitSurface(surf, dpy, type, conf, attrib_list);
-}
-
-static void
-dri2_surface_set_out_fence_fd( _EGLSurface *surf, int fence_fd)
-{
-   struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surf);
-
-   if (dri2_surf->out_fence_fd >=0)
-  close(dri2_surf->out_fence_fd);
-
-   dri2_surf->out_fence_fd = fence_fd;
-}
-
-void
-dri2_fini_surface(_EGLSurface *surf)
-{
-   struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surf);
-
-   dri2_surface_set_out_fence_fd(surf, -1);
-   dri2_surf->enable_out_fence = false;
-}
-
 static EGLBoolean
 dri2_destroy_surface(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf)
 {
@@ -1438,28 +1399,6 @@ dri2_destroy_surface(_EGLDriver *drv, _EGLDisplay *dpy, 
_EGLSurface *surf)
return dri2_dpy->vtbl->destroy_surface(drv, dpy, surf);
 }
 
-static void
-dri2_surf_update_fence_fd(_EGLContext *ctx,
-  _EGLDisplay *dpy, _EGLSurface *surf)
-{
-   __DRIcontext *dri_ctx = dri2_egl_context(ctx)->dri_context;
-   struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
-   struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surf);
-   int fence_fd = -1;
-   void *fence;
-
-   if (!dri2_surf->enable_out_fence)
-  return;
-
-   fence = dri2_dpy->fence->create_fence_fd(dri_ctx, -1);
-   if (fence) {
-  fence_fd = dri2_dpy->fence->get_fence_fd(dri2_dpy->dri_screen,
-   fence);
-  dri2_dpy->fence->destroy_fence(dri2_dpy->dri_screen, fence);
-   }
-   dri2_surface_set_out_fence_fd(surf, fence_fd);
-}
-
 /**
  * Called via eglMakeCurrent(), drv->API.MakeCurrent().
  */
@@ -1496,8 +1435,6 @@ dri2_make_current(_EGLDriver *drv, _EGLDisplay *disp, 
_EGLSurface *dsurf,
 
if (old_ctx) {
   __DRIcontext *old_cctx = dri2_egl_context(old_ctx)->dri_context;
-  if (old_dsurf)
- dri2_surf_update_fence_fd(old_ctx, disp, old_dsurf);
   dri2_dpy->core->unbindContext(old_cctx);
}
 
@@ -1636,10 +1573,6 @@ static EGLBoolean
 dri2_swap_buffers(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf)
 {
struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
-   _EGLContext *ctx = _eglGetCurrentContext();
-
-   if (ctx && surf)
-  dri2_surf_update_fence_fd(ctx, dpy, surf);
return dri2_dpy->vtbl->swap_buffers(drv, dpy, surf);
 }
 
@@ -1649,10 +1582,6 @@ dri2_swap_buffers_with_damage(_EGLDriver *drv, 
_EGLDisplay *dpy,
   const EGLint *rects, EGLint n_rects)
 {
struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
-   _EGLContext *ctx = _eglGetCurrentContext();
-
-   if (ctx && surf)
-  dri2_surf_update_fence_fd(ctx, dpy, surf);
return dri2_dpy->vtbl->swap_buffers_with_damage(drv, dpy, surf,
rects, n_

Mesa (master): Android: add missing u_math.h include path for libmesa_isl

2016-06-28 Thread Mark Janes
Module: Mesa
Branch: master
Commit: 789ed13284cb99b96f2aa69f237959b27c5c3bc2
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=789ed13284cb99b96f2aa69f237959b27c5c3bc2

Author: Rob Herring 
Date:   Mon Jun 13 13:45:53 2016 -0500

Android: add missing u_math.h include path for libmesa_isl

Commit 87d062a94080 ("i965: Fix shared local memory size for Gen9+.")
added u_math.h include which broke the Android build:

In file included from external/mesa3d/src/intel/isl/isl_storage_image.c:25:
In file included from 
external/mesa3d/src/mesa/drivers/dri/i965/brw_compiler.h:29:
external/mesa3d/src/mesa/main/macros.h:35:10: fatal error: 'util/u_math.h' file 
not found
 ^

Add the missing include paths for libmesa_isl.

Signed-off-by: Rob Herring 
Reviewed-by: Kenneth Garunke 

---

 src/intel/isl/Android.mk | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/intel/isl/Android.mk b/src/intel/isl/Android.mk
index ff0c8c9..c828c5c 100644
--- a/src/intel/isl/Android.mk
+++ b/src/intel/isl/Android.mk
@@ -116,6 +116,8 @@ LOCAL_MODULE := libmesa_isl
 LOCAL_SRC_FILES := $(ISL_FILES)
 
 LOCAL_C_INCLUDES := \
+   $(MESA_TOP)/src/gallium/include \
+   $(MESA_TOP)/src/gallium/auxiliary \
$(MESA_TOP)/src/mapi \
$(MESA_TOP)/src/mesa \
$(MESA_TOP)/src/mesa/drivers/dri/i965 \

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): glsl: Guard against NULL dereference

2016-05-20 Thread Mark Janes
Module: Mesa
Branch: master
Commit: 9ca5ec2a317f00dd03d11c3463d4354baf21aaf0
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=9ca5ec2a317f00dd03d11c3463d4354baf21aaf0

Author: Mark Janes <mark.a.ja...@intel.com>
Date:   Fri May 20 08:50:39 2016 -0700

glsl: Guard against NULL dereference

This trivially corrects mesa 3ca1c221, which introduced a check that
crashes when a match is not found.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95005
Fixes: 
piglit.spec.glsl-1_50.compiler.interface-blocks-name-reused-globally-4.vert
Reviewed-by: Alejandro Piñeiro <apinhe...@igalia.com>

---

 src/compiler/glsl/ast_to_hir.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp
index ecfe684..a524fbd 100644
--- a/src/compiler/glsl/ast_to_hir.cpp
+++ b/src/compiler/glsl/ast_to_hir.cpp
@@ -6920,7 +6920,7 @@ ast_struct_specifier::hir(exec_list *instructions,
if (!state->symbols->add_type(name, t)) {
   const glsl_type *match = state->symbols->get_type(name);
   /* allow struct matching for desktop GL - older UE4 does this */
-  if (state->is_version(130, 0) && match->record_compare(t, false))
+  if (match != NULL && state->is_version(130, 0) && 
match->record_compare(t, false))
  _mesa_glsl_warning(& loc, state, "struct `%s' previously defined", 
name);
   else
  _mesa_glsl_error(& loc, state, "struct `%s' previously defined", 
name);

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): mesa: Build EGL without X11 headers after interop patchset

2016-05-20 Thread Mark Janes
Module: Mesa
Branch: master
Commit: 4e2c9a04354b6b133845b8b93c0c5d34261a91d0
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=4e2c9a04354b6b133845b8b93c0c5d34261a91d0

Author: Youry Metlitsky 
Date:   Wed Apr 27 22:33:14 2016 +

mesa: Build EGL without X11 headers after interop patchset

Reviewed-by: Marek Olšák 

---

 include/GL/mesa_glinterop.h | 15 ++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/include/GL/mesa_glinterop.h b/include/GL/mesa_glinterop.h
index 814064d..39822f2 100644
--- a/include/GL/mesa_glinterop.h
+++ b/include/GL/mesa_glinterop.h
@@ -50,7 +50,11 @@
 #ifndef MESA_GLINTEROP_H
 #define MESA_GLINTEROP_H
 
+#if defined(MESA_EGL_NO_X11_HEADERS)
+#include 
+#else
 #include 
+#endif
 #include 
 
 #ifdef __cplusplus
@@ -219,6 +223,7 @@ typedef struct _mesa_glinterop_export_out {
 } mesa_glinterop_export_out;
 
 
+#if !defined(MESA_EGL_NO_X11_HEADERS)
 /**
  * Query device information.
  *
@@ -228,9 +233,11 @@ typedef struct _mesa_glinterop_export_out {
  *
  * \return MESA_GLINTEROP_SUCCESS or MESA_GLINTEROP_* != 0 on error
  */
+
 GLAPI int GLAPIENTRY
 MesaGLInteropGLXQueryDeviceInfo(Display *dpy, GLXContext context,
 mesa_glinterop_device_info *out);
+#endif
 
 
 /**
@@ -242,6 +249,7 @@ MesaGLInteropEGLQueryDeviceInfo(EGLDisplay dpy, EGLContext 
context,
 mesa_glinterop_device_info *out);
 
 
+#if !defined(MESA_EGL_NO_X11_HEADERS)
 /**
  * Create and return a DMABUF handle corresponding to the given OpenGL
  * object, and return other parameters about the OpenGL object.
@@ -253,10 +261,12 @@ MesaGLInteropEGLQueryDeviceInfo(EGLDisplay dpy, 
EGLContext context,
  *
  * \return MESA_GLINTEROP_SUCCESS or MESA_GLINTEROP_* != 0 on error
  */
+
 GLAPI int GLAPIENTRY
 MesaGLInteropGLXExportObject(Display *dpy, GLXContext context,
  const mesa_glinterop_export_in *in,
  mesa_glinterop_export_out *out);
+#endif
 
 
 /**
@@ -268,14 +278,17 @@ MesaGLInteropEGLExportObject(EGLDisplay dpy, EGLContext 
context,
  const mesa_glinterop_export_in *in,
  mesa_glinterop_export_out *out);
 
-
+#if !defined(MESA_EGL_NO_X11_HEADERS)
 typedef int (APIENTRYP PFNMESAGLINTEROPGLXQUERYDEVICEINFOPROC)(Display *dpy, 
GLXContext context,

mesa_glinterop_device_info *out);
+#endif
 typedef int (APIENTRYP PFNMESAGLINTEROPEGLQUERYDEVICEINFOPROC)(EGLDisplay dpy, 
EGLContext context,

mesa_glinterop_device_info *out);
+#if !defined(MESA_EGL_NO_X11_HEADERS)
 typedef int (APIENTRYP PFNMESAGLINTEROPGLXEXPORTOBJECTPROC)(Display *dpy, 
GLXContext context,
 const 
mesa_glinterop_export_in *in,
 
mesa_glinterop_export_out *out);
+#endif
 typedef int (APIENTRYP PFNMESAGLINTEROPEGLEXPORTOBJECTPROC)(EGLDisplay dpy, 
EGLContext context,
 const 
mesa_glinterop_export_in *in,
 
mesa_glinterop_export_out *out);

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): i965: Fix strerror error code sign

2016-05-20 Thread Mark Janes
Module: Mesa
Branch: master
Commit: a2d28ddc016af5e819f4b8648a64893b331095b2
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=a2d28ddc016af5e819f4b8648a64893b331095b2

Author: Mark Janes <mark.a.ja...@intel.com>
Date:   Thu May 19 13:42:16 2016 -0700

i965: Fix strerror error code sign

This trivial fix to error-handling corrects the sign of drm error
codes before passing them to strerror.

Identified by Coverity: CID1358581

---

 src/mesa/drivers/dri/i965/intel_screen.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/intel_screen.c 
b/src/mesa/drivers/dri/i965/intel_screen.c
index 1a0541a..076fa24 100644
--- a/src/mesa/drivers/dri/i965/intel_screen.c
+++ b/src/mesa/drivers/dri/i965/intel_screen.c
@@ -,7 +,7 @@ intel_detect_sseu(struct intel_screen *intelScreen)
 err_out:
intelScreen->subslice_total = -1;
intelScreen->eu_total = -1;
-   _mesa_warning(NULL, "Failed to query GPU properties (%s).\n", 
strerror(ret));
+   _mesa_warning(NULL, "Failed to query GPU properties (%s).\n", 
strerror(-ret));
 }
 
 static bool

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): anv/batch_chain: free pointers for error cases

2016-05-18 Thread Mark Janes
Module: Mesa
Branch: master
Commit: 4dfa89e33c810bac02e2678814621d2f3868d58b
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=4dfa89e33c810bac02e2678814621d2f3868d58b

Author: Mark Janes <mark.a.ja...@intel.com>
Date:   Wed May 18 14:28:38 2016 -0700

anv/batch_chain: free pointers for error cases

Trivial fix to improperly handled cleanup during
VK_ERROR_OUT_OF_HOST_MEMORY.

Identified by Coverity: CID 1358908 and 1358909
Reviewed-by: Jason Ekstrand <ja...@jlekstrand.net>

---

 src/intel/vulkan/anv_batch_chain.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/intel/vulkan/anv_batch_chain.c 
b/src/intel/vulkan/anv_batch_chain.c
index 36c9565..a98a0a9 100644
--- a/src/intel/vulkan/anv_batch_chain.c
+++ b/src/intel/vulkan/anv_batch_chain.c
@@ -120,7 +120,7 @@ anv_reloc_list_grow(struct anv_reloc_list *list,
struct anv_bo **new_reloc_bos =
   anv_alloc(alloc, new_length * sizeof(*list->reloc_bos), 8,
 VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
-   if (new_relocs == NULL) {
+   if (new_reloc_bos == NULL) {
   anv_free(alloc, new_relocs);
   return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
}
@@ -891,7 +891,7 @@ anv_cmd_buffer_add_bo(struct anv_cmd_buffer *cmd_buffer,
  struct anv_bo **new_bos =
 anv_alloc(_buffer->pool->alloc, new_len * sizeof(*new_bos),
   8, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
- if (new_objects == NULL) {
+ if (new_bos == NULL) {
 anv_free(_buffer->pool->alloc, new_objects);
 return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
  }

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): i965: check tcs for NULL dereference

2016-05-16 Thread Mark Janes
Module: Mesa
Branch: master
Commit: fd854c1add853eb3363d735da2faca9c9c092e4c
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=fd854c1add853eb3363d735da2faca9c9c092e4c

Author: Mark Janes <mark.a.ja...@intel.com>
Date:   Fri May 13 13:04:56 2016 -0700

i965: check tcs for NULL dereference

Coverity issue 1361544 found an instance where the tcs variable is
checked for NULL, but unconditionally dereferenced later in the same
function.

Reviewed-by: Kenneth Graunke <kenn...@whitecape.org>

---

 src/mesa/drivers/dri/i965/brw_tcs.c | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_tcs.c 
b/src/mesa/drivers/dri/i965/brw_tcs.c
index e8178c6..9589fa5 100644
--- a/src/mesa/drivers/dri/i965/brw_tcs.c
+++ b/src/mesa/drivers/dri/i965/brw_tcs.c
@@ -278,14 +278,16 @@ brw_codegen_tcs_prog(struct brw_context *brw,
 
if (unlikely(brw->perf_debug)) {
   struct brw_shader *btcs = (struct brw_shader *) tcs;
-  if (btcs->compiled_once) {
- brw_tcs_debug_recompile(brw, shader_prog, key);
+  if (btcs) {
+ if (btcs->compiled_once) {
+brw_tcs_debug_recompile(brw, shader_prog, key);
+ }
+ btcs->compiled_once = true;
   }
   if (start_busy && !drm_intel_bo_busy(brw->batch.last_bo)) {
  perf_debug("TCS compile took %.03f ms and stalled the GPU\n",
 (get_time() - start_time) * 1000);
   }
-  btcs->compiled_once = true;
}
 
/* Scratch space is used for register spilling */

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): mesa/objectlabel: handle NULL src string

2016-05-03 Thread Mark Janes
Module: Mesa
Branch: master
Commit: 0af8a7d50ce0fdb8063f7fadd3b78975a2136d87
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=0af8a7d50ce0fdb8063f7fadd3b78975a2136d87

Author: Mark Janes <mark.a.ja...@intel.com>
Date:   Tue May  3 13:50:49 2016 -0700

mesa/objectlabel: handle NULL src string

This prevents a crash when a NULL src is passed with a non-NULL length.

fixes: dEQP-GLES31.functional.debug.object_labels.query_length_only
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95252

Signed-off-by: Mark Janes <mark.a.ja...@intel.com>
Reviewed-by: Dave Airlie <airl...@redhat.com>

---

 src/mesa/main/objectlabel.c | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/mesa/main/objectlabel.c b/src/mesa/main/objectlabel.c
index b77cb5c..5070b00 100644
--- a/src/mesa/main/objectlabel.c
+++ b/src/mesa/main/objectlabel.c
@@ -104,13 +104,14 @@ copy_label(const GLchar *src, GLchar *dst, GLsizei 
*length, GLsizei bufSize)
 * will be returned in ."
 */
 
+   if (src)
+  labelLen = strlen(src);
+
if (bufSize == 0) {
   if (length)
- *length = strlen(src);
+ *length = labelLen;
   return;
}
-   if (src)
-  labelLen = strlen(src);
 
if (dst) {
   if (src) {

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): util: Fix race condition on libgcrypt initialization

2016-04-15 Thread Mark Janes
Module: Mesa
Branch: master
Commit: ade3108bb5b074013417b31e61b8077ccefb7484
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=ade3108bb5b074013417b31e61b8077ccefb7484

Author: Mark Janes <mark.a.ja...@intel.com>
Date:   Tue Apr 12 11:52:53 2016 -0700

util: Fix race condition on libgcrypt initialization

Fixes intermittent Vulkan CTS failures within the test groups:
dEQP-VK.api.object_management.multithreaded_per_thread_device
dEQP-VK.api.object_management.multithreaded_per_thread_resources
dEQP-VK.api.object_management.multithreaded_shared_resources

Signed-off-by: Mark Janes <mark.a.ja...@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94904

Reviewed-by: Edward O'Callaghan <eocallag...@alterapraxis.com>
Reviewed-by: Jason Ekstrand <ja...@jlekstrand.net>

---

 src/util/mesa-sha1.c | 19 +++
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/src/util/mesa-sha1.c b/src/util/mesa-sha1.c
index faa1c87..ca6b89b 100644
--- a/src/util/mesa-sha1.c
+++ b/src/util/mesa-sha1.c
@@ -175,21 +175,24 @@ _mesa_sha1_final(struct mesa_sha1 *ctx, unsigned char 
result[20])
 #elif defined(HAVE_SHA1_IN_LIBGCRYPT)   /* Use libgcrypt for SHA1 */
 
 #include 
+#include "c11/threads.h"
+
+static void _mesa_libgcrypt_init(void)
+{
+   if (!gcry_check_version(NULL))
+  return NULL;
+   gcry_control(GCRYCTL_DISABLE_SECMEM, 0);
+   gcry_control(GCRYCTL_INITIALIZATION_FINISHED, 0);
+}
 
 struct mesa_sha1 *
 _mesa_sha1_init(void)
 {
-   static int init;
+   static once_flag flag = ONCE_FLAG_INIT;
gcry_md_hd_t h;
gcry_error_t err;
 
-   if (!init) {
-  if (!gcry_check_version(NULL))
- return NULL;
-  gcry_control(GCRYCTL_DISABLE_SECMEM, 0);
-  gcry_control(GCRYCTL_INITIALIZATION_FINISHED, 0);
-  init = 1;
-   }
+   call_once(, _mesa_libgcrypt_init);
 
err = gcry_md_open(, GCRY_MD_SHA1, 0);
if (err)

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (vulkan): util: Fix race condition on libgcrypt initialization

2016-04-12 Thread Mark Janes
Module: Mesa
Branch: vulkan
Commit: 9e351e077befbdc179f7926edd8b5dde02f20494
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=9e351e077befbdc179f7926edd8b5dde02f20494

Author: Mark Janes <mark.a.ja...@intel.com>
Date:   Tue Apr 12 11:52:53 2016 -0700

util: Fix race condition on libgcrypt initialization

Fixes intermittent Vulkan CTS failures within the test groups:
dEQP-VK.api.object_management.multithreaded_per_thread_device
dEQP-VK.api.object_management.multithreaded_per_thread_resources
dEQP-VK.api.object_management.multithreaded_shared_resources

Signed-off-by: Mark Janes <mark.a.ja...@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94904

Reviewed-by: Edward O'Callaghan <eocallag...@alterapraxis.com>
Reviewed-by: Jason Ekstrand <ja...@jlekstrand.net>

---

 src/util/mesa-sha1.c | 19 +++
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/src/util/mesa-sha1.c b/src/util/mesa-sha1.c
index faa1c87..ca6b89b 100644
--- a/src/util/mesa-sha1.c
+++ b/src/util/mesa-sha1.c
@@ -175,21 +175,24 @@ _mesa_sha1_final(struct mesa_sha1 *ctx, unsigned char 
result[20])
 #elif defined(HAVE_SHA1_IN_LIBGCRYPT)   /* Use libgcrypt for SHA1 */
 
 #include 
+#include "c11/threads.h"
+
+static void _mesa_libgcrypt_init(void)
+{
+   if (!gcry_check_version(NULL))
+  return NULL;
+   gcry_control(GCRYCTL_DISABLE_SECMEM, 0);
+   gcry_control(GCRYCTL_INITIALIZATION_FINISHED, 0);
+}
 
 struct mesa_sha1 *
 _mesa_sha1_init(void)
 {
-   static int init;
+   static once_flag flag = ONCE_FLAG_INIT;
gcry_md_hd_t h;
gcry_error_t err;
 
-   if (!init) {
-  if (!gcry_check_version(NULL))
- return NULL;
-  gcry_control(GCRYCTL_DISABLE_SECMEM, 0);
-  gcry_control(GCRYCTL_INITIALIZATION_FINISHED, 0);
-  init = 1;
-   }
+   call_once(, _mesa_libgcrypt_init);
 
err = gcry_md_open(, GCRY_MD_SHA1, 0);
if (err)

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (vulkan): vulkan: fix out-of-tree builds

2016-02-22 Thread Mark Janes
Module: Mesa
Branch: vulkan
Commit: 08b408311cb8fdbeae6d7ff5474107b0868c6ec9
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=08b408311cb8fdbeae6d7ff5474107b0868c6ec9

Author: Mark Janes <mark.a.ja...@intel.com>
Date:   Mon Feb 22 11:31:15 2016 -0800

vulkan: fix out-of-tree builds

---

 src/intel/vulkan/Makefile.am | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/intel/vulkan/Makefile.am b/src/intel/vulkan/Makefile.am
index 6be4f9f..53cfa20 100644
--- a/src/intel/vulkan/Makefile.am
+++ b/src/intel/vulkan/Makefile.am
@@ -66,6 +66,7 @@ AM_CPPFLAGS = \
-I$(top_builddir)/src/compiler \
-I$(top_builddir)/src/compiler/nir \
-I$(top_builddir)/src/intel \
+   -I$(top_builddir)/src/intel/genxml \
-I$(top_builddir)/src/vulkan
 
 libvulkan_intel_la_CFLAGS = $(CFLAGS) -Wno-override-init

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (vulkan): vulkan: fix out-of-tree build

2016-02-18 Thread Mark Janes
Module: Mesa
Branch: vulkan
Commit: 1b37276467e47919256c0a171b92004d3cfaaab4
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=1b37276467e47919256c0a171b92004d3cfaaab4

Author: Mark Janes <mark.a.ja...@intel.com>
Date:   Thu Feb 18 12:30:27 2016 -0800

vulkan: fix out-of-tree build

We need to be able to find the generated gen*pack.h headers.

Acked-by: Jason Ekstrand <jason.ekstr...@intel.com>

---

 src/intel/vulkan/Makefile.am | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/intel/vulkan/Makefile.am b/src/intel/vulkan/Makefile.am
index 2144e5a..ccd9885 100644
--- a/src/intel/vulkan/Makefile.am
+++ b/src/intel/vulkan/Makefile.am
@@ -65,6 +65,7 @@ AM_CPPFLAGS = \
-I$(top_builddir)/src \
-I$(top_builddir)/src/compiler \
-I$(top_builddir)/src/compiler/nir \
+   -I$(top_builddir)/src/intel \
-I$(top_builddir)/src/vulkan
 
 libvulkan_intel_la_CFLAGS = $(CFLAGS) -Wno-override-init

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit