Re: [Mesa-dev] [PATCH 4/6] ddebug: use util_snprintf() in dd_get_debug_filename_and_mkdir

2018-08-01 Thread Nicolai Hähnle

Reviewed-by: Nicolai Hähnle 

On 01.08.2018 20:53, Andres Gomez wrote:

Instead of plain snprintf(). To fix the MSVC 2013 build:

   Compiling src\gallium\auxiliary\driver_ddebug\dd_draw.c ...
dd_draw.c
c:\projects\mesa\src\gallium\auxiliary\driver_ddebug\dd_util.h(60) : warning 
C4013: 'snprintf' undefined; assuming extern returning int

...

gallium.lib(dd_draw.obj) : error LNK2001: unresolved external symbol _snprintf
build\windows-x86-debug\gallium\targets\graw-gdi\graw.dll : fatal error 
LNK1120: 1 unresolved externals
scons: *** [build\windows-x86-debug\gallium\targets\graw-gdi\graw.dll] Error 
1120
scons: building terminated because of errors.

Fixes: 6ff0c6f4ebc ("gallium: move ddebug, noop, rbug, trace to auxiliary to improve 
build times")
Cc: Marek Olšák 
Cc: Brian Paul 
Cc: Roland Scheidegger 
Cc: Nicolai Hähnle 
Signed-off-by: Andres Gomez 
---
  src/gallium/auxiliary/driver_ddebug/dd_util.h | 7 ---
  1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/gallium/auxiliary/driver_ddebug/dd_util.h 
b/src/gallium/auxiliary/driver_ddebug/dd_util.h
index 8953e34d588..7720e9af9ca 100644
--- a/src/gallium/auxiliary/driver_ddebug/dd_util.h
+++ b/src/gallium/auxiliary/driver_ddebug/dd_util.h
@@ -35,6 +35,7 @@
  #include "os/os_process.h"
  #include "util/u_atomic.h"
  #include "util/u_debug.h"
+#include "util/u_string.h"
  
  #include "pipe/p_config.h"

  #ifdef PIPE_OS_UNIX
@@ -57,13 +58,13 @@ dd_get_debug_filename_and_mkdir(char *buf, size_t buflen, 
bool verbose)
strcpy(proc_name, "unknown");
 }
  
-   snprintf(dir, sizeof(dir), "%s/"DD_DIR, debug_get_option("HOME", "."));

+   util_snprintf(dir, sizeof(dir), "%s/"DD_DIR, debug_get_option("HOME", "."));
  
 if (mkdir(dir, 0774) && errno != EEXIST)

fprintf(stderr, "dd: can't create a directory (%i)\n", errno);
  
-   snprintf(buf, buflen, "%s/%s_%u_%08u", dir, proc_name, getpid(),

-p_atomic_inc_return() - 1);
+   util_snprintf(buf, buflen, "%s/%s_%u_%08u", dir, proc_name, getpid(),
+ p_atomic_inc_return() - 1);
  
 if (verbose)

fprintf(stderr, "dd: dumping to file %s\n", buf);



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


[Mesa-dev] [RFC][PATCH 5/5] i965: add functional changes for AMD_depth_clamp_separate

2018-08-01 Thread Sagar Ghuge
Gen >= 9 have ability to control clamping of depth values
separately at near and far plane.

z_w is clamped to the range [min(n,f), 0] if clamping
at near plane is enabled, [0, max(n,f)] if clamping at
far plane is enabled and [min(n,f) max(n,f)] if clamping
at both plane is enabled.

Signed-off-by: Sagar Ghuge 
---
 src/mesa/drivers/dri/i965/genX_state_upload.c | 21 ---
 src/mesa/drivers/dri/i965/intel_extensions.c  |  1 +
 2 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/genX_state_upload.c 
b/src/mesa/drivers/dri/i965/genX_state_upload.c
index ea5ad55be5..75d9bd2b9b 100644
--- a/src/mesa/drivers/dri/i965/genX_state_upload.c
+++ b/src/mesa/drivers/dri/i965/genX_state_upload.c
@@ -2341,6 +2341,12 @@ genX(upload_cc_viewport)(struct brw_context *brw)
   if (ctx->Transform.DepthClamp) {
  ccv.MinimumDepth = MIN2(vp->Near, vp->Far);
  ccv.MaximumDepth = MAX2(vp->Near, vp->Far);
+  } else if (ctx->Transform.DepthClampNear) {
+ ccv.MinimumDepth = MIN2(vp->Near, vp->Far);
+ ccv.MaximumDepth = 0.0;
+  } else if (ctx->Transform.DepthClampFar) {
+ ccv.MinimumDepth = 0.0;
+ ccv.MaximumDepth = MAX2(vp->Near, vp->Far);
   } else {
  ccv.MinimumDepth = 0.0;
  ccv.MaximumDepth = 1.0;
@@ -4603,15 +4609,24 @@ genX(upload_raster)(struct brw_context *brw)
   /* _NEW_SCISSOR */
   raster.ScissorRectangleEnable = ctx->Scissor.EnableFlags;
 
+#if GEN_GEN < 9
   /* _NEW_TRANSFORM */
   if (!ctx->Transform.DepthClamp) {
+ raster.ViewportZClipTestEnable = true;
+  }
+#endif
+
 #if GEN_GEN >= 9
- raster.ViewportZFarClipTestEnable = true;
+  if (!ctx->Transform.DepthClampNear) {
  raster.ViewportZNearClipTestEnable = true;
-#else
- raster.ViewportZClipTestEnable = true;
+  }
 #endif
+
+#if GEN_GEN >= 9
+  if (!ctx->Transform.DepthClampFar) {
+ raster.ViewportZFarClipTestEnable = true;
   }
+#endif
 
   /* BRW_NEW_CONSERVATIVE_RASTERIZATION */
 #if GEN_GEN >= 9
diff --git a/src/mesa/drivers/dri/i965/intel_extensions.c 
b/src/mesa/drivers/dri/i965/intel_extensions.c
index 2e28445ae3..0b7ce7b368 100644
--- a/src/mesa/drivers/dri/i965/intel_extensions.c
+++ b/src/mesa/drivers/dri/i965/intel_extensions.c
@@ -300,6 +300,7 @@ intelInitExtensions(struct gl_context *ctx)
}
 
if (devinfo->gen >= 9) {
+  ctx->Extensions.AMD_depth_clamp_separate = true;
   ctx->Extensions.ANDROID_extension_pack_es31a = true;
   ctx->Extensions.ARB_shader_stencil_export = true;
   ctx->Extensions.KHR_blend_equation_advanced_coherent = true;
-- 
2.17.1

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


[Mesa-dev] [RFC][PATCH 3/5] mesa: Add support for AMD_depth_clamp_separate

2018-08-01 Thread Sagar Ghuge
enable _mesa_PushAttrib() and _mesa_PopAttrib()
to handle GL_DEPTH_CLAMP_NEAR_AMD and
GL_DEPTH_CLAMP_FAR_AMD tokens.

Signed-off-by: Sagar Ghuge 
---
 src/mesa/main/attrib.c | 16 
 1 file changed, 16 insertions(+)

diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c
index cbe93ab6fa..d9f165b428 100644
--- a/src/mesa/main/attrib.c
+++ b/src/mesa/main/attrib.c
@@ -73,6 +73,8 @@ struct gl_enable_attrib
GLboolean ColorMaterial;
GLboolean CullFace;
GLboolean DepthClamp;
+   GLboolean DepthClampNear;
+   GLboolean DepthClampFar;
GLboolean DepthTest;
GLboolean Dither;
GLboolean Fog;
@@ -337,6 +339,8 @@ _mesa_PushAttrib(GLbitfield mask)
   attr->ColorMaterial = ctx->Light.ColorMaterialEnabled;
   attr->CullFace = ctx->Polygon.CullFlag;
   attr->DepthClamp = ctx->Transform.DepthClamp;
+  attr->DepthClampNear = ctx->Transform.DepthClampNear;
+  attr->DepthClampFar = ctx->Transform.DepthClampFar;
   attr->DepthTest = ctx->Depth.Test;
   attr->Dither = ctx->Color.DitherFlag;
   attr->Fog = ctx->Fog.Enabled;
@@ -629,6 +633,10 @@ pop_enable_group(struct gl_context *ctx, const struct 
gl_enable_attrib *enable)
TEST_AND_UPDATE(ctx->Polygon.CullFlag, enable->CullFace, GL_CULL_FACE);
TEST_AND_UPDATE(ctx->Transform.DepthClamp, enable->DepthClamp,
GL_DEPTH_CLAMP);
+   TEST_AND_UPDATE(ctx->Transform.DepthClampNear, enable->DepthClampNear,
+   GL_DEPTH_CLAMP_NEAR_AMD);
+   TEST_AND_UPDATE(ctx->Transform.DepthClampFar, enable->DepthClampFar,
+   GL_DEPTH_CLAMP_FAR_AMD);
TEST_AND_UPDATE(ctx->Depth.Test, enable->DepthTest, GL_DEPTH_TEST);
TEST_AND_UPDATE(ctx->Color.DitherFlag, enable->Dither, GL_DITHER);
TEST_AND_UPDATE(ctx->Fog.Enabled, enable->Fog, GL_FOG);
@@ -1150,6 +1158,8 @@ _mesa_PopAttrib(void)
   ctx->DriverFlags.NewClipPlaneEnable |
   ctx->DriverFlags.NewDepth |
   ctx->DriverFlags.NewDepthClamp |
+  ctx->DriverFlags.NewDepthClampNear |
+  ctx->DriverFlags.NewDepthClampFar |
   ctx->DriverFlags.NewFramebufferSRGB |
   ctx->DriverFlags.NewLineState |
   ctx->DriverFlags.NewLogicOp |
@@ -1436,6 +1446,12 @@ _mesa_PopAttrib(void)
if (xform->DepthClamp != ctx->Transform.DepthClamp)
   _mesa_set_enable(ctx, GL_DEPTH_CLAMP,
ctx->Transform.DepthClamp);
+   if (xform->DepthClampNear != ctx->Transform.DepthClampNear)
+  _mesa_set_enable(ctx, GL_DEPTH_CLAMP_NEAR_AMD,
+   ctx->Transform.DepthClampNear);
+   if (xform->DepthClampFar != ctx->Transform.DepthClampFar)
+  _mesa_set_enable(ctx, GL_DEPTH_CLAMP_FAR_AMD,
+   ctx->Transform.DepthClampFar);
if (ctx->Extensions.ARB_clip_control)
   _mesa_ClipControl(xform->ClipOrigin, xform->ClipDepthMode);
 }
-- 
2.17.1

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


[Mesa-dev] [RFC][PATCH 0/5] mesa: Add types for AMD_depth_clamp_separate.

2018-08-01 Thread Sagar Ghuge
Add some basic types and storage for the
AMD_depth_clamp_separate extension.

Signed-off-by: Sagar Ghuge 
---
 include/GL/glcorearb.h   | 2 ++
 src/mesa/main/extensions_table.h | 1 +
 src/mesa/main/mtypes.h   | 9 +
 3 files changed, 12 insertions(+)

diff --git a/include/GL/glcorearb.h b/include/GL/glcorearb.h
index a78bbb6e18..d73ca5a8df 100644
--- a/include/GL/glcorearb.h
+++ b/include/GL/glcorearb.h
@@ -1558,6 +1558,8 @@ typedef int64_t GLint64;
 #define GL_MAX_FRAGMENT_INPUT_COMPONENTS  0x9125
 #define GL_CONTEXT_PROFILE_MASK   0x9126
 #define GL_DEPTH_CLAMP0x864F
+#define GL_DEPTH_CLAMP_NEAR_AMD   0x901E
+#define GL_DEPTH_CLAMP_FAR_AMD0x901F
 #define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION 0x8E4C
 #define GL_FIRST_VERTEX_CONVENTION0x8E4D
 #define GL_LAST_VERTEX_CONVENTION 0x8E4E
diff --git a/src/mesa/main/extensions_table.h b/src/mesa/main/extensions_table.h
index 3f01896cae..8dc668e087 100644
--- a/src/mesa/main/extensions_table.h
+++ b/src/mesa/main/extensions_table.h
@@ -9,6 +9,7 @@
 EXT(3DFX_texture_compression_FXT1   , TDFX_texture_compression_FXT1
  , GLL, GLC,  x ,  x , 1999)
 
 EXT(AMD_conservative_depth  , ARB_conservative_depth   
  , GLL, GLC,  x ,  x , 2009)
+EXT(AMD_depth_clamp_separate, AMD_depth_clamp_separate 
  ,  x , GLC,  x ,  x , 2009)
 EXT(AMD_draw_buffers_blend  , ARB_draw_buffers_blend   
  , GLL, GLC,  x ,  x , 2009)
 EXT(AMD_performance_monitor , AMD_performance_monitor  
  , GLL, GLC,  x , ES2, 2007)
 EXT(AMD_pinned_memory   , AMD_pinned_memory
  , GLL, GLC,  x ,  x , 2013)
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index d71872835d..406746a84c 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -1280,6 +1280,8 @@ struct gl_transform_attrib
GLboolean RescaleNormals;   /**< GL_EXT_rescale_normal */
GLboolean RasterPositionUnclipped;   /**< GL_IBM_rasterpos_clip */
GLboolean DepthClamp;   /**< GL_ARB_depth_clamp */
+   GLboolean DepthClampNear;   /**< 
GL_AMD_depth_clamp_separate */
+   GLboolean DepthClampFar;/**< 
GL_AMD_depth_clamp_separate */
/** GL_ARB_clip_control */
GLenum16 ClipOrigin;   /**< GL_LOWER_LEFT or GL_UPPER_LEFT */
GLenum16 ClipDepthMode;/**< GL_NEGATIVE_ONE_TO_ONE or GL_ZERO_TO_ONE */
@@ -4235,6 +4237,7 @@ struct gl_extensions
GLboolean OES_texture_view;
GLboolean OES_viewport_array;
/* vendor extensions */
+   GLboolean AMD_depth_clamp_separate;
GLboolean AMD_performance_monitor;
GLboolean AMD_pinned_memory;
GLboolean AMD_seamless_cubemap_per_texture;
@@ -4577,6 +4580,12 @@ struct gl_driver_flags
/** gl_context::Transform::DepthClamp */
uint64_t NewDepthClamp;
 
+   /** gl_context::Transform::DepthClampNear */
+   uint64_t NewDepthClampNear;
+
+   /** gl_context::Transform::DepthClampFar */
+   uint64_t NewDepthClampFar;
+
/** gl_context::Line */
uint64_t NewLineState;
 
-- 
2.17.1

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


[Mesa-dev] [RFC][PATCH 4/5] mesa: implement glGet for AMD_depth_clamp_separate

2018-08-01 Thread Sagar Ghuge
Signed-off-by: Sagar Ghuge 
---
 src/mesa/main/get.c  | 1 +
 src/mesa/main/get_hash_params.py | 5 +
 2 files changed, 6 insertions(+)

diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index db0079beb5..b310f014b7 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -468,6 +468,7 @@ EXTRA_EXT(NV_texture_rectangle);
 EXTRA_EXT(EXT_stencil_two_side);
 EXTRA_EXT(EXT_depth_bounds_test);
 EXTRA_EXT(ARB_depth_clamp);
+EXTRA_EXT(AMD_depth_clamp_separate);
 EXTRA_EXT(ATI_fragment_shader);
 EXTRA_EXT(EXT_provoking_vertex);
 EXTRA_EXT(ARB_fragment_shader);
diff --git a/src/mesa/main/get_hash_params.py b/src/mesa/main/get_hash_params.py
index 618e306e50..edf3c982d0 100644
--- a/src/mesa/main/get_hash_params.py
+++ b/src/mesa/main/get_hash_params.py
@@ -982,6 +982,11 @@ descriptor=[
 
 # GL_ARB_indirect_parameters
   [ "PARAMETER_BUFFER_BINDING_ARB", "LOC_CUSTOM, TYPE_INT, 0, 
extra_ARB_indirect_parameters" ],
+
+# GL 4.1
+# GL_AMD_depth_clamp_separate
+  [ "DEPTH_CLAMP_NEAR_AMD", "CONTEXT_BOOL(Transform.DepthClampNear), 
extra_AMD_depth_clamp_separate" ],
+  [ "DEPTH_CLAMP_FAR_AMD", "CONTEXT_BOOL(Transform.DepthClampFar), 
extra_AMD_depth_clamp_separate" ],
 ]},
 
 ]
-- 
2.17.1

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


[Mesa-dev] [RFC][PATCH 2/5] glapi: define AMD_depth_clamp_separate

2018-08-01 Thread Sagar Ghuge
Signed-off-by: Sagar Ghuge 
---
 src/mapi/glapi/gen/AMD_depth_clamp_separate.xml | 15 +++
 src/mapi/glapi/gen/Makefile.am  |  1 +
 src/mapi/glapi/gen/gl_API.xml   |  3 +++
 src/mapi/glapi/gen/meson.build  |  1 +
 4 files changed, 20 insertions(+)
 create mode 100644 src/mapi/glapi/gen/AMD_depth_clamp_separate.xml

diff --git a/src/mapi/glapi/gen/AMD_depth_clamp_separate.xml 
b/src/mapi/glapi/gen/AMD_depth_clamp_separate.xml
new file mode 100644
index 00..b7142f1b7b
--- /dev/null
+++ b/src/mapi/glapi/gen/AMD_depth_clamp_separate.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/mapi/glapi/gen/Makefile.am b/src/mapi/glapi/gen/Makefile.am
index 93acabd968..ab369a0d33 100644
--- a/src/mapi/glapi/gen/Makefile.am
+++ b/src/mapi/glapi/gen/Makefile.am
@@ -188,6 +188,7 @@ API_XML = \
ARB_vertex_attrib_64bit.xml \
ARB_vertex_attrib_binding.xml \
ARB_viewport_array.xml \
+   AMD_depth_clamp_separate.xml \
AMD_draw_buffers_blend.xml \
AMD_performance_monitor.xml \
ARB_vertex_type_2_10_10_10_rev.xml \
diff --git a/src/mapi/glapi/gen/gl_API.xml b/src/mapi/glapi/gen/gl_API.xml
index 49807e1ea5..b85cae2eb4 100644
--- a/src/mapi/glapi/gen/gl_API.xml
+++ b/src/mapi/glapi/gen/gl_API.xml
@@ -12939,6 +12939,9 @@
 http://www.w3.org/2001/XInclude"/>
 
+http://www.w3.org/2001/XInclude"/>
+
 
 
 
diff --git a/src/mapi/glapi/gen/meson.build b/src/mapi/glapi/gen/meson.build
index a6a93cc83b..9c3f243aa9 100644
--- a/src/mapi/glapi/gen/meson.build
+++ b/src/mapi/glapi/gen/meson.build
@@ -95,6 +95,7 @@ api_xml_files = files(
   'ARB_vertex_attrib_64bit.xml',
   'ARB_vertex_attrib_binding.xml',
   'ARB_viewport_array.xml',
+  'AMD_depth_clamp_separate.xml',
   'AMD_draw_buffers_blend.xml',
   'AMD_performance_monitor.xml',
   'ARB_vertex_type_2_10_10_10_rev.xml',
-- 
2.17.1

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


[Mesa-dev] [RFC][PATCH 1/5] mesa: add support for GL_AMD_depth_clamp_separate tokens

2018-08-01 Thread Sagar Ghuge
_mesa_set_enable() and _mesa_IsEnabled() extended
to accept new two tokens GL_DEPTH_CLAMP_NEAR_AMD and
GL_DEPTH_CLAMP_FAR_AMD.

Signed-off-by: Sagar Ghuge 
---
 src/mesa/main/enable.c | 44 +-
 1 file changed, 43 insertions(+), 1 deletion(-)

diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c
index d1b2f3a962..54729743ab 100644
--- a/src/mesa/main/enable.c
+++ b/src/mesa/main/enable.c
@@ -1013,6 +1013,32 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, 
GLboolean state)
_NEW_TRANSFORM);
  ctx->NewDriverState |= ctx->DriverFlags.NewDepthClamp;
  ctx->Transform.DepthClamp = state;
+ ctx->Transform.DepthClampNear = state;
+ ctx->Transform.DepthClampFar = state;
+ break;
+
+  case GL_DEPTH_CLAMP_NEAR_AMD:
+ if (!_mesa_is_desktop_gl(ctx))
+goto invalid_enum_error;
+ CHECK_EXTENSION(AMD_depth_clamp_separate, cap);
+ if (ctx->Transform.DepthClampNear == state)
+return;
+ FLUSH_VERTICES(ctx, ctx->DriverFlags.NewDepthClampNear ? 0 :
+   _NEW_TRANSFORM);
+ ctx->NewDriverState |= ctx->DriverFlags.NewDepthClampNear;
+ ctx->Transform.DepthClampNear = state;
+ break;
+
+  case GL_DEPTH_CLAMP_FAR_AMD:
+ if (!_mesa_is_desktop_gl(ctx))
+goto invalid_enum_error;
+ CHECK_EXTENSION(AMD_depth_clamp_separate, cap);
+ if (ctx->Transform.DepthClampFar == state)
+return;
+ FLUSH_VERTICES(ctx, ctx->DriverFlags.NewDepthClampFar ? 0 :
+   _NEW_TRANSFORM);
+ ctx->NewDriverState |= ctx->DriverFlags.NewDepthClampFar;
+ ctx->Transform.DepthClampFar = state;
  break;
 
   case GL_FRAGMENT_SHADER_ATI:
@@ -1684,7 +1710,23 @@ _mesa_IsEnabled( GLenum cap )
  if (!_mesa_is_desktop_gl(ctx))
 goto invalid_enum_error;
  CHECK_EXTENSION(ARB_depth_clamp);
- return ctx->Transform.DepthClamp;
+ return (ctx->Transform.DepthClamp ||
+ctx->Transform.DepthClampNear ||
+ctx->Transform.DepthClampFar);
+
+  /* GL_AMD_depth_clamp_separate */
+  case GL_DEPTH_CLAMP_NEAR_AMD:
+ if (!_mesa_is_desktop_gl(ctx))
+goto invalid_enum_error;
+ CHECK_EXTENSION(AMD_depth_clamp_separate);
+ return ctx->Transform.DepthClampNear;
+
+  /* GL_AMD_depth_clamp_separate */
+  case GL_DEPTH_CLAMP_FAR_AMD:
+ if (!_mesa_is_desktop_gl(ctx))
+goto invalid_enum_error;
+ CHECK_EXTENSION(AMD_depth_clamp_separate);
+ return ctx->Transform.DepthClampFar;
 
   case GL_FRAGMENT_SHADER_ATI:
  if (ctx->API != API_OPENGL_COMPAT)
-- 
2.17.1

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


Re: [Mesa-dev] [PATCH v3 1/8] nir: evaluate if condition uses inside the if branches

2018-08-01 Thread Marek Olšák
On Wed, Aug 1, 2018 at 5:02 PM, Dieter Nützel  wrote:
> Am 01.08.2018 19:53, schrieb Marek Olšák:
>>
>> On Wed, Aug 1, 2018 at 12:02 PM, Dieter Nützel 
>> wrote:
>>>
>>> Am 01.08.2018 17:53, schrieb Marek Olšák:


 On Wed, Aug 1, 2018 at 2:39 AM, Dieter Nützel 
 wrote:
>
>
> Am 01.08.2018 05:56, schrieb Timothy Arceri:
>>
>>
>>
>> On 01/08/18 13:09, Dieter Nützel wrote:
>>>
>>>
>>>
>>> Am 31.07.2018 13:34, schrieb Timothy Arceri:



 On 31/07/18 13:50, Dieter Nützel wrote:
>
>
>
> Am 30.07.2018 05:24, schrieb Dieter Nützel:
>>
>>
>>
>> For the series
>>
>> Tested-by: Dieter Nützel 
>>
>> with glmark2, glxgears, UH, UV, Blender 2.79 and FreeCAD 0.17
>>
>> on RX 580.
>>
>> With UH I saw some small light blue triangles spreading around.
>> Have to bisect which patch set was the culprit. (If I have some
>> time.)
>> Tried your's above
>> configure-bump-libdrm-for-AMDGPU-to-2.4.92.mbox (Samuel)
>> ASTC-texture-compression-for-all-Gallium-drivers.mbox (Marek)
>>
>> Dieter
>
>
>
>
> It has something to do with tessellation.
> If I disable it (F3) all small light blue triangles are _gone_.




 Are you able to bisect?
>>>
>>>
>>>
>>>
>>> In short, it has _nothing_ to do with _this_ series.
>>> Tested on e6ff5ac446.
>>> So my tb stands.
>>>
>>> After some sleep (Nothern Germany is _very_ hot and _dry_ this year)
>>> I'll
>>> do my very best... ;-)
>>
>>
>>
>>
>> hehe. Yes I've experienced a "heat wave" in Northern Europe before,
>> but some of us have very different definitions of _very_ hot and _dry_
>> :P
>
>
>
>
> With tonight's shower we had only _4_ (really 3, first day was 10
> minutes
> with only some drops)
> days with rain since last week of April!!!
> Our fields and forests need badly water.
> We never had such dry spring/early summer/summer for ages.
>
> So back to work.
>
> /opt/mesa> git bisect bad
> 86b52d42368ac496fe24bc6674e754c323381635 is the first bad commit
> commit 86b52d42368ac496fe24bc6674e754c323381635
> Author: Marek Olšák 
> Date:   Fri Jul 13 00:23:36 2018 -0400
>
> radeonsi: reduce LDS stalls by 40% for tessellation
>
> 40% is the decrease in the LGKM counter (which includes SMEM too)
> for the GFX9 LSHS stage.
>
> This will make the LDS size slightly larger, but I wasn't able to
> increase
> the patch stride without corruption, so I'm increasing the vertex
> stride.
>
> :04 04 8d457bbd593fe44ca0c7080820f3428f64d5ba19
> 56feae85455f50d6e5ab7a0285db7319d0601afe M src
>
> Reverting it (on top of master + _this_ series) makes all smooth and
> dandy, again - at least on RX580.
>
> Going to bed.



 Can you provide more info? Is it only happening with NIR?
>>>
>>>
>>>
>>> Yes, only if I set R600_DEBUG sisched,nir (I'm running sisched all the
>>> time).
>>> Do you need more info?
>>
>>
>> It could be a bug in sisched.
>
>
> It seems to be NOT the case.
> R600_DEBUG=nir show the corruption. - But much slower...;-)
> You can see it 'best' in scene 4 (cannon) and 1.
>
> git revert 86b52d4236
> fix it (for NIR with and without sisched)

What's the LLVM version?

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


[Mesa-dev] [Bug 77449] Tracker bug for all bugs related to Steam titles

2018-08-01 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=77449
Bug 77449 depends on bug 103907, which changed state.

Bug 103907 Summary: [gfx9/Vega] Arma 3 crashes on 17.3.0-rc5 but works on master
https://bugs.freedesktop.org/show_bug.cgi?id=103907

   What|Removed |Added

 Status|NEEDINFO|RESOLVED
 Resolution|--- |FIXED

-- 
You are receiving this mail because:
You are the assignee for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH v2] glsl: make a copy of array indices that are used to deref a function out param

2018-08-01 Thread Ian Romanick
On 07/20/2018 10:22 PM, Timothy Arceri wrote:
> V2: make use of visit_tree()
> 
> Fixes new piglit test:
> tests/spec/glsl-1.20/execution/qualifiers/vs-out-conversion-int-to-float-vec4-index.shader_test

Should this get tagged for stable?

> ---
>  src/compiler/glsl/ast_function.cpp | 54 ++
>  1 file changed, 54 insertions(+)
> 
> diff --git a/src/compiler/glsl/ast_function.cpp 
> b/src/compiler/glsl/ast_function.cpp
> index 127aa1f91c4..b0edcc0c5de 100644
> --- a/src/compiler/glsl/ast_function.cpp
> +++ b/src/compiler/glsl/ast_function.cpp
> @@ -348,6 +348,49 @@ verify_parameter_modes(_mesa_glsl_parse_state *state,
> return true;
>  }
>  
> +struct copy_index_deref_data {
> +   void *mem_ctx;
> +   exec_list *before_instructions;
> +};
> +
> +static void
> +copy_index_derefs_to_temps(ir_instruction *ir, void *data)
> +{
> +   struct copy_index_deref_data *d = (struct copy_index_deref_data *)data;
> +
> +   if (ir->ir_type == ir_type_dereference_array) {
> +  ir_dereference_array *a = (ir_dereference_array *) ir;
> +  ir = a->array->as_dereference();
> +
> +  ir_rvalue *idx = a->array_index;
> +  if (idx->as_dereference_variable()) {
> + ir_variable *var = idx->variable_referenced();
> +
> + /* If the index is read only it cannot change so there is no need
> +  * to copy it.
> +  */
> + if (var->data.read_only || var->data.memory_read_only)
> +return;
> +
> + ir_variable *tmp = new(d->mem_ctx) ir_variable(idx->type, "idx_tmp",
> + ir_var_temporary);

Indentation doesn't line up here.

With that fixed,

Reviewed-by: Ian Romanick 

> + d->before_instructions->push_tail(tmp);
> +
> + ir_dereference_variable *const deref_tmp_1 =
> +new(d->mem_ctx) ir_dereference_variable(tmp);
> + ir_assignment *const assignment =
> +new(d->mem_ctx) ir_assignment(deref_tmp_1,
> +  idx->clone(d->mem_ctx, NULL));
> + d->before_instructions->push_tail(assignment);
> +
> + /* Replace the array index with a dereference of the new temporary 
> */
> + ir_dereference_variable *const deref_tmp_2 =
> +new(d->mem_ctx) ir_dereference_variable(tmp);
> + a->array_index = deref_tmp_2;
> +  }
> +   }
> +}
> +
>  static void
>  fix_parameter(void *mem_ctx, ir_rvalue *actual, const glsl_type *formal_type,
>exec_list *before_instructions, exec_list *after_instructions,
> @@ -362,6 +405,17 @@ fix_parameter(void *mem_ctx, ir_rvalue *actual, const 
> glsl_type *formal_type,
> && (expr == NULL || expr->operation != ir_binop_vector_extract))
>return;
>  
> +   /* An array index could also be an out variable so we need to make a copy
> +* of them before the function is called.
> +*/
> +   if (!actual->as_dereference_variable()) {
> +  struct copy_index_deref_data data;
> +  data.mem_ctx = mem_ctx;
> +  data.before_instructions = before_instructions;
> +
> +  visit_tree(actual, copy_index_derefs_to_temps, );
> +   }
> +
> /* To convert an out parameter, we need to create a temporary variable to
>  * hold the value before conversion, and then perform the conversion after
>  * the function call returns.
> 

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


Re: [Mesa-dev] [PATCH v2 3/4] intel/nir: Split IO arrays into elements

2018-08-01 Thread Kenneth Graunke
On Tuesday, July 31, 2018 8:55:05 PM PDT Jason Ekstrand wrote:
> On Tue, Jul 31, 2018 at 3:00 PM Jason Ekstrand  wrote:
> 
> > On July 31, 2018 14:54:54 Kenneth Graunke  wrote:
> >
> > > On Tuesday, July 31, 2018 12:22:02 PM PDT Jason Ekstrand wrote:
> > >> The NIR nir_lower_io_arrays_to_elements pass attempts to split I/O
> > >> variables which are arrays or matrices into a sequence of separate
> > >> variables.  This can help link-time optimization by allowing us to
> > >> remove varyings at a more granular level.
> > >>
> > >> Shader-db results on Kaby Lake:
> > >>
> > >> total instructions in shared programs: 15177645 -> 15168494 (-0.06%)
> > >> instructions in affected programs: 79857 -> 70706 (-11.46%)
> > >> helped: 392
> > >> HURT: 0
> > >> ---
> > >> src/intel/compiler/brw_nir.c | 4 
> > >> 1 file changed, 4 insertions(+)
> > >>
> > >> diff --git a/src/intel/compiler/brw_nir.c b/src/intel/compiler/brw_nir.c
> > >> index 17ccfa48af6..29ad68fdb2a 100644
> > >> --- a/src/intel/compiler/brw_nir.c
> > >> +++ b/src/intel/compiler/brw_nir.c
> > >> @@ -709,6 +709,10 @@ void
> > >> brw_nir_link_shaders(const struct brw_compiler *compiler,
> > >>  nir_shader **producer, nir_shader **consumer)
> > >> {
> > >> +   nir_lower_io_arrays_to_elements(*producer, *consumer);
> > >> +   nir_validate_shader(*producer);
> > >> +   nir_validate_shader(*consumer);
> > >> +
> > >> NIR_PASS_V(*producer, nir_remove_dead_variables, nir_var_shader_out);
> > >> NIR_PASS_V(*consumer, nir_remove_dead_variables, nir_var_shader_in);
> > >
> > > This actually passes the test suite?  That's strange.  When I was
> > > playing with this earlier, it was demoting gl_ClipDistance[1] from
> > > a float[1] compact array to a single float variable...but leaving it
> > > marked compact.  var->data.compact = true makes no sense for non-arrays.
> > >
> > > I think our clip/cull distance handling assumes that it's an array,
> > > though.  So...not sure whether the pass should unset compact, or skip
> > > over compact arrays...
> >
> > Yes, it passes just fine. I'm not sure exactly how it interacts with clip
> > distance lowering though.
> >
> 
> Back at my computer finally.  I did a bit of digging and the
> lower_io_arrays_to_elements pass ignores everything that isn't
> VARYING_SLOT_VARX.  Clip distances are ignored since they're
> VARYING_SLOT_CLIP_DIST0/1.  Hope that clears it up. :-)
> 
> --Jason

Huh.  Not sure what I was seeing then.  Probably other local breakage.

Sounds like everything should work, then.

Series is:
Reviewed-by: Kenneth Graunke 


signature.asc
Description: This is a digitally signed message part.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] vulkan.radv build trouble w/ AOSP

2018-08-01 Thread John Stultz
Just as a heads up, with mesa3d master (plus my other build fixups I
just sent out), I'm seeing a new build failure when building under
AOSP/master:

external/mesa3d/src/amd/vulkan/Android.mk: error: vulkan.radv
(SHARED_LIBRARIES android-arm64) missing libLLVM (SHARED_LIBRARIES
android-arm64)
You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if
this is intentional, but that may defer real problems until later in
the build.
external/mesa3d/src/amd/vulkan/Android.mk: error: vulkan.radv
(SHARED_LIBRARIES android-arm) missing libLLVM (SHARED_LIBRARIES
android-arm)
You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if
this is intentional, but that may defer real problems until later in
the build.
build/make/core/main.mk:842: error: exiting from previous errors.
22:56:25 ckati failed with: exit status 1

This seems to be coming from the $(call mesa-build-with-llvm) line here:
https://github.com/mesa3d/mesa/blob/master/src/amd/vulkan/Android.mk#L144

(as commenting that out avoids the issue)

This gets pulled in as AOSP will check library dependencies for all
SHARED_LIBRARIES, so that's why the vulkan.radv trips this while other
"mesa-build-with-llvm" callers don't (they are built as
STATIC_LIBRARIES).

Last time we had this issue, it was with the libpciaccess library,
which we solved it by dropping it.

In this case I'm not sure what the best solution might be.

* We could set it as a static library instead?

* Alternatively, it seems we might be able to use the libLLVM_android
library instead of libLLVM here:
  https://github.com/mesa3d/mesa/blob/master/Android.mk#L107

Other ideas/suggestions?

thanks
-john
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] nir: add fall through comment to nir_gather_info

2018-08-01 Thread Jason Ekstrand
rb

On Wed, Aug 1, 2018 at 5:05 PM Timothy Arceri  wrote:

> This stops Coverity reporting a defect and helps make the code less
> error-prone.
>
> Cc: Neil Roberts 
> ---
>  src/compiler/nir/nir_gather_info.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/src/compiler/nir/nir_gather_info.c
> b/src/compiler/nir/nir_gather_info.c
> index d0b656ea741..4a030cb6256 100644
> --- a/src/compiler/nir/nir_gather_info.c
> +++ b/src/compiler/nir/nir_gather_info.c
> @@ -288,6 +288,7 @@ gather_intrinsic_info(nir_intrinsic_instr *instr,
> nir_shader *shader,
> case nir_intrinsic_end_primitive_with_counter:
>assert(shader->info.stage == MESA_SHADER_GEOMETRY);
>shader->info.gs.uses_end_primitive = 1;
> +  /* fall through */
>
> case nir_intrinsic_emit_vertex:
>if (nir_intrinsic_stream_id(instr) > 0)
> --
> 2.17.1
>
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] nir: add fall through comment to nir_gather_info

2018-08-01 Thread Timothy Arceri
This stops Coverity reporting a defect and helps make the code less
error-prone.

Cc: Neil Roberts 
---
 src/compiler/nir/nir_gather_info.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/compiler/nir/nir_gather_info.c 
b/src/compiler/nir/nir_gather_info.c
index d0b656ea741..4a030cb6256 100644
--- a/src/compiler/nir/nir_gather_info.c
+++ b/src/compiler/nir/nir_gather_info.c
@@ -288,6 +288,7 @@ gather_intrinsic_info(nir_intrinsic_instr *instr, 
nir_shader *shader,
case nir_intrinsic_end_primitive_with_counter:
   assert(shader->info.stage == MESA_SHADER_GEOMETRY);
   shader->info.gs.uses_end_primitive = 1;
+  /* fall through */
 
case nir_intrinsic_emit_vertex:
   if (nir_intrinsic_stream_id(instr) > 0)
-- 
2.17.1

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


Re: [Mesa-dev] [PATCH v2 6/6] mesa: replace binary constants with hexadecimal constants

2018-08-01 Thread Marek Olšák
For patches 5 & 6:

Reviewed-by: Marek Olšák 

I can't see patches 3 & 4 on the list.

Marek

On Wed, Aug 1, 2018 at 6:02 PM, Andres Gomez  wrote:
> The binary constant notation "0b" is a GCC extension. Instead, we use
> hexadecimal notation to fix the MSVC 2013 build:
>
> Compiling src\mesa\main\texcompress_astc.cpp ...
> texcompress_astc.cpp
> src\mesa\main\texcompress_astc.cpp(111) : error C2059: syntax error : 'bad 
> suffix on number'
>
> ...
>
> src\mesa\main\texcompress_astc.cpp(1007) : fatal error C1003: error count 
> exceeds 100; stopping compilation
> scons: *** [build\windows-x86-debug\mesa\main\texcompress_astc.obj] Error 2
> scons: building terminated because of errors.
>
> v2: Fix wrong conversion (Ilia).
>
> Fixes: 38ab39f6501 ("mesa: add ASTC 2D LDR decoder")
> Cc: Marek Olšák 
> Cc: Brian Paul 
> Cc: Roland Scheidegger 
> Cc: Mike Lothian 
> Cc: Gert Wollny 
> Cc: Dieter Nützel 
> Cc: Ilia Mirkin 
> Signed-off-by: Andres Gomez 
> ---
>  src/mesa/main/texcompress_astc.cpp | 116 ++---
>  1 file changed, 58 insertions(+), 58 deletions(-)
>
> diff --git a/src/mesa/main/texcompress_astc.cpp 
> b/src/mesa/main/texcompress_astc.cpp
> index 996e8ea28d6..23540c47017 100644
> --- a/src/mesa/main/texcompress_astc.cpp
> +++ b/src/mesa/main/texcompress_astc.cpp
> @@ -108,14 +108,14 @@ static void unpack_trit_block(int n, T in, uint8_t *out)
>  {
> assert(n <= 6); /* else output will overflow uint8_t */
>
> -   uint8_t T0 = (in >> (n)) & 0b1;
> -   uint8_t T1 = (in >> (n+1)) & 0b1;
> -   uint8_t T2 = (in >> (2*n+2)) & 0b1;
> -   uint8_t T3 = (in >> (2*n+3)) & 0b1;
> -   uint8_t T4 = (in >> (3*n+4)) & 0b1;
> -   uint8_t T5 = (in >> (4*n+5)) & 0b1;
> -   uint8_t T6 = (in >> (4*n+6)) & 0b1;
> -   uint8_t T7 = (in >> (5*n+7)) & 0b1;
> +   uint8_t T0 = (in >> (n)) & 0x1;
> +   uint8_t T1 = (in >> (n+1)) & 0x1;
> +   uint8_t T2 = (in >> (2*n+2)) & 0x1;
> +   uint8_t T3 = (in >> (2*n+3)) & 0x1;
> +   uint8_t T4 = (in >> (3*n+4)) & 0x1;
> +   uint8_t T5 = (in >> (4*n+5)) & 0x1;
> +   uint8_t T6 = (in >> (4*n+6)) & 0x1;
> +   uint8_t T7 = (in >> (5*n+7)) & 0x1;
> uint8_t mmask = (1 << n) - 1;
> uint8_t m0 = (in >> (0)) & mmask;
> uint8_t m1 = (in >> (n+2)) & mmask;
> @@ -125,12 +125,12 @@ static void unpack_trit_block(int n, T in, uint8_t *out)
>
> uint8_t C;
> uint8_t t4, t3, t2, t1, t0;
> -   if (CAT_BITS_3(T4, T3, T2) == 0b111) {
> +   if (CAT_BITS_3(T4, T3, T2) == 0x7) {
>C = CAT_BITS_5(T7, T6, T5, T1, T0);
>t4 = t3 = 2;
> } else {
>C = CAT_BITS_5(T4, T3, T2, T1, T0);
> -  if (CAT_BITS_2(T6, T5) == 0b11) {
> +  if (CAT_BITS_2(T6, T5) == 0x3) {
>   t4 = 2;
>   t3 = T7;
>} else {
> @@ -139,21 +139,21 @@ static void unpack_trit_block(int n, T in, uint8_t *out)
>}
> }
>
> -   if ((C & 0b11) == 0b11) {
> +   if ((C & 0x3) == 0x3) {
>t2 = 2;
> -  t1 = (C >> 4) & 0b1;
> -  uint8_t C3 = (C >> 3) & 0b1;
> -  uint8_t C2 = (C >> 2) & 0b1;
> +  t1 = (C >> 4) & 0x1;
> +  uint8_t C3 = (C >> 3) & 0x1;
> +  uint8_t C2 = (C >> 2) & 0x1;
>t0 = (C3 << 1) | (C2 & ~C3);
> -   } else if (((C >> 2) & 0b11) == 0b11) {
> +   } else if (((C >> 2) & 0x3) == 0x3) {
>t2 = 2;
>t1 = 2;
> -  t0 = C & 0b11;
> +  t0 = C & 0x3;
> } else {
> -  t2 = (C >> 4) & 0b1;
> -  t1 = (C >> 2) & 0b11;
> -  uint8_t C1 = (C >> 1) & 0b1;
> -  uint8_t C0 = (C >> 0) & 0b1;
> +  t2 = (C >> 4) & 0x1;
> +  t1 = (C >> 2) & 0x3;
> +  uint8_t C1 = (C >> 1) & 0x1;
> +  uint8_t C0 = (C >> 0) & 0x1;
>t0 = (C1 << 1) | (C0 & ~C1);
> }
>
> @@ -171,13 +171,13 @@ static void unpack_quint_block(int n, uint32_t in, 
> uint8_t *out)
>  {
> assert(n <= 5); /* else output will overflow uint8_t */
>
> -   uint8_t Q0 = (in >> (n)) & 0b1;
> -   uint8_t Q1 = (in >> (n+1)) & 0b1;
> -   uint8_t Q2 = (in >> (n+2)) & 0b1;
> -   uint8_t Q3 = (in >> (2*n+3)) & 0b1;
> -   uint8_t Q4 = (in >> (2*n+4)) & 0b1;
> -   uint8_t Q5 = (in >> (3*n+5)) & 0b1;
> -   uint8_t Q6 = (in >> (3*n+6)) & 0b1;
> +   uint8_t Q0 = (in >> (n)) & 0x1;
> +   uint8_t Q1 = (in >> (n+1)) & 0x1;
> +   uint8_t Q2 = (in >> (n+2)) & 0x1;
> +   uint8_t Q3 = (in >> (2*n+3)) & 0x1;
> +   uint8_t Q4 = (in >> (2*n+4)) & 0x1;
> +   uint8_t Q5 = (in >> (3*n+5)) & 0x1;
> +   uint8_t Q6 = (in >> (3*n+6)) & 0x1;
> uint8_t mmask = (1 << n) - 1;
> uint8_t m0 = (in >> (0)) & mmask;
> uint8_t m1 = (in >> (n+3)) & mmask;
> @@ -185,24 +185,24 @@ static void unpack_quint_block(int n, uint32_t in, 
> uint8_t *out)
>
> uint8_t C;
> uint8_t q2, q1, q0;
> -   if (CAT_BITS_4(Q6, Q5, Q2, Q1) == 0b0011) {
> +   if (CAT_BITS_4(Q6, Q5, Q2, Q1) == 0x3) {
>q2 = CAT_BITS_3(Q0, Q4 & ~Q0, Q3 & ~Q0);
>q1 = 4;
>q0 = 4;
> } else {
> -  if (CAT_BITS_2(Q2, Q1) == 0b11) {
> +  if (CAT_BITS_2(Q2, Q1) == 0x3) {
>   q2 = 4;
> - C = CAT_BITS_5(Q4, Q3, 0b1 

[Mesa-dev] [PATCH 7/8] st/mesa: add renderbuffer support for AMD_framebuffer_multisample_advanced

2018-08-01 Thread Marek Olšák
From: Marek Olšák 

---
 src/mesa/state_tracker/st_cb_fbo.c | 61 ++
 1 file changed, 53 insertions(+), 8 deletions(-)

diff --git a/src/mesa/state_tracker/st_cb_fbo.c 
b/src/mesa/state_tracker/st_cb_fbo.c
index 811451656ca..0e535257cb4 100644
--- a/src/mesa/state_tracker/st_cb_fbo.c
+++ b/src/mesa/state_tracker/st_cb_fbo.c
@@ -152,36 +152,80 @@ st_renderbuffer_alloc_storage(struct gl_context * ctx,
 *   different sample counts for multisampled rendering, the actual
 *   number of samples allocated for the renderbuffer image is
 *   implementation dependent.  However, the resulting value for
 *   RENDERBUFFER_SAMPLES is guaranteed to be greater than or equal
 *   to  and no more than the next larger sample count supported
 *   by the implementation.
 *
 * Find the supported number of samples >= rb->NumSamples
 */
if (rb->NumSamples > 0) {
-  unsigned start, i;
+  unsigned start, start_storage;
 
   if (ctx->Const.MaxSamples > 1 &&  rb->NumSamples == 1) {
  /* don't try num_samples = 1 with drivers that support real msaa */
  start = 2;
+ start_storage = 2;
   } else {
  start = rb->NumSamples;
+ start_storage = rb->NumStorageSamples;
   }
 
-  for (i = start; i <= ctx->Const.MaxSamples; i++) {
- format = st_choose_renderbuffer_format(st, internalFormat, i, i);
-
- if (format != PIPE_FORMAT_NONE) {
-rb->NumSamples = i;
-rb->NumStorageSamples = i;
-break;
+  if (ctx->Extensions.AMD_framebuffer_multisample_advanced) {
+ if (rb->_BaseFormat == GL_DEPTH_COMPONENT ||
+ rb->_BaseFormat == GL_DEPTH_STENCIL ||
+ rb->_BaseFormat == GL_STENCIL_INDEX) {
+/* Find a supported depth-stencil format. */
+for (unsigned samples = start;
+ samples <= ctx->Const.MaxDepthStencilFramebufferSamples;
+ samples++) {
+   format = st_choose_renderbuffer_format(st, internalFormat,
+  samples, samples);
+
+   if (format != PIPE_FORMAT_NONE) {
+  rb->NumSamples = samples;
+  rb->NumStorageSamples = samples;
+  break;
+   }
+}
+ } else {
+/* Find a supported color format, samples >= storage_samples. */
+for (unsigned storage_samples = start_storage;
+ storage_samples <= 
ctx->Const.MaxColorFramebufferStorageSamples;
+ storage_samples++) {
+   for (unsigned samples = MAX2(start, storage_samples);
+samples <= ctx->Const.MaxColorFramebufferSamples;
+samples++) {
+  format = st_choose_renderbuffer_format(st, internalFormat,
+ samples,
+ storage_samples);
+
+  if (format != PIPE_FORMAT_NONE) {
+ rb->NumSamples = samples;
+ rb->NumStorageSamples = storage_samples;
+ goto found;
+  }
+   }
+}
+found:;
+ }
+  } else {
+ for (unsigned samples = start; samples <= ctx->Const.MaxSamples;
+  samples++) {
+format = st_choose_renderbuffer_format(st, internalFormat,
+   samples, samples);
+
+if (format != PIPE_FORMAT_NONE) {
+   rb->NumSamples = samples;
+   rb->NumStorageSamples = samples;
+   break;
+}
  }
   }
} else {
   format = st_choose_renderbuffer_format(st, internalFormat, 0, 0);
}
 
/* Not setting gl_renderbuffer::Format here will cause
 * FRAMEBUFFER_UNSUPPORTED and ValidateFramebuffer will not be called.
 */
if (format == PIPE_FORMAT_NONE) {
@@ -460,20 +504,21 @@ st_update_renderbuffer_surface(struct st_context *st,
   else
  last_layer = MIN2(first_layer + tex->NumLayers - 1, last_layer);
}
 
struct pipe_surface **psurf =
   enable_srgb ? >surface_srgb : >surface_linear;
struct pipe_surface *surf = *psurf;
 
if (!surf ||
surf->texture->nr_samples != strb->Base.NumSamples ||
+   surf->texture->nr_storage_samples != strb->Base.NumStorageSamples ||
surf->format != format ||
surf->texture != resource ||
surf->width != rtt_width ||
surf->height != rtt_height ||
surf->u.tex.level != level ||
surf->u.tex.first_layer != first_layer ||
surf->u.tex.last_layer != last_layer) {
   /* create a new pipe_surface */
   struct pipe_surface surf_tmpl;
   memset(_tmpl, 0, sizeof(surf_tmpl));
-- 
2.17.1

___
mesa-dev mailing list

[Mesa-dev] [PATCH 2/8] glapi: define AMD_framebuffer_multisample_advanced and add its functions

2018-08-01 Thread Marek Olšák
From: Marek Olšák 

---
 src/mapi/glapi/gen/gl_API.xml | 27 +++
 src/mesa/main/fbobject.c  | 22 ++
 src/mesa/main/fbobject.h  | 10 ++
 3 files changed, 59 insertions(+)

diff --git a/src/mapi/glapi/gen/gl_API.xml b/src/mapi/glapi/gen/gl_API.xml
index 49807e1ea52..81e4ac08cce 100644
--- a/src/mapi/glapi/gen/gl_API.xml
+++ b/src/mapi/glapi/gen/gl_API.xml
@@ -13028,20 +13028,47 @@
 http://www.w3.org/2001/XInclude"/>
 
 
 
 
 
 
 
 
 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+   
+   
+   
+   
+   
+   
+
+
+
 
 
 
 
 
 
 
 
 
 
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index edafdd011aa..f63902c9dd4 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -2485,20 +2485,31 @@ void GLAPIENTRY
 _mesa_RenderbufferStorageMultisample(GLenum target, GLsizei samples,
  GLenum internalFormat,
  GLsizei width, GLsizei height)
 {
renderbuffer_storage_target(target, internalFormat, width, height,
samples, samples,
"glRenderbufferStorageMultisample");
 }
 
 
+void GLAPIENTRY
+_mesa_RenderbufferStorageMultisampleAdvancedAMD(
+  GLenum target, GLsizei samples, GLsizei storageSamples,
+  GLenum internalFormat, GLsizei width, GLsizei height)
+{
+   renderbuffer_storage_target(target, internalFormat, width, height,
+   samples, storageSamples,
+   "glRenderbufferStorageMultisampleAdvancedAMD");
+}
+
+
 /**
  * OpenGL ES version of glRenderBufferStorage.
  */
 void GLAPIENTRY
 _es_RenderbufferStorageEXT(GLenum target, GLenum internalFormat,
GLsizei width, GLsizei height)
 {
switch (internalFormat) {
case GL_RGB565:
   /* XXX this confuses GL_RENDERBUFFER_INTERNAL_FORMAT_OES */
@@ -2529,20 +2540,31 @@ void GLAPIENTRY
 _mesa_NamedRenderbufferStorageMultisample(GLuint renderbuffer, GLsizei samples,
   GLenum internalformat,
   GLsizei width, GLsizei height)
 {
renderbuffer_storage_named(renderbuffer, internalformat, width, height,
   samples, samples,
   "glNamedRenderbufferStorageMultisample");
 }
 
 
+void GLAPIENTRY
+_mesa_NamedRenderbufferStorageMultisampleAdvancedAMD(
+  GLuint renderbuffer, GLsizei samples, GLsizei storageSamples,
+  GLenum internalformat, GLsizei width, GLsizei height)
+{
+   renderbuffer_storage_named(renderbuffer, internalformat, width, height,
+  samples, storageSamples,
+  
"glNamedRenderbufferStorageMultisampleAdvancedAMD");
+}
+
+
 static void
 get_render_buffer_parameteriv(struct gl_context *ctx,
   struct gl_renderbuffer *rb, GLenum pname,
   GLint *params, const char *func)
 {
/* No need to flush here since we're just quering state which is
 * not effected by rendering.
 */
 
switch (pname) {
diff --git a/src/mesa/main/fbobject.h b/src/mesa/main/fbobject.h
index 0299781b1e5..5cd3c60297f 100644
--- a/src/mesa/main/fbobject.h
+++ b/src/mesa/main/fbobject.h
@@ -166,33 +166,43 @@ _mesa_CreateRenderbuffers(GLsizei n, GLuint 
*renderbuffers);
 
 extern void GLAPIENTRY
 _mesa_RenderbufferStorage(GLenum target, GLenum internalformat,
  GLsizei width, GLsizei height);
 
 extern void GLAPIENTRY
 _mesa_RenderbufferStorageMultisample(GLenum target, GLsizei samples,
  GLenum internalformat,
  GLsizei width, GLsizei height);
 
+extern void GLAPIENTRY
+_mesa_RenderbufferStorageMultisampleAdvancedAMD(
+  GLenum target, GLsizei samples, GLsizei storageSamples,
+  GLenum internalFormat, GLsizei width, GLsizei height);
+
 extern void GLAPIENTRY
 _es_RenderbufferStorageEXT(GLenum target, GLenum internalFormat,
   GLsizei width, GLsizei height);
 
 extern void GLAPIENTRY
 _mesa_NamedRenderbufferStorage(GLuint renderbuffer, GLenum internalformat,
GLsizei width, GLsizei height);
 
 extern void GLAPIENTRY
 _mesa_NamedRenderbufferStorageMultisample(GLuint renderbuffer, GLsizei samples,
   GLenum internalformat,
   GLsizei width, GLsizei height);
 
+extern void GLAPIENTRY
+_mesa_NamedRenderbufferStorageMultisampleAdvancedAMD(
+  GLuint renderbuffer, GLsizei samples, GLsizei storageSamples,
+  GLenum internalformat, GLsizei width, GLsizei height);
+
 extern void GLAPIENTRY
 

[Mesa-dev] [PATCH 3/8] mesa: implement glGet for AMD_framebuffer_multisample_advanced

2018-08-01 Thread Marek Olšák
From: Marek Olšák 

---
 src/mesa/main/extensions_table.h |  1 +
 src/mesa/main/get.c  |  8 
 src/mesa/main/get_hash_params.py |  7 +++
 src/mesa/main/mtypes.h   | 16 
 4 files changed, 32 insertions(+)

diff --git a/src/mesa/main/extensions_table.h b/src/mesa/main/extensions_table.h
index 3f01896cae7..bdba49d5380 100644
--- a/src/mesa/main/extensions_table.h
+++ b/src/mesa/main/extensions_table.h
@@ -3,20 +3,21 @@
 #define GLL 0
 #define GLC 0
 #define ES1 0
 #define ES2 0
 #define  x ~0
 
 EXT(3DFX_texture_compression_FXT1   , TDFX_texture_compression_FXT1
  , GLL, GLC,  x ,  x , 1999)
 
 EXT(AMD_conservative_depth  , ARB_conservative_depth   
  , GLL, GLC,  x ,  x , 2009)
 EXT(AMD_draw_buffers_blend  , ARB_draw_buffers_blend   
  , GLL, GLC,  x ,  x , 2009)
+EXT(AMD_framebuffer_multisample_advanced, 
AMD_framebuffer_multisample_advanced   , GLL, GLC,  x , ES2, 2018)
 EXT(AMD_performance_monitor , AMD_performance_monitor  
  , GLL, GLC,  x , ES2, 2007)
 EXT(AMD_pinned_memory   , AMD_pinned_memory
  , GLL, GLC,  x ,  x , 2013)
 EXT(AMD_seamless_cubemap_per_texture, AMD_seamless_cubemap_per_texture 
  , GLL, GLC,  x ,  x , 2009)
 EXT(AMD_shader_stencil_export   , ARB_shader_stencil_export
  , GLL, GLC,  x ,  x , 2009)
 EXT(AMD_shader_trinary_minmax   , dummy_true   
  , GLL, GLC,  x ,  x , 2012)
 EXT(AMD_vertex_shader_layer , AMD_vertex_shader_layer  
  , GLL, GLC,  x ,  x , 2012)
 EXT(AMD_vertex_shader_viewport_index, AMD_vertex_shader_viewport_index 
  , GLL, GLC,  x ,  x , 2012)
 
 EXT(ANDROID_extension_pack_es31a, ANDROID_extension_pack_es31a 
  ,  x ,  x ,  x ,  31, 2014)
 
diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index db0079beb51..f870b217db5 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -511,20 +511,21 @@ EXTRA_EXT(ARB_cull_distance);
 EXTRA_EXT(EXT_window_rectangles);
 EXTRA_EXT(KHR_blend_equation_advanced_coherent);
 EXTRA_EXT(OES_primitive_bounding_box);
 EXTRA_EXT(ARB_compute_variable_group_size);
 EXTRA_EXT(KHR_robustness);
 EXTRA_EXT(ARB_sparse_buffer);
 EXTRA_EXT(NV_conservative_raster);
 EXTRA_EXT(NV_conservative_raster_dilate);
 EXTRA_EXT(NV_conservative_raster_pre_snap_triangles);
 EXTRA_EXT(ARB_sample_locations);
+EXTRA_EXT(AMD_framebuffer_multisample_advanced);
 
 static const int
 extra_ARB_color_buffer_float_or_glcore[] = {
EXT(ARB_color_buffer_float),
EXTRA_API_GL_CORE,
EXTRA_END
 };
 
 static const int
 extra_NV_primitive_restart[] = {
@@ -1221,20 +1222,27 @@ find_custom_value(struct gl_context *ctx, const struct 
value_desc *d, union valu
 v->value_uint = width;
  else if (d->pname == GL_SAMPLE_LOCATION_PIXEL_GRID_HEIGHT_ARB)
 v->value_uint = height;
  else
 v->value_uint = bits;
   }
   break;
case GL_PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_ARB:
   v->value_uint = MAX_SAMPLE_LOCATION_TABLE_SIZE;
   break;
+
+   /* GL_AMD_framebuffer_multisample_advanced */
+   case GL_SUPPORTED_MULTISAMPLE_MODES_AMD:
+  v->value_int_n.n = ctx->Const.NumSupportedMultisampleModes * 3;
+  memcpy(v->value_int_n.ints, ctx->Const.SupportedMultisampleModes,
+ v->value_int_n.n * sizeof(GLint));
+  break;
}
 }
 
 /**
  * Check extra constraints on a struct value_desc descriptor
  *
  * If a struct value_desc has a non-NULL extra pointer, it means that
  * there are a number of extra constraints to check or actions to
  * perform.  The extras is just an integer array where each integer
  * encode different constraints or actions.
diff --git a/src/mesa/main/get_hash_params.py b/src/mesa/main/get_hash_params.py
index 618e306e509..5c672a33123 100644
--- a/src/mesa/main/get_hash_params.py
+++ b/src/mesa/main/get_hash_params.py
@@ -361,20 +361,27 @@ descriptor=[
   [ "SUBPIXEL_PRECISION_BIAS_Y_BITS_NV", 
"CONTEXT_UINT(SubpixelPrecisionBias[1]), extra_NV_conservative_raster" ],
   [ "MAX_SUBPIXEL_PRECISION_BIAS_BITS_NV", 
"CONTEXT_UINT(Const.MaxSubpixelPrecisionBiasBits), 
extra_NV_conservative_raster" ],
 
 # GL_NV_conservative_raster_dilate
   [ "CONSERVATIVE_RASTER_DILATE_RANGE_NV", 
"CONTEXT_FLOAT2(Const.ConservativeRasterDilateRange), 
extra_NV_conservative_raster_dilate" ],
   [ "CONSERVATIVE_RASTER_DILATE_GRANULARITY_NV", 
"CONTEXT_FLOAT(Const.ConservativeRasterDilateGranularity), 
extra_NV_conservative_raster_dilate" ],
   [ "CONSERVATIVE_RASTER_DILATE_NV", "CONTEXT_FLOAT(ConservativeRasterDilate), 
extra_NV_conservative_raster_dilate" ],
 
 # GL_NV_conservative_raster_pre_snap_triangles
   [ "CONSERVATIVE_RASTER_MODE_NV", "CONTEXT_ENUM16(ConservativeRasterMode), 
extra_NV_conservative_raster_pre_snap_triangles" ],
+
+# 

[Mesa-dev] [PATCH 6/8] st/mesa: pass storage_sample_count parameter into st_choose_format

2018-08-01 Thread Marek Olšák
From: Marek Olšák 

---
 src/mesa/state_tracker/st_cb_drawpixels.c | 14 ++---
 src/mesa/state_tracker/st_cb_fbo.c|  6 +++---
 src/mesa/state_tracker/st_cb_texture.c|  2 +-
 src/mesa/state_tracker/st_format.c| 24 ++-
 src/mesa/state_tracker/st_format.h|  4 +++-
 src/mesa/state_tracker/st_texture.c   |  2 +-
 6 files changed, 30 insertions(+), 22 deletions(-)

diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c 
b/src/mesa/state_tracker/st_cb_drawpixels.c
index 5a331f841de..b8895684bc2 100644
--- a/src/mesa/state_tracker/st_cb_drawpixels.c
+++ b/src/mesa/state_tracker/st_cb_drawpixels.c
@@ -528,21 +528,21 @@ make_texture(struct st_context *st,
 * image to draw.
 */
pipeFormat = st_choose_matching_format(st, PIPE_BIND_SAMPLER_VIEW,
   format, type, unpack->SwapBytes);
 
if (pipeFormat == PIPE_FORMAT_NONE) {
   /* Use the generic approach. */
   GLenum intFormat = internal_format(ctx, format, type);
 
   pipeFormat = st_choose_format(st, intFormat, format, type,
-st->internal_target, 0,
+st->internal_target, 0, 0,
 PIPE_BIND_SAMPLER_VIEW, FALSE);
   assert(pipeFormat != PIPE_FORMAT_NONE);
}
 
mformat = st_pipe_format_to_mesa_format(pipeFormat);
baseInternalFormat = _mesa_get_format_base_format(mformat);
 
pixels = _mesa_map_pbo_source(ctx, unpack, pixels);
if (!pixels)
   return NULL;
@@ -1577,49 +1577,49 @@ st_CopyPixels(struct gl_context *ctx, GLint srcx, GLint 
srcy,
/* Choose the format for the temporary texture. */
srcFormat = rbRead->texture->format;
srcBind = PIPE_BIND_SAMPLER_VIEW |
   (type == GL_COLOR ? PIPE_BIND_RENDER_TARGET : PIPE_BIND_DEPTH_STENCIL);
 
if (!screen->is_format_supported(screen, srcFormat, st->internal_target, 0,
 0, srcBind)) {
   /* srcFormat is non-renderable. Find a compatible renderable format. */
   if (type == GL_DEPTH) {
  srcFormat = st_choose_format(st, GL_DEPTH_COMPONENT, GL_NONE,
-  GL_NONE, st->internal_target, 0,
+  GL_NONE, st->internal_target, 0, 0,
   srcBind, FALSE);
   }
   else {
  assert(type == GL_COLOR);
 
  if (util_format_is_float(srcFormat)) {
 srcFormat = st_choose_format(st, GL_RGBA32F, GL_NONE,
- GL_NONE, st->internal_target, 0,
+ GL_NONE, st->internal_target, 0, 0,
  srcBind, FALSE);
  }
  else if (util_format_is_pure_sint(srcFormat)) {
 srcFormat = st_choose_format(st, GL_RGBA32I, GL_NONE,
- GL_NONE, st->internal_target, 0,
+ GL_NONE, st->internal_target, 0, 0,
  srcBind, FALSE);
  }
  else if (util_format_is_pure_uint(srcFormat)) {
 srcFormat = st_choose_format(st, GL_RGBA32UI, GL_NONE,
- GL_NONE, st->internal_target, 0,
+ GL_NONE, st->internal_target, 0, 0,
  srcBind, FALSE);
  }
  else if (util_format_is_snorm(srcFormat)) {
 srcFormat = st_choose_format(st, GL_RGBA16_SNORM, GL_NONE,
- GL_NONE, st->internal_target, 0,
+ GL_NONE, st->internal_target, 0, 0,
  srcBind, FALSE);
  }
  else {
 srcFormat = st_choose_format(st, GL_RGBA, GL_NONE,
- GL_NONE, st->internal_target, 0,
+ GL_NONE, st->internal_target, 0, 0,
  srcBind, FALSE);
  }
   }
 
   if (srcFormat == PIPE_FORMAT_NONE) {
  assert(0 && "cannot choose a format for src of CopyPixels");
  return;
   }
}
 
diff --git a/src/mesa/state_tracker/st_cb_fbo.c 
b/src/mesa/state_tracker/st_cb_fbo.c
index 2bb910fcecd..811451656ca 100644
--- a/src/mesa/state_tracker/st_cb_fbo.c
+++ b/src/mesa/state_tracker/st_cb_fbo.c
@@ -76,21 +76,21 @@ st_renderbuffer_alloc_sw_storage(struct gl_context * ctx,
 
if (internalFormat == GL_RGBA16_SNORM) {
   /* Special case for software accum buffers.  Otherwise, if the
* call to st_choose_renderbuffer_format() fails (because the
* driver doesn't support signed 16-bit/channel colors) we'd
* just return without allocating the software accum buffer.
*/
   format = PIPE_FORMAT_R16G16B16A16_SNORM;
}
else {
-  

[Mesa-dev] [PATCH 5/8] mesa: add functional FBO changes for AMD_framebuffer_multisample_advanced

2018-08-01 Thread Marek Olšák
From: Marek Olšák 

- relax FBO completeness rules
- validate sample counts
---
 src/mesa/main/fbobject.c| 96 ++---
 src/mesa/main/multisample.c | 52 
 2 files changed, 131 insertions(+), 17 deletions(-)

diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index 3ed303b51ab..c14c9f4047b 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -962,21 +962,23 @@ test_attachment_completeness(const struct gl_context 
*ctx, GLenum format,
  * Also update the framebuffer's Width and Height fields if the
  * framebuffer is complete.
  */
 void
 _mesa_test_framebuffer_completeness(struct gl_context *ctx,
 struct gl_framebuffer *fb)
 {
GLuint numImages;
GLenum intFormat = GL_NONE; /* color buffers' internal format */
GLuint minWidth = ~0, minHeight = ~0, maxWidth = 0, maxHeight = 0;
-   GLint numSamples = -1;
+   GLint numColorSamples = -1;
+   GLint numColorStorageSamples = -1;
+   GLint numDepthSamples = -1;
GLint fixedSampleLocations = -1;
GLint i;
GLuint j;
/* Covers max_layer_count, is_layered, and layer_tex_target */
bool layer_info_valid = false;
GLuint max_layer_count = 0, att_layer_count;
bool is_layered = false;
GLenum layer_tex_target = 0;
bool has_depth_attachment = false;
bool has_stencil_attachment = false;
@@ -1039,87 +1041,102 @@ _mesa_test_framebuffer_completeness(struct gl_context 
*ctx,
  test_attachment_completeness(ctx, GL_COLOR, att);
  if (!att->Complete) {
 fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT;
 fbo_incomplete(ctx, "color attachment incomplete", i);
 return;
  }
   }
 
   /* get width, height, format of the renderbuffer/texture
*/
+  unsigned attNumSamples, attNumStorageSamples;
+
   if (att->Type == GL_TEXTURE) {
  const struct gl_texture_image *texImg = att->Renderbuffer->TexImage;
  att_tex_target = att->Texture->Target;
  minWidth = MIN2(minWidth, texImg->Width);
  maxWidth = MAX2(maxWidth, texImg->Width);
  minHeight = MIN2(minHeight, texImg->Height);
  maxHeight = MAX2(maxHeight, texImg->Height);
  f = texImg->_BaseFormat;
  attFormat = texImg->TexFormat;
  numImages++;
 
  if (!is_format_color_renderable(ctx, attFormat,
  texImg->InternalFormat) &&
  !is_legal_depth_format(ctx, f) &&
  f != GL_STENCIL_INDEX) {
 fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT;
 fbo_incomplete(ctx, "texture attachment incomplete", -1);
 return;
  }
 
- if (numSamples < 0)
-numSamples = texImg->NumSamples;
- else if (numSamples != texImg->NumSamples) {
-fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE;
-fbo_incomplete(ctx, "inconsistent sample count", -1);
-return;
- }
-
  if (fixedSampleLocations < 0)
 fixedSampleLocations = texImg->FixedSampleLocations;
  else if (fixedSampleLocations != texImg->FixedSampleLocations) {
 fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE;
 fbo_incomplete(ctx, "inconsistent fixed sample locations", -1);
 return;
  }
+
+ attNumSamples = texImg->NumSamples;
+ attNumStorageSamples = texImg->NumSamples;
   }
   else if (att->Type == GL_RENDERBUFFER_EXT) {
  minWidth = MIN2(minWidth, att->Renderbuffer->Width);
  maxWidth = MAX2(minWidth, att->Renderbuffer->Width);
  minHeight = MIN2(minHeight, att->Renderbuffer->Height);
  maxHeight = MAX2(minHeight, att->Renderbuffer->Height);
  f = att->Renderbuffer->InternalFormat;
  attFormat = att->Renderbuffer->Format;
  numImages++;
 
- if (numSamples < 0)
-numSamples = att->Renderbuffer->NumSamples;
- else if (numSamples != att->Renderbuffer->NumSamples) {
-fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE;
-fbo_incomplete(ctx, "inconsistent sample count", -1);
-return;
- }
-
  /* RENDERBUFFER has fixedSampleLocations implicitly true */
  if (fixedSampleLocations < 0)
 fixedSampleLocations = GL_TRUE;
  else if (fixedSampleLocations != GL_TRUE) {
 fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE;
 fbo_incomplete(ctx, "inconsistent fixed sample locations", -1);
 return;
  }
+
+ attNumSamples = att->Renderbuffer->NumSamples;
+ attNumStorageSamples = att->Renderbuffer->NumStorageSamples;
   }
   else {
  assert(att->Type == GL_NONE);
  continue;
   }
 
+  if (i >= 0) {
+ /* Color buffers. */
+ if (numColorSamples < 0) {
+

[Mesa-dev] [PATCH 8/8] st/mesa: expose & set limits for AMD_framebuffer_multisample_advanced

2018-08-01 Thread Marek Olšák
From: Marek Olšák 

---
 src/mesa/state_tracker/st_extensions.c | 89 ++
 1 file changed, 89 insertions(+)

diff --git a/src/mesa/state_tracker/st_extensions.c 
b/src/mesa/state_tracker/st_extensions.c
index dbaf7f6f8fe..1c01495e937 100644
--- a/src/mesa/state_tracker/st_extensions.c
+++ b/src/mesa/state_tracker/st_extensions.c
@@ -593,20 +593,40 @@ get_max_samples_for_formats(struct pipe_screen *screen,
   for (f = 0; f < num_formats; f++) {
  if (screen->is_format_supported(screen, formats[f],
  PIPE_TEXTURE_2D, i, i, bind)) {
 return i;
  }
   }
}
return 0;
 }
 
+static unsigned
+get_max_samples_for_formats_advanced(struct pipe_screen *screen,
+ unsigned num_formats,
+ const enum pipe_format *formats,
+ unsigned max_samples,
+ unsigned num_storage_samples,
+ unsigned bind)
+{
+   unsigned i, f;
+
+   for (i = max_samples; i > 0; --i) {
+  for (f = 0; f < num_formats; f++) {
+ if (screen->is_format_supported(screen, formats[f], PIPE_TEXTURE_2D,
+ i, num_storage_samples, bind)) {
+return i;
+ }
+  }
+   }
+   return 0;
+}
 
 /**
  * Use pipe_screen::get_param() to query PIPE_CAP_ values to determine
  * which GL extensions are supported.
  * Quite a few extensions are always supported because they are standard
  * features or can be built on top of other gallium features.
  * Some fine tuning may still be needed.
  */
 void st_init_extensions(struct pipe_screen *screen,
 struct gl_constants *consts,
@@ -678,20 +698,21 @@ void st_init_extensions(struct pipe_screen *screen,
   { o(EXT_memory_object_fd), PIPE_CAP_MEMOBJ   
},
   { o(EXT_semaphore),PIPE_CAP_FENCE_SIGNAL 
},
   { o(EXT_semaphore_fd), PIPE_CAP_FENCE_SIGNAL 
},
   { o(EXT_texture_array),PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS 
},
   { o(EXT_texture_filter_anisotropic),   PIPE_CAP_ANISOTROPIC_FILTER   
},
   { o(EXT_texture_mirror_clamp), PIPE_CAP_TEXTURE_MIRROR_CLAMP 
},
   { o(EXT_texture_swizzle),  PIPE_CAP_TEXTURE_SWIZZLE  
},
   { o(EXT_transform_feedback),   
PIPE_CAP_MAX_STREAM_OUTPUT_BUFFERS},
   { o(EXT_window_rectangles),PIPE_CAP_MAX_WINDOW_RECTANGLES
},
 
+  { o(AMD_framebuffer_multisample_advanced), 
PIPE_CAP_FRAMEBUFFER_MSAA_CONSTRAINTS },
   { o(AMD_pinned_memory),
PIPE_CAP_RESOURCE_FROM_USER_MEMORY},
   { o(ATI_meminfo),  PIPE_CAP_QUERY_MEMORY_INFO
},
   { o(AMD_seamless_cubemap_per_texture), 
PIPE_CAP_SEAMLESS_CUBE_MAP_PER_TEXTURE},
   { o(ATI_texture_mirror_once),  PIPE_CAP_TEXTURE_MIRROR_CLAMP 
},
   { o(MESA_tile_raster_order),   PIPE_CAP_TILE_RASTER_ORDER
},
   { o(NV_conditional_render),PIPE_CAP_CONDITIONAL_RENDER   
},
   { o(NV_fill_rectangle),
PIPE_CAP_POLYGON_MODE_FILL_RECTANGLE  },
   { o(NV_primitive_restart), PIPE_CAP_PRIMITIVE_RESTART
},
   { o(NV_texture_barrier),   PIPE_CAP_TEXTURE_BARRIER  
},
   { o(NVX_gpu_memory_info),  PIPE_CAP_QUERY_MEMORY_INFO
},
@@ -1095,20 +1116,88 @@ void st_init_extensions(struct pipe_screen *screen,
   consts->MaxIntegerSamples =
  get_max_samples_for_formats(screen, ARRAY_SIZE(int_formats),
  int_formats, consts->MaxSamples,
  PIPE_BIND_SAMPLER_VIEW);
 
   /* ARB_framebuffer_no_attachments, assume max no. of samples 32 */
   consts->MaxFramebufferSamples =
  get_max_samples_for_formats(screen, ARRAY_SIZE(void_formats),
  void_formats, 32,
  PIPE_BIND_RENDER_TARGET);
+
+  if (extensions->AMD_framebuffer_multisample_advanced) {
+ /* AMD_framebuffer_multisample_advanced */
+ /* This can be greater than storage samples. */
+ consts->MaxColorFramebufferSamples =
+get_max_samples_for_formats_advanced(screen,
+ARRAY_SIZE(color_formats),
+color_formats, 16,
+consts->MaxSamples,
+PIPE_BIND_RENDER_TARGET);
+
+ /* If the driver supports N color samples, it means it supports
+   

[Mesa-dev] [PATCH 4/8] mesa: add gl_renderbuffer::NumStorageSamples

2018-08-01 Thread Marek Olšák
From: Marek Olšák 

---
 src/mesa/drivers/dri/i965/intel_fbo.c |  2 ++
 src/mesa/main/fbobject.c  | 25 +
 src/mesa/main/mtypes.h|  1 +
 src/mesa/state_tracker/st_cb_fbo.c|  4 +++-
 4 files changed, 23 insertions(+), 9 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/intel_fbo.c 
b/src/mesa/drivers/dri/i965/intel_fbo.c
index e6825955b0e..4ad27474100 100644
--- a/src/mesa/drivers/dri/i965/intel_fbo.c
+++ b/src/mesa/drivers/dri/i965/intel_fbo.c
@@ -283,20 +283,21 @@ intel_alloc_private_renderbuffer_storage(struct 
gl_context * ctx, struct gl_rend
  GLenum internalFormat,
  GLuint width, GLuint height)
 {
struct brw_context *brw = brw_context(ctx);
struct intel_screen *screen = brw->screen;
struct intel_renderbuffer *irb = intel_renderbuffer(rb);
 
assert(rb->Format != MESA_FORMAT_NONE);
 
rb->NumSamples = intel_quantize_num_samples(screen, rb->NumSamples);
+   rb->NumStorageSamples = rb->NumSamples;
rb->Width = width;
rb->Height = height;
rb->_BaseFormat = _mesa_get_format_base_format(rb->Format);
 
intel_miptree_release(>mt);
 
DBG("%s: %s: %s (%dx%d)\n", __func__,
_mesa_enum_to_string(internalFormat),
_mesa_get_format_name(rb->Format), width, height);
 
@@ -426,20 +427,21 @@ intel_create_winsys_renderbuffer(struct intel_screen 
*screen,
struct intel_renderbuffer *irb = CALLOC_STRUCT(intel_renderbuffer);
if (!irb)
   return NULL;
 
struct gl_renderbuffer *rb = >Base.Base;
irb->layer_count = 1;
 
_mesa_init_renderbuffer(rb, 0);
rb->ClassID = INTEL_RB_CLASS;
rb->NumSamples = num_samples;
+   rb->NumStorageSamples = num_samples;
 
/* The base format and internal format must be derived from the user-visible
 * format (that is, the gl_config's format), even if we internally use
 * choose a different format for the renderbuffer. Otherwise, rendering may
 * use incorrect channel write masks.
 */
rb->_BaseFormat = _mesa_get_format_base_format(format);
rb->InternalFormat = rb->_BaseFormat;
 
rb->Format = format;
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index f63902c9dd4..3ed303b51ab 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -474,20 +474,21 @@ _mesa_update_texture_renderbuffer(struct gl_context *ctx,
if (!texImage)
   return;
 
rb->_BaseFormat = texImage->_BaseFormat;
rb->Format = texImage->TexFormat;
rb->InternalFormat = texImage->InternalFormat;
rb->Width = texImage->Width2;
rb->Height = texImage->Height2;
rb->Depth = texImage->Depth2;
rb->NumSamples = texImage->NumSamples;
+   rb->NumStorageSamples = texImage->NumSamples;
rb->TexImage = texImage;
 
if (driver_RenderTexture_is_safe(att))
   ctx->Driver.RenderTexture(ctx, fb, att);
 }
 
 /**
  * Bind a texture object to an attachment point.
  * The previous binding, if any, will be removed first.
  */
@@ -2230,48 +2231,51 @@ _mesa_renderbuffer_storage(struct gl_context *ctx, 
struct gl_renderbuffer *rb,
   assert(_mesa_check_sample_count(ctx, GL_RENDERBUFFER,
   internalFormat, samples,
   storageSamples) == GL_NO_ERROR);
}
 
FLUSH_VERTICES(ctx, _NEW_BUFFERS);
 
if (rb->InternalFormat == internalFormat &&
rb->Width == (GLuint) width &&
rb->Height == (GLuint) height &&
-   rb->NumSamples == samples) {
+   rb->NumSamples == samples &&
+   rb->NumStorageSamples == storageSamples) {
   /* no change in allocation needed */
   return;
}
 
/* These MUST get set by the AllocStorage func */
rb->Format = MESA_FORMAT_NONE;
rb->NumSamples = samples;
+   rb->NumStorageSamples = storageSamples;
 
/* Now allocate the storage */
assert(rb->AllocStorage);
if (rb->AllocStorage(ctx, rb, internalFormat, width, height)) {
   /* No error - check/set fields now */
   /* If rb->Format == MESA_FORMAT_NONE, the format is unsupported. */
   assert(rb->Width == (GLuint) width);
   assert(rb->Height == (GLuint) height);
   rb->InternalFormat = internalFormat;
   rb->_BaseFormat = baseFormat;
   assert(rb->_BaseFormat != 0);
}
else {
   /* Probably ran out of memory - clear the fields */
   rb->Width = 0;
   rb->Height = 0;
   rb->Format = MESA_FORMAT_NONE;
   rb->InternalFormat = GL_NONE;
   rb->_BaseFormat = GL_NONE;
   rb->NumSamples = 0;
+  rb->NumStorageSamples = 0;
}
 
/* Invalidate the framebuffers the renderbuffer is attached in. */
if (rb->AttachedAnytime) {
   _mesa_HashWalk(ctx->Shared->FrameBuffers, invalidate_rb, rb);
}
 }
 
 /**
  * Helper function used by renderbuffer_storage_direct() and
@@ -2577,33 +2581,38 @@ get_render_buffer_parameteriv(struct gl_context *ctx,
case 

[Mesa-dev] [PATCH 0/8] GL_AMD_framebuffer_multisample_advanced for RadeonSI

2018-08-01 Thread Marek Olšák
Hi,

This implements GL_AMD_framebuffer_multisample_advanced, which is
AMD EQAA.

I have also sent out a piglit test that tests the new API.

Please review.

Thanks,
Marek
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 1/8] mesa: add storageSamples parameter to renderbuffer functions

2018-08-01 Thread Marek Olšák
From: Marek Olšák 

It's just passed to other functions but otherwise unused.
It will be used in following commits.
---
 src/mesa/drivers/common/meta.c |  2 +-
 src/mesa/main/fbobject.c   | 41 +-
 src/mesa/main/fbobject.h   |  3 ++-
 src/mesa/main/multisample.c|  3 ++-
 src/mesa/main/multisample.h|  3 ++-
 src/mesa/main/teximage.c   |  2 +-
 6 files changed, 33 insertions(+), 21 deletions(-)

diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
index 6b1713e3b1c..04752e0e875 100644
--- a/src/mesa/drivers/common/meta.c
+++ b/src/mesa/drivers/common/meta.c
@@ -3072,21 +3072,21 @@ decompress_texture_image(struct gl_context *ctx,
   _mesa_framebuffer_renderbuffer(ctx, ctx->DrawBuffer, 
GL_COLOR_ATTACHMENT0,
  decompress_fbo->rb);
}
else {
   _mesa_bind_framebuffers(ctx, decompress_fbo->fb, decompress_fbo->fb);
}
 
/* alloc dest surface */
if (width > decompress_fbo->Width || height > decompress_fbo->Height) {
   _mesa_renderbuffer_storage(ctx, decompress_fbo->rb, rbFormat,
- width, height, 0);
+ width, height, 0, 0);
 
   /* Do the full completeness check to recompute
* ctx->DrawBuffer->Width/Height.
*/
   ctx->DrawBuffer->_Status = GL_FRAMEBUFFER_UNDEFINED;
   status = _mesa_check_framebuffer_status(ctx, ctx->DrawBuffer);
   if (status != GL_FRAMEBUFFER_COMPLETE) {
  /* If the framebuffer isn't complete then we'll leave
   * decompress_fbo->Width as zero so that it will fail again next time
   * too */
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index cfe2174ef12..edafdd011aa 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -2209,32 +2209,34 @@ invalidate_rb(GLuint key, void *data, void *userData)
}
 }
 
 
 /** sentinal value, see below */
 #define NO_SAMPLES 1000
 
 void
 _mesa_renderbuffer_storage(struct gl_context *ctx, struct gl_renderbuffer *rb,
GLenum internalFormat, GLsizei width,
-   GLsizei height, GLsizei samples)
+   GLsizei height, GLsizei samples,
+   GLsizei storageSamples)
 {
const GLenum baseFormat = _mesa_base_fbo_format(ctx, internalFormat);
 
assert(baseFormat != 0);
assert(width >= 0 && width <= (GLsizei) ctx->Const.MaxRenderbufferSize);
assert(height >= 0 && height <= (GLsizei) ctx->Const.MaxRenderbufferSize);
assert(samples != NO_SAMPLES);
if (samples != 0) {
   assert(samples > 0);
   assert(_mesa_check_sample_count(ctx, GL_RENDERBUFFER,
-  internalFormat, samples) == GL_NO_ERROR);
+  internalFormat, samples,
+  storageSamples) == GL_NO_ERROR);
}
 
FLUSH_VERTICES(ctx, _NEW_BUFFERS);
 
if (rb->InternalFormat == internalFormat &&
rb->Width == (GLuint) width &&
rb->Height == (GLuint) height &&
rb->NumSamples == samples) {
   /* no change in allocation needed */
   return;
@@ -2272,21 +2274,22 @@ _mesa_renderbuffer_storage(struct gl_context *ctx, 
struct gl_renderbuffer *rb,
 }
 
 /**
  * Helper function used by renderbuffer_storage_direct() and
  * renderbuffer_storage_target().
  * samples will be NO_SAMPLES if called by a non-multisample function.
  */
 static void
 renderbuffer_storage(struct gl_context *ctx, struct gl_renderbuffer *rb,
  GLenum internalFormat, GLsizei width,
- GLsizei height, GLsizei samples, const char *func)
+ GLsizei height, GLsizei samples, GLsizei storageSamples,
+ const char *func)
 {
GLenum baseFormat;
GLenum sample_count_error;
 
baseFormat = _mesa_base_fbo_format(ctx, internalFormat);
if (baseFormat == 0) {
   _mesa_error(ctx, GL_INVALID_ENUM, "%s(internalFormat=%s)",
   func, _mesa_enum_to_string(internalFormat));
   return;
}
@@ -2299,54 +2302,58 @@ renderbuffer_storage(struct gl_context *ctx, struct 
gl_renderbuffer *rb,
 
if (height < 0 || height > (GLsizei) ctx->Const.MaxRenderbufferSize) {
   _mesa_error(ctx, GL_INVALID_VALUE, "%s(invalid height %d)", func,
   height);
   return;
}
 
if (samples == NO_SAMPLES) {
   /* NumSamples == 0 indicates non-multisampling */
   samples = 0;
+  storageSamples = 0;
}
else {
   /* check the sample count;
* note: driver may choose to use more samples than what's requested
*/
   sample_count_error = _mesa_check_sample_count(ctx, GL_RENDERBUFFER,
-internalFormat, samples);
+internalFormat, samples, storageSamples);
 
   /* Section 2.5 (GL Errors) of OpenGL 3.0 specification, page 16:
*
* "If 

[Mesa-dev] [PATCH 3/3 v3] CleanSpec.mk: Remove HOST_OUT_release

2018-08-01 Thread John Stultz
From: Dan Willemsen 

This is a forward port of a patch from the AOSP/master tree:
https://android.googlesource.com/platform/external/mesa3d/+/bd633f11de0c6ac1ed333a28344c74fd9898df9e%5E%21/

Which replaces HOST_OUT_release with HOST_OUT

As per Dan's explanation, the current code was incorrect to use
$(HOST_OUT_release) as $(HOST_OUT) will be set properly for
whether the current build that's being cleaned during
incrementals is using host debug or release builds.

Additionally Dan noted it was incredibly uncommon to use a debug
host build, as there was never a shortcut and one had to set an
environment variable manually. Thus it was rarely if ever tested.

Change-Id: I7972c0a50fa3520dcfa962d6dd7e602bfe22368d
Cc: Rob Herring 
Cc: Alistair Strachan 
Cc: Marissa Wall 
Cc: Sumit Semwal 
Cc: Emil Velikov 
Cc: Rob Clark 
Reviewed-by: Emil Velikov 
Signed-off-by: John Stultz 
---
v2: Add more justification to the commit message
---
 CleanSpec.mk | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/CleanSpec.mk b/CleanSpec.mk
index d08b0de..e5030ce 100644
--- a/CleanSpec.mk
+++ b/CleanSpec.mk
@@ -10,7 +10,7 @@ $(call add-clean-step, rm -rf 
$(PRODUCT_OUT)/*/STATIC_LIBRARIES/libmesa_*_interm
 $(call add-clean-step, rm -rf 
$(PRODUCT_OUT)/*/SHARED_LIBRARIES/i9?5_dri_intermediates)
 $(call add-clean-step, rm -rf 
$(PRODUCT_OUT)/*/SHARED_LIBRARIES/libglapi_intermediates)
 $(call add-clean-step, rm -rf 
$(PRODUCT_OUT)/*/SHARED_LIBRARIES/libGLES_mesa_intermediates)
-$(call add-clean-step, rm -rf 
$(HOST_OUT_release)/*/EXECUTABLES/mesa_*_intermediates)
-$(call add-clean-step, rm -rf 
$(HOST_OUT_release)/*/EXECUTABLES/glsl_compiler_intermediates)
-$(call add-clean-step, rm -rf 
$(HOST_OUT_release)/*/STATIC_LIBRARIES/libmesa_*_intermediates)
+$(call add-clean-step, rm -rf $(HOST_OUT)/*/EXECUTABLES/mesa_*_intermediates)
+$(call add-clean-step, rm -rf 
$(HOST_OUT)/*/EXECUTABLES/glsl_compiler_intermediates)
+$(call add-clean-step, rm -rf 
$(HOST_OUT)/*/STATIC_LIBRARIES/libmesa_*_intermediates)
 $(call add-clean-step, rm -rf 
$(PRODUCT_OUT)/*/SHARED_LIBRARIES/*_dri_intermediates)
-- 
2.7.4

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


[Mesa-dev] [PATCH 2/3 v3] Android.common.mk: define HAVE_TIMESPEC_GET

2018-08-01 Thread John Stultz
From: Sumit Semwal 

This is a forward port of a patch from the AOSP/master tree:
https://android.googlesource.com/platform/external/mesa3d/+/bd30b663f55f8af73a0be4446349c5a2d4c641b0%5E%21/

Since https://android-review.googlesource.com/c/718518 added
timespec_get() to bionic, mesa3d doesn't build due to redefinition
of timespec_get().

Avoid redefinition by defining HAVE_TIMESPEC_GET flag.

Test: build and boot tested db820c to UI.

Change-Id: I3dcc8034b48785e45cd3fa50e4d9cf2c684694a0
Cc: Rob Herring 
Cc: Alistair Strachan 
Cc: Marissa Wall 
Cc: Sumit Semwal 
Cc: Emil Velikov 
Cc: Rob Clark 
Reviewed-by: Emil Velikov 
Signed-off-by: Sumit Semwal 
Signed-off-by: John Stultz 
---
v2: Conditionalize it for PLATFORM_VERSION Q and higher
v3: Rework conditionalization to numbered releases prior
to P (9.0)
---
 Android.common.mk | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/Android.common.mk b/Android.common.mk
index 397dc03..619b216 100644
--- a/Android.common.mk
+++ b/Android.common.mk
@@ -89,6 +89,13 @@ LOCAL_CPPFLAGS += \
 LOCAL_CONLYFLAGS += \
-std=c99
 
+# c11 timespec_get is part of bionic as well
+# https://android-review.googlesource.com/c/718518
+# This means releases from P and earlier won't need this
+ifeq ($(filter 5 6 7 8 9, $(MESA_ANDROID_MAJOR_VERSION)),)
+LOCAL_CFLAGS += -DHAVE_TIMESPEC_GET
+endif
+
 ifeq ($(strip $(MESA_ENABLE_ASM)),true)
 ifeq ($(TARGET_ARCH),x86)
 LOCAL_CFLAGS += \
-- 
2.7.4

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


[Mesa-dev] [PATCH 1/3 v3] util: Android.mk: Convert implicit rules to static pattern rules

2018-08-01 Thread John Stultz
From: Dan Willemsen 

This is a partial cherry-pick from AOSP's mesa3d tree:
 
https://android.googlesource.com/platform/external/mesa3d/+/a88dcf769eb00a4ffc7183a0396d881a28b5a29b%5E%21/

"We're deprecating make implicit rules, preferring static pattern
rules, or just regular rules."

Without this patch, the freedesktop/master branch won't build in
the AOSP environment, and this patch corrects that, as tested
on the Dragonboard 820c.

The i965 portion of the patch this is based on collided badly,
and I'm not sure how to best forward port it. However, so far
we don't see build issues without that portion.

Comments or feedback would be appreciated!

Change-Id: Id6dfd0d018cbd665fa19d80c14abd5f75fa10b8a
Cc: Rob Herring 
Cc: Alistair Strachan 
Cc: Marissa Wall 
Cc: Sumit Semwal 
Cc: Emil Velikov 
Cc: Rob Clark 
Reviewed-by: Emil Velikov 
Signed-off-by: John Stultz 
---
 src/util/Android.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/util/Android.mk b/src/util/Android.mk
index 9b61442..e463b63 100644
--- a/src/util/Android.mk
+++ b/src/util/Android.mk
@@ -71,7 +71,7 @@ $(POT): $(LOCAL_PATH)/xmlpool/t_options.h
@mkdir -p $(dir $@)
xgettext -L C --from-code utf-8 -o $@ $<
 
-$(intermediates)/xmlpool/%.po: $(LOCAL_PATH)/xmlpool/%.po $(POT)
+$(MESA_DRI_OPTIONS_LANGS:%=$(intermediates)/xmlpool/%.po): 
$(intermediates)/xmlpool/%.po: $(LOCAL_PATH)/xmlpool/%.po $(POT)
lang=$(basename $(notdir $@)); \
mkdir -p $(dir $@); \
if [ -f $< ]; then \
-- 
2.7.4

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


[Mesa-dev] [PATCH] st/mesa: Don't set atomic counter size != 0 with atomic buffers == 0.

2018-08-01 Thread Eric Anholt
This is just asking for tests to get confused about the HW supporting
atomics in this shader stage or not, such as
dEQP-GLES31.functional.shaders.opaque_type_indexing.atomic_counter.const_expression_vertex.
---
 src/mesa/state_tracker/st_extensions.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/mesa/state_tracker/st_extensions.c 
b/src/mesa/state_tracker/st_extensions.c
index dbaf7f6f8fe5..cd17f026fed2 100644
--- a/src/mesa/state_tracker/st_extensions.c
+++ b/src/mesa/state_tracker/st_extensions.c
@@ -243,9 +243,10 @@ void st_init_limits(struct pipe_screen *screen,
  pc->MaxAtomicBuffers = screen->get_shader_param(screen, sh, 
PIPE_SHADER_CAP_MAX_HW_ATOMIC_COUNTER_BUFFERS);
  pc->MaxShaderStorageBlocks = screen->get_shader_param(screen, sh, 
PIPE_SHADER_CAP_MAX_SHADER_BUFFERS);
   } else {
- pc->MaxAtomicCounters = MAX_ATOMIC_COUNTERS;
  pc->MaxAtomicBuffers = screen->get_shader_param(screen, sh, 
PIPE_SHADER_CAP_MAX_SHADER_BUFFERS) / 2;
  pc->MaxShaderStorageBlocks = pc->MaxAtomicBuffers;
+ if (pc->MaxAtomicBuffers)
+pc->MaxAtomicCounters = MAX_ATOMIC_COUNTERS;
   }
   pc->MaxImageUniforms = screen->get_shader_param(
 screen, sh, PIPE_SHADER_CAP_MAX_SHADER_IMAGES);
-- 
2.18.0

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


Re: [Mesa-dev] [PATCH 5/6] ddebug: opt-out non UNIX code

2018-08-01 Thread Dylan Baker
I pushed a patch earlier that *should* make mkdir and getpid work with msvc

Dylan

Quoting Andres Gomez (2018-08-01 11:53:04)
> Opt-out the code using mkdir() and getpid() which are spitting
> warnings in the MSVC build:
> 
>   Compiling src\gallium\auxiliary\driver_ddebug\dd_draw.c ...
> dd_draw.c
> c:\projects\mesa\src\gallium\auxiliary\driver_ddebug\dd_util.h(62): warning 
> C4013: 'mkdir' undefined; assuming extern returning int
> c:\projects\mesa\src\gallium\auxiliary\driver_ddebug\dd_util.h(65): warning 
> C4013: 'getpid' undefined; assuming extern returning int
> 
> Fixes: 6ff0c6f4ebc ("gallium: move ddebug, noop, rbug, trace to auxiliary to 
> improve build times")
> Cc: Marek Olšák 
> Cc: Brian Paul 
> Cc: Roland Scheidegger 
> Cc: Nicolai Hähnle 
> Signed-off-by: Andres Gomez 
> ---
>  src/gallium/auxiliary/driver_ddebug/dd_util.h | 4 
>  1 file changed, 4 insertions(+)
> 
> diff --git a/src/gallium/auxiliary/driver_ddebug/dd_util.h 
> b/src/gallium/auxiliary/driver_ddebug/dd_util.h
> index 7720e9af9ca..681627c83cb 100644
> --- a/src/gallium/auxiliary/driver_ddebug/dd_util.h
> +++ b/src/gallium/auxiliary/driver_ddebug/dd_util.h
> @@ -60,11 +60,15 @@ dd_get_debug_filename_and_mkdir(char *buf, size_t buflen, 
> bool verbose)
>  
> util_snprintf(dir, sizeof(dir), "%s/"DD_DIR, debug_get_option("HOME", 
> "."));
>  
> +#ifdef PIPE_OS_UNIX
> if (mkdir(dir, 0774) && errno != EEXIST)
>fprintf(stderr, "dd: can't create a directory (%i)\n", errno);
>  
> util_snprintf(buf, buflen, "%s/%s_%u_%08u", dir, proc_name, getpid(),
>   p_atomic_inc_return() - 1);
> +#else
> +   fprintf(stderr, "dd: can't create a directory (%i)\n", errno);
> +#endif
>  
> if (verbose)
>fprintf(stderr, "dd: dumping to file %s\n", buf);
> -- 
> 2.18.0
> 
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


signature.asc
Description: signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 107439] mesa defines likely/unlikely and these are C++20 keywords

2018-08-01 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=107439

Casey Carter  changed:

   What|Removed |Added

 CC||ca...@carter.net

--- Comment #2 from Casey Carter  ---
They're not technically keywords, they are "attribute-tokens". The problem is
that there is library wording in the Standard which forbids defining macros
with the same names as keywords, context-sensitive identifiers, and
attribute-tokens. C++17 [macro.names] para 2:

> A translation unit shall not #define or #undef names lexically identical to 
> keywords, to the identifiers listed in Table 4, or to the attribute-tokens 
> described in [dcl.attr].

When WG21 added "likely" and "unlikely" to [dcl.attr] in the C++20 working
draft, that made it implicitly forbidden to define them as macros. (Since The
change is a core language change the library groups never saw the proposal to
notice the problem.)

I've filed an issue with WG21 to change [macro.names]/2 to allow definitions of
"likely" and "unlikely" as function-like macros, which doesn't interfere with
use of the attributes [[likely]] and [[unlikely]] since there are no
parentheses to trigger expansion of a function-like macro. Assuming that the
rest of the Library Working Group agrees with me that we can't simply break
this much code for no good reason, you shouldn't need to change anything.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v2 6/6] mesa: replace binary constants with hexadecimal constants

2018-08-01 Thread Andres Gomez
The binary constant notation "0b" is a GCC extension. Instead, we use
hexadecimal notation to fix the MSVC 2013 build:

Compiling src\mesa\main\texcompress_astc.cpp ...
texcompress_astc.cpp
src\mesa\main\texcompress_astc.cpp(111) : error C2059: syntax error : 'bad 
suffix on number'

...

src\mesa\main\texcompress_astc.cpp(1007) : fatal error C1003: error count 
exceeds 100; stopping compilation
scons: *** [build\windows-x86-debug\mesa\main\texcompress_astc.obj] Error 2
scons: building terminated because of errors.

v2: Fix wrong conversion (Ilia).

Fixes: 38ab39f6501 ("mesa: add ASTC 2D LDR decoder")
Cc: Marek Olšák 
Cc: Brian Paul 
Cc: Roland Scheidegger 
Cc: Mike Lothian 
Cc: Gert Wollny 
Cc: Dieter Nützel 
Cc: Ilia Mirkin 
Signed-off-by: Andres Gomez 
---
 src/mesa/main/texcompress_astc.cpp | 116 ++---
 1 file changed, 58 insertions(+), 58 deletions(-)

diff --git a/src/mesa/main/texcompress_astc.cpp 
b/src/mesa/main/texcompress_astc.cpp
index 996e8ea28d6..23540c47017 100644
--- a/src/mesa/main/texcompress_astc.cpp
+++ b/src/mesa/main/texcompress_astc.cpp
@@ -108,14 +108,14 @@ static void unpack_trit_block(int n, T in, uint8_t *out)
 {
assert(n <= 6); /* else output will overflow uint8_t */
 
-   uint8_t T0 = (in >> (n)) & 0b1;
-   uint8_t T1 = (in >> (n+1)) & 0b1;
-   uint8_t T2 = (in >> (2*n+2)) & 0b1;
-   uint8_t T3 = (in >> (2*n+3)) & 0b1;
-   uint8_t T4 = (in >> (3*n+4)) & 0b1;
-   uint8_t T5 = (in >> (4*n+5)) & 0b1;
-   uint8_t T6 = (in >> (4*n+6)) & 0b1;
-   uint8_t T7 = (in >> (5*n+7)) & 0b1;
+   uint8_t T0 = (in >> (n)) & 0x1;
+   uint8_t T1 = (in >> (n+1)) & 0x1;
+   uint8_t T2 = (in >> (2*n+2)) & 0x1;
+   uint8_t T3 = (in >> (2*n+3)) & 0x1;
+   uint8_t T4 = (in >> (3*n+4)) & 0x1;
+   uint8_t T5 = (in >> (4*n+5)) & 0x1;
+   uint8_t T6 = (in >> (4*n+6)) & 0x1;
+   uint8_t T7 = (in >> (5*n+7)) & 0x1;
uint8_t mmask = (1 << n) - 1;
uint8_t m0 = (in >> (0)) & mmask;
uint8_t m1 = (in >> (n+2)) & mmask;
@@ -125,12 +125,12 @@ static void unpack_trit_block(int n, T in, uint8_t *out)
 
uint8_t C;
uint8_t t4, t3, t2, t1, t0;
-   if (CAT_BITS_3(T4, T3, T2) == 0b111) {
+   if (CAT_BITS_3(T4, T3, T2) == 0x7) {
   C = CAT_BITS_5(T7, T6, T5, T1, T0);
   t4 = t3 = 2;
} else {
   C = CAT_BITS_5(T4, T3, T2, T1, T0);
-  if (CAT_BITS_2(T6, T5) == 0b11) {
+  if (CAT_BITS_2(T6, T5) == 0x3) {
  t4 = 2;
  t3 = T7;
   } else {
@@ -139,21 +139,21 @@ static void unpack_trit_block(int n, T in, uint8_t *out)
   }
}
 
-   if ((C & 0b11) == 0b11) {
+   if ((C & 0x3) == 0x3) {
   t2 = 2;
-  t1 = (C >> 4) & 0b1;
-  uint8_t C3 = (C >> 3) & 0b1;
-  uint8_t C2 = (C >> 2) & 0b1;
+  t1 = (C >> 4) & 0x1;
+  uint8_t C3 = (C >> 3) & 0x1;
+  uint8_t C2 = (C >> 2) & 0x1;
   t0 = (C3 << 1) | (C2 & ~C3);
-   } else if (((C >> 2) & 0b11) == 0b11) {
+   } else if (((C >> 2) & 0x3) == 0x3) {
   t2 = 2;
   t1 = 2;
-  t0 = C & 0b11;
+  t0 = C & 0x3;
} else {
-  t2 = (C >> 4) & 0b1;
-  t1 = (C >> 2) & 0b11;
-  uint8_t C1 = (C >> 1) & 0b1;
-  uint8_t C0 = (C >> 0) & 0b1;
+  t2 = (C >> 4) & 0x1;
+  t1 = (C >> 2) & 0x3;
+  uint8_t C1 = (C >> 1) & 0x1;
+  uint8_t C0 = (C >> 0) & 0x1;
   t0 = (C1 << 1) | (C0 & ~C1);
}
 
@@ -171,13 +171,13 @@ static void unpack_quint_block(int n, uint32_t in, 
uint8_t *out)
 {
assert(n <= 5); /* else output will overflow uint8_t */
 
-   uint8_t Q0 = (in >> (n)) & 0b1;
-   uint8_t Q1 = (in >> (n+1)) & 0b1;
-   uint8_t Q2 = (in >> (n+2)) & 0b1;
-   uint8_t Q3 = (in >> (2*n+3)) & 0b1;
-   uint8_t Q4 = (in >> (2*n+4)) & 0b1;
-   uint8_t Q5 = (in >> (3*n+5)) & 0b1;
-   uint8_t Q6 = (in >> (3*n+6)) & 0b1;
+   uint8_t Q0 = (in >> (n)) & 0x1;
+   uint8_t Q1 = (in >> (n+1)) & 0x1;
+   uint8_t Q2 = (in >> (n+2)) & 0x1;
+   uint8_t Q3 = (in >> (2*n+3)) & 0x1;
+   uint8_t Q4 = (in >> (2*n+4)) & 0x1;
+   uint8_t Q5 = (in >> (3*n+5)) & 0x1;
+   uint8_t Q6 = (in >> (3*n+6)) & 0x1;
uint8_t mmask = (1 << n) - 1;
uint8_t m0 = (in >> (0)) & mmask;
uint8_t m1 = (in >> (n+3)) & mmask;
@@ -185,24 +185,24 @@ static void unpack_quint_block(int n, uint32_t in, 
uint8_t *out)
 
uint8_t C;
uint8_t q2, q1, q0;
-   if (CAT_BITS_4(Q6, Q5, Q2, Q1) == 0b0011) {
+   if (CAT_BITS_4(Q6, Q5, Q2, Q1) == 0x3) {
   q2 = CAT_BITS_3(Q0, Q4 & ~Q0, Q3 & ~Q0);
   q1 = 4;
   q0 = 4;
} else {
-  if (CAT_BITS_2(Q2, Q1) == 0b11) {
+  if (CAT_BITS_2(Q2, Q1) == 0x3) {
  q2 = 4;
- C = CAT_BITS_5(Q4, Q3, 0b1 & ~Q6, 0b1 & ~Q5, Q0);
+ C = CAT_BITS_5(Q4, Q3, 0x1 & ~Q6, 0x1 & ~Q5, Q0);
   } else {
  q2 = CAT_BITS_2(Q6, Q5);
  C = CAT_BITS_5(Q4, Q3, Q2, Q1, Q0);
   }
-  if ((C & 0b111) == 0b101) {
+  if ((C & 0x7) == 0x5) {
  q1 = 4;
- q0 = (C >> 3) & 0b11;
+ q0 = (C >> 3) & 0x3;
   } else {
- q1 = (C >> 3) & 0b11;
- q0 = C & 0b111;
+   

Re: [Mesa-dev] [PATCH 1/2] scons: require scons 2.4 or greater

2018-08-01 Thread Andres Gomez
This is:

Reviewed-by: Andres Gomez 

On Wed, 2018-08-01 at 19:48 +0200, Juan A. Suarez Romero wrote:
> There is a bug with scons 2.3, used in Travis, where it fails to detect
> some C functions.
> ---
>  SConstruct | 6 ++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/SConstruct b/SConstruct
> index a59a8ea210e..6e034fb968f 100644
> --- a/SConstruct
> +++ b/SConstruct
> @@ -27,6 +27,12 @@ import SCons.Util
>  
>  import common
>  
> +###
> +# Minimal scons version
> +
> +EnsureSConsVersion(2, 4)
> +
> +
>  ###
>  # Configuration options
>  
-- 
Br,

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


Re: [Mesa-dev] [PATCH 6/6] mesa: replace binary constants with hexadecimal constants

2018-08-01 Thread Andres Gomez
On Wed, 2018-08-01 at 16:43 -0400, Ilia Mirkin wrote:
> On Wed, Aug 1, 2018 at 2:53 PM, Andres Gomez  wrote:
> > The binary constant notation "0b" is a GCC extension. Instead, we use
> > hexadecimal notation to fix the MSVC 2013 build:
> > 
> > Compiling src\mesa\main\texcompress_astc.cpp ...
> > texcompress_astc.cpp
> > src\mesa\main\texcompress_astc.cpp(111) : error C2059: syntax error : 'bad 
> > suffix on number'
> > 
> > ...
> > 
> > src\mesa\main\texcompress_astc.cpp(1007) : fatal error C1003: error count 
> > exceeds 100; stopping compilation
> > scons: *** [build\windows-x86-debug\mesa\main\texcompress_astc.obj] Error 2
> > scons: building terminated because of errors.
> > 
> > Fixes: 38ab39f6501 ("mesa: add ASTC 2D LDR decoder")
> > Cc: Marek Olšák 
> > Cc: Brian Paul 
> > Cc: Roland Scheidegger 
> > Cc: Mike Lothian 
> > Cc: Gert Wollny 
> > Cc: Dieter Nützel 
> > Signed-off-by: Andres Gomez 
> > ---
> >  src/mesa/main/texcompress_astc.cpp | 116 ++---
> >  1 file changed, 58 insertions(+), 58 deletions(-)
> > 
> > diff --git a/src/mesa/main/texcompress_astc.cpp 
> > b/src/mesa/main/texcompress_astc.cpp
> > index 996e8ea28d6..ae2733ea333 100644
> > --- a/src/mesa/main/texcompress_astc.cpp
> > +++ b/src/mesa/main/texcompress_astc.cpp
> > @@ -1345,30 +1345,30 @@ void Block::unquantise_colour_endpoints()
> >  D = v >> 1;
> >  break;
> >   case 2:
> > -B = (v & 0b10) ? 0b100010110 : 0b0;
> > +B = (v & 0x2) ? 0x116 : 0x000;
> >  C = 93;
> >  D = v >> 2;
> >  break;
> >   case 3:
> > -t = ((v >> 1) & 0b11);
> > +t = ((v >> 1) & 0x3);
> >  B = t | (t << 2) | (t << 7);
> >  C = 44;
> >  D = v >> 3;
> >  break;
> >   case 4:
> > -t = ((v >> 1) & 0b111);
> > +t = ((v >> 1) & 0x5);
> 
> 0x7

Pffw! ... good catch, Ilia.

Thanks!

-- 
Br,

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


Re: [Mesa-dev] [PATCH 2/2] intel/compiler: Add brw_get_compiler_config_value for disk cache

2018-08-01 Thread Kenneth Graunke
On Wednesday, July 25, 2018 5:12:20 PM PDT Jordan Justen wrote:
> During code review, Jason pointed out that:
> 
> 2b3064c0731 "i965, anv: Use INTEL_DEBUG for disk_cache driver flags"
> 
> Didn't account for INTEL_SCALER_* environment variables.
> 
> To fix this, let the compiler return the disk_cache driver flags.
> 
> Another possible fix would be to pull the INTEL_SCALER_* into
> INTEL_DEBUG bits, but as we are currently using 41 of 64 bits, I
> didn't think it was a good use of 4 more of these bits. (5 since
> INTEL_PRECISE_TRIG needs to be accounted for as well.)
> 
> Cc: Jason Ekstrand 
> Signed-off-by: Jordan Justen 

Series is:
Reviewed-by: Kenneth Graunke 


signature.asc
Description: This is a digitally signed message part.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 2/2] imx: make use of loader_open_name(..)

2018-08-01 Thread Christian Gmeiner
Gets rid of hard-coded gpu device path.

Signed-off-by: Christian Gmeiner 
---
 src/gallium/winsys/imx/drm/imx_drm_winsys.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/winsys/imx/drm/imx_drm_winsys.c 
b/src/gallium/winsys/imx/drm/imx_drm_winsys.c
index cd72610b95..9678a0b8d4 100644
--- a/src/gallium/winsys/imx/drm/imx_drm_winsys.c
+++ b/src/gallium/winsys/imx/drm/imx_drm_winsys.c
@@ -36,7 +36,7 @@ struct pipe_screen *imx_drm_screen_create(int fd)
struct renderonly ro = {
   .create_for_resource = renderonly_create_kms_dumb_buffer_for_resource,
   .kms_fd = fd,
-  .gpu_fd = open("/dev/dri/renderD128", O_RDWR | O_CLOEXEC)
+  .gpu_fd = loader_open_name("etnaviv", DRM_NODE_RENDER)
};
 
if (ro.gpu_fd < 0)
-- 
2.17.1

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


[Mesa-dev] [PATCH 1/2] loader: add loader_open_name(..)

2018-08-01 Thread Christian Gmeiner
Add an improved drmOpenWithType(..) clone which fixes some serious
flaws. Some highlights:
 - using busid works only with PCI devices
 - open() w/o O_CLOEXEC
 - when build w/o udev - it creates a node: mkdir, chown(root), chmod, mknod
 - calls back into Xserver/DDX module
 - last but no least - borderline hacks with massive documentation [1]
   to keep this running.

Signed-off-by: Christian Gmeiner 
---
 src/loader/loader.c | 79 +
 src/loader/loader.h |  3 ++
 2 files changed, 82 insertions(+)

diff --git a/src/loader/loader.c b/src/loader/loader.c
index 43275484cc..c2d2122bb8 100644
--- a/src/loader/loader.c
+++ b/src/loader/loader.c
@@ -82,6 +82,85 @@ loader_open_device(const char *device_name)
return fd;
 }
 
+static int
+open_minor(int minor, int type)
+{
+   const char *dev_name;
+   char buf[64];
+
+   switch (type) {
+   case DRM_NODE_PRIMARY:
+  dev_name = DRM_DEV_NAME;
+  break;
+   case DRM_NODE_CONTROL:
+  dev_name = DRM_CONTROL_DEV_NAME;
+  break;
+   case DRM_NODE_RENDER:
+  dev_name = DRM_RENDER_DEV_NAME;
+  break;
+   default:
+  return -EINVAL;
+   };
+
+   sprintf(buf, dev_name, DRM_DIR_NAME, minor);
+
+   return loader_open_device(buf);
+}
+
+static int minor_base(int type)
+{
+switch (type) {
+case DRM_NODE_PRIMARY:
+return 0;
+case DRM_NODE_CONTROL:
+return 64;
+case DRM_NODE_RENDER:
+return 128;
+default:
+return -1;
+};
+}
+
+int
+loader_open_name(const char *name, int type)
+{
+   int base = minor_base(type);
+   drmVersionPtr version;
+   int i, fd;
+   char *id;
+
+   if (base < 0)
+  return -1;
+
+   /*
+   * Open the first minor number that matches the driver name and isn't
+   * already in use.  If it's in use it will have a busid assigned already.
+   */
+   for (i = base; i < base + DRM_MAX_MINOR; i++) {
+  if ((fd = open_minor(i, type)) >= 0) {
+ if ((version = drmGetVersion(fd))) {
+if (!strcmp(version->name, name)) {
+   drmFreeVersion(version);
+   id = drmGetBusid(fd);
+   drmMsg("drmGetBusid returned '%s'\n", id ? id : "NULL");
+   if (!id || !*id) {
+  if (id)
+ drmFreeBusid(id);
+  return fd;
+   } else {
+  drmFreeBusid(id);
+   }
+} else {
+   drmFreeVersion(version);
+}
+ }
+ close(fd);
+  }
+   }
+
+   return -1;
+}
+
 #if defined(HAVE_LIBDRM)
 #ifdef USE_DRICONF
 static const char __driConfigOptionsLoader[] =
diff --git a/src/loader/loader.h b/src/loader/loader.h
index 3859b45dc4..7e1612301a 100644
--- a/src/loader/loader.h
+++ b/src/loader/loader.h
@@ -38,6 +38,9 @@ extern "C" {
 int
 loader_open_device(const char *);
 
+int
+loader_open_name(const char *name, int type);
+
 int
 loader_get_pci_id_for_fd(int fd, int *vendor_id, int *chip_id);
 
-- 
2.17.1

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


Re: [Mesa-dev] [PATCH v3 1/8] nir: evaluate if condition uses inside the if branches

2018-08-01 Thread Dieter Nützel

Am 01.08.2018 19:53, schrieb Marek Olšák:
On Wed, Aug 1, 2018 at 12:02 PM, Dieter Nützel  
wrote:

Am 01.08.2018 17:53, schrieb Marek Olšák:


On Wed, Aug 1, 2018 at 2:39 AM, Dieter Nützel 
wrote:


Am 01.08.2018 05:56, schrieb Timothy Arceri:



On 01/08/18 13:09, Dieter Nützel wrote:



Am 31.07.2018 13:34, schrieb Timothy Arceri:



On 31/07/18 13:50, Dieter Nützel wrote:



Am 30.07.2018 05:24, schrieb Dieter Nützel:



For the series

Tested-by: Dieter Nützel 

with glmark2, glxgears, UH, UV, Blender 2.79 and FreeCAD 0.17

on RX 580.

With UH I saw some small light blue triangles spreading around.
Have to bisect which patch set was the culprit. (If I have some
time.)
Tried your's above
configure-bump-libdrm-for-AMDGPU-to-2.4.92.mbox (Samuel)
ASTC-texture-compression-for-all-Gallium-drivers.mbox (Marek)

Dieter




It has something to do with tessellation.
If I disable it (F3) all small light blue triangles are _gone_.




Are you able to bisect?




In short, it has _nothing_ to do with _this_ series.
Tested on e6ff5ac446.
So my tb stands.

After some sleep (Nothern Germany is _very_ hot and _dry_ this 
year)

I'll
do my very best... ;-)




hehe. Yes I've experienced a "heat wave" in Northern Europe before,
but some of us have very different definitions of _very_ hot and 
_dry_

:P




With tonight's shower we had only _4_ (really 3, first day was 10 
minutes

with only some drops)
days with rain since last week of April!!!
Our fields and forests need badly water.
We never had such dry spring/early summer/summer for ages.

So back to work.

/opt/mesa> git bisect bad
86b52d42368ac496fe24bc6674e754c323381635 is the first bad commit
commit 86b52d42368ac496fe24bc6674e754c323381635
Author: Marek Olšák 
Date:   Fri Jul 13 00:23:36 2018 -0400

radeonsi: reduce LDS stalls by 40% for tessellation

40% is the decrease in the LGKM counter (which includes SMEM 
too)

for the GFX9 LSHS stage.

This will make the LDS size slightly larger, but I wasn't able 
to

increase
the patch stride without corruption, so I'm increasing the 
vertex

stride.

:04 04 8d457bbd593fe44ca0c7080820f3428f64d5ba19
56feae85455f50d6e5ab7a0285db7319d0601afe M src

Reverting it (on top of master + _this_ series) makes all smooth and
dandy, again - at least on RX580.

Going to bed.



Can you provide more info? Is it only happening with NIR?



Yes, only if I set R600_DEBUG sisched,nir (I'm running sisched all the
time).
Do you need more info?


It could be a bug in sisched.


It seems to be NOT the case.
R600_DEBUG=nir show the corruption. - But much slower...;-)
You can see it 'best' in scene 4 (cannon) and 1.

git revert 86b52d4236
fix it (for NIR with and without sisched)

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


[Mesa-dev] [PATCH 1/2] scons: require scons 2.4 or greater

2018-08-01 Thread Juan A. Suarez Romero
There is a bug with scons 2.3, used in Travis, where it fails to detect
some C functions.
---
 SConstruct | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/SConstruct b/SConstruct
index a59a8ea210e..6e034fb968f 100644
--- a/SConstruct
+++ b/SConstruct
@@ -27,6 +27,12 @@ import SCons.Util
 
 import common
 
+###
+# Minimal scons version
+
+EnsureSConsVersion(2, 4)
+
+
 ###
 # Configuration options
 
-- 
2.17.1

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


Re: [Mesa-dev] [PATCH 2/2] travis: install scons from pip

2018-08-01 Thread Andres Gomez
This is:

Reviewed-by: Andres Gomez 

On Wed, 2018-08-01 at 19:48 +0200, Juan A. Suarez Romero wrote:
> The ubuntu version provided by Travis is a bit old, and does not detect
> correctly some C functions.
> 
> Use a more modern version through scons.
> ---
>  .travis.yml | 8 +---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/.travis.yml b/.travis.yml
> index 8b1730bec69..b0ddbe226cd 100644
> --- a/.travis.yml
> +++ b/.travis.yml
> @@ -400,7 +400,6 @@ matrix:
>addons:
>  apt:
>packages:
> -- scons
>  # Common
>  - xz-utils
>  - x11proto-xf86vidmode-dev
> @@ -419,7 +418,6 @@ matrix:
>addons:
>  apt:
>packages:
> -- scons
>  # LLVM packaging is broken and misses these dependencies
>  - libedit-dev
>  - llvm-3.3-dev
> @@ -445,7 +443,6 @@ matrix:
>sources:
>  - llvm-toolchain-trusty-5.0
>packages:
> -- scons
>  # LLVM packaging is broken and misses these dependencies
>  - libedit-dev
>  # From sources above
> @@ -502,6 +499,11 @@ install:
>pip3 install --user "meson<0.45.0";
>  fi
>  
> +  # Install a more modern scons from pip.
> +  - if test "x$BUILD" = xscons; then
> +  pip2 install --user "scons>=2.4";
> +fi
> +
># Since libdrm gets updated in configure.ac regularly, try to pick up the
># latest version from there.
>- for line in `grep "^LIBDRM.*_REQUIRED=" configure.ac`; do
-- 
Br,

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


[Mesa-dev] [PATCH 1/1] swr: Remove unnecessary memset call

2018-08-01 Thread Vlad Golovkin
Zeroing memory after calloc is not necessary. This also allows to avoid
possible crash when allocation fails, because memset is called before
checking screen for NULL.
---
 src/gallium/drivers/swr/swr_screen.cpp | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/gallium/drivers/swr/swr_screen.cpp 
b/src/gallium/drivers/swr/swr_screen.cpp
index fa232b6838..67085444f8 100644
--- a/src/gallium/drivers/swr/swr_screen.cpp
+++ b/src/gallium/drivers/swr/swr_screen.cpp
@@ -1148,7 +1148,6 @@ struct pipe_screen *
 swr_create_screen_internal(struct sw_winsys *winsys)
 {
struct swr_screen *screen = CALLOC_STRUCT(swr_screen);
-   memset(screen, 0, sizeof(struct swr_screen));
 
if (!screen)
   return NULL;
-- 
2.17.1

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


Re: [Mesa-dev] [PATCH] vc4: Fix automake linking error.

2018-08-01 Thread Juan A. Suarez Romero
On Wed, 2018-08-01 at 18:03 +0300, Andres Gomez wrote:
> This looks good but, unfortunately, it seems to be breaking Travis
> build for the scons targets:
> https://travis-ci.org/Igalia/mesa/jobs/410431266
> 
> Please, Eric, could you try to see a way of solving this. I'm stuck not
>  being able to create the 18.2 branch because of this build regression.
> 

We found the problem, and we are making a patch to fix this.


J.A.

> On Tue, 2018-07-31 at 19:14 +0200, Juan A. Suarez Romero wrote:
> >   CXXLDgallium_dri.la
> > ../../../../src/gallium/drivers/vc4/.libs/libvc4.a(vc4_cl_dump.o): In 
> > function `vc4_dump_cl':
> > src/gallium/drivers/vc4/vc4_cl_dump.c:45: undefined reference to 
> > `clif_dump_init'
> > src/gallium/drivers/vc4/vc4_cl_dump.c:82: undefined reference to 
> > `clif_dump_destroy'
> > ../../../../src/broadcom/cle/.libs/libbroadcom_cle.a(cle_libbroadcom_cle_la-v3d_decoder.o):
> >  In function `v3d_field_iterator_next':
> > src/broadcom/cle/v3d_decoder.c:902: undefined reference to `clif_lookup_bo'
> > 
> > Fixes: e92959c4e0 ("v3d: Pass the whole clif_dump structure to 
> > v3d_print_group().")
> > CC: Eric Anholt 
> > ---
> >  src/gallium/drivers/vc4/Automake.inc | 7 +++
> >  1 file changed, 7 insertions(+)
> > 
> > diff --git a/src/gallium/drivers/vc4/Automake.inc 
> > b/src/gallium/drivers/vc4/Automake.inc
> > index b1aa9726bd6..c9afa2478e9 100644
> > --- a/src/gallium/drivers/vc4/Automake.inc
> > +++ b/src/gallium/drivers/vc4/Automake.inc
> > @@ -7,4 +7,11 @@ TARGET_LIB_DEPS += \
> > $(top_builddir)/src/gallium/drivers/vc4/libvc4.la \
> > $(top_builddir)/src/broadcom/cle/libbroadcom_cle.la
> >  
> > +if !HAVE_GALLIUM_V3D
> > +TARGET_LIB_DEPS += \
> > +   $(top_builddir)/src/broadcom/libbroadcom.la \
> > +   $(top_builddir)/src/broadcom/libbroadcom_v33.la \
> > +   $(top_builddir)/src/broadcom/libbroadcom_v41.la
> > +endif
> > +
> >  endif

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


[Mesa-dev] [PATCH 5/6] ddebug: opt-out non UNIX code

2018-08-01 Thread Andres Gomez
Opt-out the code using mkdir() and getpid() which are spitting
warnings in the MSVC build:

  Compiling src\gallium\auxiliary\driver_ddebug\dd_draw.c ...
dd_draw.c
c:\projects\mesa\src\gallium\auxiliary\driver_ddebug\dd_util.h(62): warning 
C4013: 'mkdir' undefined; assuming extern returning int
c:\projects\mesa\src\gallium\auxiliary\driver_ddebug\dd_util.h(65): warning 
C4013: 'getpid' undefined; assuming extern returning int

Fixes: 6ff0c6f4ebc ("gallium: move ddebug, noop, rbug, trace to auxiliary to 
improve build times")
Cc: Marek Olšák 
Cc: Brian Paul 
Cc: Roland Scheidegger 
Cc: Nicolai Hähnle 
Signed-off-by: Andres Gomez 
---
 src/gallium/auxiliary/driver_ddebug/dd_util.h | 4 
 1 file changed, 4 insertions(+)

diff --git a/src/gallium/auxiliary/driver_ddebug/dd_util.h 
b/src/gallium/auxiliary/driver_ddebug/dd_util.h
index 7720e9af9ca..681627c83cb 100644
--- a/src/gallium/auxiliary/driver_ddebug/dd_util.h
+++ b/src/gallium/auxiliary/driver_ddebug/dd_util.h
@@ -60,11 +60,15 @@ dd_get_debug_filename_and_mkdir(char *buf, size_t buflen, 
bool verbose)
 
util_snprintf(dir, sizeof(dir), "%s/"DD_DIR, debug_get_option("HOME", "."));
 
+#ifdef PIPE_OS_UNIX
if (mkdir(dir, 0774) && errno != EEXIST)
   fprintf(stderr, "dd: can't create a directory (%i)\n", errno);
 
util_snprintf(buf, buflen, "%s/%s_%u_%08u", dir, proc_name, getpid(),
  p_atomic_inc_return() - 1);
+#else
+   fprintf(stderr, "dd: can't create a directory (%i)\n", errno);
+#endif
 
if (verbose)
   fprintf(stderr, "dd: dumping to file %s\n", buf);
-- 
2.18.0

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


[Mesa-dev] [PATCH 0/6] fix the windows build with MSVC 2013

2018-08-01 Thread Andres Gomez
Just a small series of patches to fix the scons windows build with
MSVC 2013.

Detected while running with AppVeyor.

Andres Gomez (6):
  glsl: use util_snprintf()
  gallium/aux/util: use util_snprintf() in test_texture_barrier
  kutil/queue: use util_snprintf() in util_queue_init
  ddebug: use util_snprintf() in dd_get_debug_filename_and_mkdir
  ddebug: opt-out non UNIX code
  mesa: replace binary constants with hexadecimal constants

 .../glsl/ir_builder_print_visitor.cpp |   7 +-
 src/compiler/glsl/ir_print_visitor.cpp|  20 +--
 src/compiler/glsl/link_interface_blocks.cpp   |   5 +-
 src/compiler/glsl/linker.cpp  |   5 +-
 .../glsl/opt_dead_builtin_varyings.cpp|  11 +-
 src/compiler/glsl_types.cpp   |  13 +-
 src/gallium/auxiliary/driver_ddebug/dd_util.h |  11 +-
 src/gallium/auxiliary/util/u_tests.c  |   4 +-
 src/mesa/main/texcompress_astc.cpp| 116 +-
 src/util/u_queue.c|   6 +-
 10 files changed, 105 insertions(+), 93 deletions(-)

-- 
2.18.0

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


Re: [Mesa-dev] [PATCH 1/6] glsl: use util_snprintf()

2018-08-01 Thread Brian Paul

Series looks good.  Thanks for doing this.

Reviewed-by: Brian Paul 


On 08/01/2018 12:53 PM, Andres Gomez wrote:

Instead of plain snprintf(). To fix the MSVC 2013 build.

Fixes: 6ff0c6f4ebc ("gallium: move ddebug, noop, rbug, trace to auxiliary to improve 
build times")
Cc: Marek Olšák 
Cc: Brian Paul 
Cc: Roland Scheidegger 
Signed-off-by: Andres Gomez 
---
  .../glsl/ir_builder_print_visitor.cpp |  7 ---
  src/compiler/glsl/ir_print_visitor.cpp| 20 ++-
  src/compiler/glsl/link_interface_blocks.cpp   |  5 +++--
  src/compiler/glsl/linker.cpp  |  5 +++--
  .../glsl/opt_dead_builtin_varyings.cpp| 11 +-
  src/compiler/glsl_types.cpp   | 13 ++--
  6 files changed, 34 insertions(+), 27 deletions(-)

diff --git a/src/compiler/glsl/ir_builder_print_visitor.cpp 
b/src/compiler/glsl/ir_builder_print_visitor.cpp
index dfe4bb27ac9..da04868652a 100644
--- a/src/compiler/glsl/ir_builder_print_visitor.cpp
+++ b/src/compiler/glsl/ir_builder_print_visitor.cpp
@@ -29,6 +29,7 @@
  #include "glsl_parser_extras.h"
  #include "main/macros.h"
  #include "util/hash_table.h"
+#include "util/u_string.h"
  
  class ir_builder_print_visitor : public ir_hierarchical_visitor {

  public:
@@ -705,9 +706,9 @@ ir_builder_print_visitor::visit_leave(ir_call *ir)
const struct hash_entry *const he =
   _mesa_hash_table_search(index_map, ir->return_deref);
  
-  snprintf(return_deref_string, sizeof(return_deref_string),

-   "operand(r%04X).val",
-   (unsigned)(uintptr_t) he->data);
+  util_snprintf(return_deref_string, sizeof(return_deref_string),
+"operand(r%04X).val",
+(unsigned)(uintptr_t) he->data);
 } else {
strcpy(return_deref_string, "NULL");
 }
diff --git a/src/compiler/glsl/ir_print_visitor.cpp 
b/src/compiler/glsl/ir_print_visitor.cpp
index ea14cdeb6c7..1626657081e 100644
--- a/src/compiler/glsl/ir_print_visitor.cpp
+++ b/src/compiler/glsl/ir_print_visitor.cpp
@@ -27,6 +27,7 @@
  #include "glsl_parser_extras.h"
  #include "main/macros.h"
  #include "util/hash_table.h"
+#include "util/u_string.h"
  
  static void print_type(FILE *f, const glsl_type *t);
  
@@ -167,31 +168,32 @@ void ir_print_visitor::visit(ir_variable *ir)
  
 char binding[32] = {0};

 if (ir->data.binding)
-  snprintf(binding, sizeof(binding), "binding=%i ", ir->data.binding);
+  util_snprintf(binding, sizeof(binding), "binding=%i ", ir->data.binding);
  
 char loc[32] = {0};

 if (ir->data.location != -1)
-  snprintf(loc, sizeof(loc), "location=%i ", ir->data.location);
+  util_snprintf(loc, sizeof(loc), "location=%i ", ir->data.location);
  
 char component[32] = {0};

 if (ir->data.explicit_component || ir->data.location_frac != 0)
-  snprintf(component, sizeof(component), "component=%i ", 
ir->data.location_frac);
+  util_snprintf(component, sizeof(component), "component=%i ",
+ir->data.location_frac);
  
 char stream[32] = {0};

 if (ir->data.stream & (1u << 31)) {
if (ir->data.stream & ~(1u << 31)) {
- snprintf(stream, sizeof(stream), "stream(%u,%u,%u,%u) ",
-  ir->data.stream & 3, (ir->data.stream >> 2) & 3,
-  (ir->data.stream >> 4) & 3, (ir->data.stream >> 6) & 3);
+ util_snprintf(stream, sizeof(stream), "stream(%u,%u,%u,%u) ",
+   ir->data.stream & 3, (ir->data.stream >> 2) & 3,
+   (ir->data.stream >> 4) & 3, (ir->data.stream >> 6) & 3);
}
 } else if (ir->data.stream) {
-  snprintf(stream, sizeof(stream), "stream%u ", ir->data.stream);
+  util_snprintf(stream, sizeof(stream), "stream%u ", ir->data.stream);
 }
  
 char image_format[32] = {0};

 if (ir->data.image_format) {
-  snprintf(image_format, sizeof(image_format), "format=%x ",
-   ir->data.image_format);
+  util_snprintf(image_format, sizeof(image_format), "format=%x ",
+ir->data.image_format);
 }
  
 const char *const cent = (ir->data.centroid) ? "centroid " : "";

diff --git a/src/compiler/glsl/link_interface_blocks.cpp 
b/src/compiler/glsl/link_interface_blocks.cpp
index 7c3037e8975..e5eca9460e3 100644
--- a/src/compiler/glsl/link_interface_blocks.cpp
+++ b/src/compiler/glsl/link_interface_blocks.cpp
@@ -32,6 +32,7 @@
  #include "main/macros.h"
  #include "main/mtypes.h"
  #include "util/hash_table.h"
+#include "util/u_string.h"
  
  
  namespace {

@@ -233,7 +234,7 @@ public:
if (var->data.explicit_location &&
var->data.location >= VARYING_SLOT_VAR0) {
   char location_str[11];
- snprintf(location_str, 11, "%d", var->data.location);
+ util_snprintf(location_str, 11, "%d", var->data.location);
  
   const struct hash_entry *entry =

  _mesa_hash_table_search(ht, location_str);
@@ -259,7 

Re: [Mesa-dev] [PATCH 2/2] ac, radeonsi: reduce optimizations for complex compute shaders on older APUs

2018-08-01 Thread Marek Olšák
On Mon, Jul 23, 2018 at 11:33 PM, Timothy Arceri  wrote:
> On 24/07/18 11:15, Marek Olšák wrote:
>>
>> On Fri, Jul 20, 2018 at 12:53 AM, Dave Airlie  wrote:
>>>
>>> On 20 July 2018 at 13:12, Marek Olšák  wrote:

 From: Marek Olšák 

 To make dEQP-GLES31.functional.ssbo.layout.random.all_shared_buffer.23
 finish sooner on the older CPUs. (otherwise it gets killed and we fail
 the test)
>>>
>>>
>>> I think this is possibly a bad idea, since it's clear LLVM has some
>>> pathalogical
>>> behaviour the AMDGPU backend for this shader and we are just papering
>>> over it.
>>>
>>> A quick dig into LLVM shows horrible misuse of a SmallVector data
>>> structure
>>> for what ends up having 2000 entries in it.
>>>
>>> I'm not going to out right NAK this, but it would be nice to have it
>>> accompanied
>>> by a pointer to an llvm bug against the amdgpu backend for the
>>> pathalogical case.
>>
>>
>> Even if I comment out the push_back call in LLVM, it's still too slow.
>> (the dEQP test times out and fails) LLVMCodeGenLevelLess is faster,
>> but I don't know yet if it's enough for the test.
>
>
> I hard-coded the second buffer block to column_major rather than row_major
> which reduced total run time from 15 -> 9 seconds on my machine. So it seems
> temps would definitely help. Proper packing support would also likely help a
> little more but not as much.

15 -> 9 is not enough. We need to decrease the compile time by 60% or more.

For Dave: Commenting out the "push_back" call in LLVM is also not enough.

Only LLVMCodeGenLevelLess gives the desired improvement (~60%), though
the test is dangerously close to timing out and getting killed.
LLVMCodeGenLevelNone is fastest, but the bytecode is horrible (live
variables between blocks are always spilled).

If there is no straightforward way to improve compile times (I think
there isn't), I'll have to push this.

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


[Mesa-dev] [PATCH 2/2] travis: install scons from pip

2018-08-01 Thread Juan A. Suarez Romero
The ubuntu version provided by Travis is a bit old, and does not detect
correctly some C functions.

Use a more modern version through scons.
---
 .travis.yml | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 8b1730bec69..b0ddbe226cd 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -400,7 +400,6 @@ matrix:
   addons:
 apt:
   packages:
-- scons
 # Common
 - xz-utils
 - x11proto-xf86vidmode-dev
@@ -419,7 +418,6 @@ matrix:
   addons:
 apt:
   packages:
-- scons
 # LLVM packaging is broken and misses these dependencies
 - libedit-dev
 - llvm-3.3-dev
@@ -445,7 +443,6 @@ matrix:
   sources:
 - llvm-toolchain-trusty-5.0
   packages:
-- scons
 # LLVM packaging is broken and misses these dependencies
 - libedit-dev
 # From sources above
@@ -502,6 +499,11 @@ install:
   pip3 install --user "meson<0.45.0";
 fi
 
+  # Install a more modern scons from pip.
+  - if test "x$BUILD" = xscons; then
+  pip2 install --user "scons>=2.4";
+fi
+
   # Since libdrm gets updated in configure.ac regularly, try to pick up the
   # latest version from there.
   - for line in `grep "^LIBDRM.*_REQUIRED=" configure.ac`; do
-- 
2.17.1

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


Re: [Mesa-dev] [PATCH] gallium/swr: Enable support bptc format.

2018-08-01 Thread Denis Pauk
Hi Bruce,

Thank you. Best wishes to Alok.

Could someone also update docs/features.txt with bptc/astc support? Look
like we can mark bptc as done for all gallium software renders and astc_ldr
for all gallium drivers.


Best regards,
  Denis.

On Wed, Aug 1, 2018, 6:14 PM Cherniak, Bruce 
wrote:

>
> On Aug 1, 2018, at 8:10 AM, Denis Pauk  wrote:
>
> Hi Marek,
>
> Could you merge this changes to master? Or someone else with push rights?
>
> Do mesa have some formal rule what amount of commits/contribution required
> for recieve "merge" rights?
>
>
> Hi Denis,
>
> We will push this for you on our next commit.  Alok has just gotten
> married and is out on honeymoon,
> so it may be a little while.  If Marek (or anyone else) would like to get
> to it sooner, that would be
> great.
>
> Thanks,
> Bruce
>
>
> On Sat, Jul 28, 2018 at 11:03 PM Denis Pauk  wrote:
>
>> Hi Bruce,
>>
>> Thank you, could you please merge commits? (I don't have commit rights.)
>>
>> On Fri, Jul 27, 2018 at 11:02 PM Cherniak, Bruce <
>> bruce.chern...@intel.com> wrote:
>>
>>> Reviewed-by: Bruce Cherniak 
>>>
>>> > On Jul 27, 2018, at 1:45 PM, Denis Pauk  wrote:
>>> >
>>> > Reuse Code from:
>>> > f69bc797e1 gallium/auxiliary: Add helper support for bptc format
>>> compress/decompress
>>> >
>>> > Signed-off-by: Denis Pauk 
>>> > CC: Marek Olšák 
>>> > CC: Bruce Cherniak 
>>> > CC: Tim Rowley 
>>> > ---
>>> > src/gallium/drivers/swr/swr_screen.cpp | 3 +--
>>> > 1 file changed, 1 insertion(+), 2 deletions(-)
>>> >
>>> > diff --git a/src/gallium/drivers/swr/swr_screen.cpp
>>> b/src/gallium/drivers/swr/swr_screen.cpp
>>> > index 65fa1bc50e..1cc01aa47d 100644
>>> > --- a/src/gallium/drivers/swr/swr_screen.cpp
>>> > +++ b/src/gallium/drivers/swr/swr_screen.cpp
>>> > @@ -137,8 +137,7 @@ swr_is_format_supported(struct pipe_screen
>>> *_screen,
>>> >  return FALSE;
>>> >}
>>> >
>>> > -   if (format_desc->layout == UTIL_FORMAT_LAYOUT_BPTC ||
>>> > -   format_desc->layout == UTIL_FORMAT_LAYOUT_ASTC) {
>>> > +   if (format_desc->layout == UTIL_FORMAT_LAYOUT_ASTC) {
>>> >   return FALSE;
>>> >}
>>> >
>>> > --
>>> > 2.18.0
>>> >
>>>
>>>
>>
>> --
>> Best regards,
>>   Denis.
>>
>
>
> --
> Best regards,
>   Denis.
>
>
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH v3 1/8] nir: evaluate if condition uses inside the if branches

2018-08-01 Thread Marek Olšák
On Wed, Aug 1, 2018 at 12:02 PM, Dieter Nützel  wrote:
> Am 01.08.2018 17:53, schrieb Marek Olšák:
>>
>> On Wed, Aug 1, 2018 at 2:39 AM, Dieter Nützel 
>> wrote:
>>>
>>> Am 01.08.2018 05:56, schrieb Timothy Arceri:


 On 01/08/18 13:09, Dieter Nützel wrote:
>
>
> Am 31.07.2018 13:34, schrieb Timothy Arceri:
>>
>>
>> On 31/07/18 13:50, Dieter Nützel wrote:
>>>
>>>
>>> Am 30.07.2018 05:24, schrieb Dieter Nützel:


 For the series

 Tested-by: Dieter Nützel 

 with glmark2, glxgears, UH, UV, Blender 2.79 and FreeCAD 0.17

 on RX 580.

 With UH I saw some small light blue triangles spreading around.
 Have to bisect which patch set was the culprit. (If I have some
 time.)
 Tried your's above
 configure-bump-libdrm-for-AMDGPU-to-2.4.92.mbox (Samuel)
 ASTC-texture-compression-for-all-Gallium-drivers.mbox (Marek)

 Dieter
>>>
>>>
>>>
>>> It has something to do with tessellation.
>>> If I disable it (F3) all small light blue triangles are _gone_.
>>
>>
>>
>> Are you able to bisect?
>
>
>
> In short, it has _nothing_ to do with _this_ series.
> Tested on e6ff5ac446.
> So my tb stands.
>
> After some sleep (Nothern Germany is _very_ hot and _dry_ this year)
> I'll
> do my very best... ;-)



 hehe. Yes I've experienced a "heat wave" in Northern Europe before,
 but some of us have very different definitions of _very_ hot and _dry_
 :P
>>>
>>>
>>>
>>> With tonight's shower we had only _4_ (really 3, first day was 10 minutes
>>> with only some drops)
>>> days with rain since last week of April!!!
>>> Our fields and forests need badly water.
>>> We never had such dry spring/early summer/summer for ages.
>>>
>>> So back to work.
>>>
>>> /opt/mesa> git bisect bad
>>> 86b52d42368ac496fe24bc6674e754c323381635 is the first bad commit
>>> commit 86b52d42368ac496fe24bc6674e754c323381635
>>> Author: Marek Olšák 
>>> Date:   Fri Jul 13 00:23:36 2018 -0400
>>>
>>> radeonsi: reduce LDS stalls by 40% for tessellation
>>>
>>> 40% is the decrease in the LGKM counter (which includes SMEM too)
>>> for the GFX9 LSHS stage.
>>>
>>> This will make the LDS size slightly larger, but I wasn't able to
>>> increase
>>> the patch stride without corruption, so I'm increasing the vertex
>>> stride.
>>>
>>> :04 04 8d457bbd593fe44ca0c7080820f3428f64d5ba19
>>> 56feae85455f50d6e5ab7a0285db7319d0601afe M src
>>>
>>> Reverting it (on top of master + _this_ series) makes all smooth and
>>> dandy, again - at least on RX580.
>>>
>>> Going to bed.
>>
>>
>> Can you provide more info? Is it only happening with NIR?
>
>
> Yes, only if I set R600_DEBUG sisched,nir (I'm running sisched all the
> time).
> Do you need more info?

It could be a bug in sisched.

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


[Mesa-dev] [PATCH 1/1] swr: Remove unnecessary memset call

2018-08-01 Thread Vlad Golovkin
Zeroing memory after calloc is not necessary. This also allows to avoid
possible crash when allocation fails, because memset is called before
checking screen for NULL.
---
 src/gallium/drivers/swr/swr_screen.cpp | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/gallium/drivers/swr/swr_screen.cpp 
b/src/gallium/drivers/swr/swr_screen.cpp
index fa232b6838..67085444f8 100644
--- a/src/gallium/drivers/swr/swr_screen.cpp
+++ b/src/gallium/drivers/swr/swr_screen.cpp
@@ -1148,7 +1148,6 @@ struct pipe_screen *
 swr_create_screen_internal(struct sw_winsys *winsys)
 {
struct swr_screen *screen = CALLOC_STRUCT(swr_screen);
-   memset(screen, 0, sizeof(struct swr_screen));
 
if (!screen)
   return NULL;
-- 
2.17.1

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


[Mesa-dev] [PATCH 1/6] glsl: use util_snprintf()

2018-08-01 Thread Andres Gomez
Instead of plain snprintf(). To fix the MSVC 2013 build.

Fixes: 6ff0c6f4ebc ("gallium: move ddebug, noop, rbug, trace to auxiliary to 
improve build times")
Cc: Marek Olšák 
Cc: Brian Paul 
Cc: Roland Scheidegger 
Signed-off-by: Andres Gomez 
---
 .../glsl/ir_builder_print_visitor.cpp |  7 ---
 src/compiler/glsl/ir_print_visitor.cpp| 20 ++-
 src/compiler/glsl/link_interface_blocks.cpp   |  5 +++--
 src/compiler/glsl/linker.cpp  |  5 +++--
 .../glsl/opt_dead_builtin_varyings.cpp| 11 +-
 src/compiler/glsl_types.cpp   | 13 ++--
 6 files changed, 34 insertions(+), 27 deletions(-)

diff --git a/src/compiler/glsl/ir_builder_print_visitor.cpp 
b/src/compiler/glsl/ir_builder_print_visitor.cpp
index dfe4bb27ac9..da04868652a 100644
--- a/src/compiler/glsl/ir_builder_print_visitor.cpp
+++ b/src/compiler/glsl/ir_builder_print_visitor.cpp
@@ -29,6 +29,7 @@
 #include "glsl_parser_extras.h"
 #include "main/macros.h"
 #include "util/hash_table.h"
+#include "util/u_string.h"
 
 class ir_builder_print_visitor : public ir_hierarchical_visitor {
 public:
@@ -705,9 +706,9 @@ ir_builder_print_visitor::visit_leave(ir_call *ir)
   const struct hash_entry *const he =
  _mesa_hash_table_search(index_map, ir->return_deref);
 
-  snprintf(return_deref_string, sizeof(return_deref_string),
-   "operand(r%04X).val",
-   (unsigned)(uintptr_t) he->data);
+  util_snprintf(return_deref_string, sizeof(return_deref_string),
+"operand(r%04X).val",
+(unsigned)(uintptr_t) he->data);
} else {
   strcpy(return_deref_string, "NULL");
}
diff --git a/src/compiler/glsl/ir_print_visitor.cpp 
b/src/compiler/glsl/ir_print_visitor.cpp
index ea14cdeb6c7..1626657081e 100644
--- a/src/compiler/glsl/ir_print_visitor.cpp
+++ b/src/compiler/glsl/ir_print_visitor.cpp
@@ -27,6 +27,7 @@
 #include "glsl_parser_extras.h"
 #include "main/macros.h"
 #include "util/hash_table.h"
+#include "util/u_string.h"
 
 static void print_type(FILE *f, const glsl_type *t);
 
@@ -167,31 +168,32 @@ void ir_print_visitor::visit(ir_variable *ir)
 
char binding[32] = {0};
if (ir->data.binding)
-  snprintf(binding, sizeof(binding), "binding=%i ", ir->data.binding);
+  util_snprintf(binding, sizeof(binding), "binding=%i ", ir->data.binding);
 
char loc[32] = {0};
if (ir->data.location != -1)
-  snprintf(loc, sizeof(loc), "location=%i ", ir->data.location);
+  util_snprintf(loc, sizeof(loc), "location=%i ", ir->data.location);
 
char component[32] = {0};
if (ir->data.explicit_component || ir->data.location_frac != 0)
-  snprintf(component, sizeof(component), "component=%i ", 
ir->data.location_frac);
+  util_snprintf(component, sizeof(component), "component=%i ",
+ir->data.location_frac);
 
char stream[32] = {0};
if (ir->data.stream & (1u << 31)) {
   if (ir->data.stream & ~(1u << 31)) {
- snprintf(stream, sizeof(stream), "stream(%u,%u,%u,%u) ",
-  ir->data.stream & 3, (ir->data.stream >> 2) & 3,
-  (ir->data.stream >> 4) & 3, (ir->data.stream >> 6) & 3);
+ util_snprintf(stream, sizeof(stream), "stream(%u,%u,%u,%u) ",
+   ir->data.stream & 3, (ir->data.stream >> 2) & 3,
+   (ir->data.stream >> 4) & 3, (ir->data.stream >> 6) & 3);
   }
} else if (ir->data.stream) {
-  snprintf(stream, sizeof(stream), "stream%u ", ir->data.stream);
+  util_snprintf(stream, sizeof(stream), "stream%u ", ir->data.stream);
}
 
char image_format[32] = {0};
if (ir->data.image_format) {
-  snprintf(image_format, sizeof(image_format), "format=%x ",
-   ir->data.image_format);
+  util_snprintf(image_format, sizeof(image_format), "format=%x ",
+ir->data.image_format);
}
 
const char *const cent = (ir->data.centroid) ? "centroid " : "";
diff --git a/src/compiler/glsl/link_interface_blocks.cpp 
b/src/compiler/glsl/link_interface_blocks.cpp
index 7c3037e8975..e5eca9460e3 100644
--- a/src/compiler/glsl/link_interface_blocks.cpp
+++ b/src/compiler/glsl/link_interface_blocks.cpp
@@ -32,6 +32,7 @@
 #include "main/macros.h"
 #include "main/mtypes.h"
 #include "util/hash_table.h"
+#include "util/u_string.h"
 
 
 namespace {
@@ -233,7 +234,7 @@ public:
   if (var->data.explicit_location &&
   var->data.location >= VARYING_SLOT_VAR0) {
  char location_str[11];
- snprintf(location_str, 11, "%d", var->data.location);
+ util_snprintf(location_str, 11, "%d", var->data.location);
 
  const struct hash_entry *entry =
 _mesa_hash_table_search(ht, location_str);
@@ -259,7 +260,7 @@ public:
   * unsigned location value which is overkill but future proof.
   */
  char location_str[11];
- snprintf(location_str, 11, "%d", 

Re: [Mesa-dev] [PATCH 2/2] ac, radeonsi: reduce optimizations for complex compute shaders on older APUs

2018-08-01 Thread Dave Airlie
Sounds like a major project for someone to fix llvm, doesn't AMD have
compiled devs?

Acked-by: Dave Airlie 

Dave.

On Thu., 2 Aug. 2018, 04:43 Marek Olšák,  wrote:

> On Mon, Jul 23, 2018 at 11:33 PM, Timothy Arceri 
> wrote:
> > On 24/07/18 11:15, Marek Olšák wrote:
> >>
> >> On Fri, Jul 20, 2018 at 12:53 AM, Dave Airlie 
> wrote:
> >>>
> >>> On 20 July 2018 at 13:12, Marek Olšák  wrote:
> 
>  From: Marek Olšák 
> 
>  To make dEQP-GLES31.functional.ssbo.layout.random.all_shared_buffer.23
>  finish sooner on the older CPUs. (otherwise it gets killed and we fail
>  the test)
> >>>
> >>>
> >>> I think this is possibly a bad idea, since it's clear LLVM has some
> >>> pathalogical
> >>> behaviour the AMDGPU backend for this shader and we are just papering
> >>> over it.
> >>>
> >>> A quick dig into LLVM shows horrible misuse of a SmallVector data
> >>> structure
> >>> for what ends up having 2000 entries in it.
> >>>
> >>> I'm not going to out right NAK this, but it would be nice to have it
> >>> accompanied
> >>> by a pointer to an llvm bug against the amdgpu backend for the
> >>> pathalogical case.
> >>
> >>
> >> Even if I comment out the push_back call in LLVM, it's still too slow.
> >> (the dEQP test times out and fails) LLVMCodeGenLevelLess is faster,
> >> but I don't know yet if it's enough for the test.
> >
> >
> > I hard-coded the second buffer block to column_major rather than
> row_major
> > which reduced total run time from 15 -> 9 seconds on my machine. So it
> seems
> > temps would definitely help. Proper packing support would also likely
> help a
> > little more but not as much.
>
> 15 -> 9 is not enough. We need to decrease the compile time by 60% or more.
>
> For Dave: Commenting out the "push_back" call in LLVM is also not enough.
>
> Only LLVMCodeGenLevelLess gives the desired improvement (~60%), though
> the test is dangerously close to timing out and getting killed.
> LLVMCodeGenLevelNone is fastest, but the bytecode is horrible (live
> variables between blocks are always spilled).
>
> If there is no straightforward way to improve compile times (I think
> there isn't), I'll have to push this.
>
> Marek
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 2/6] gallium/aux/util: use util_snprintf() in test_texture_barrier

2018-08-01 Thread Andres Gomez
Instead of plain snprintf(). To fix the MSVC 2013 build:

  Compiling src\gallium\auxiliary\util\u_tests.c ...
u_tests.c
src\gallium\auxiliary\util\u_tests.c(624) : warning C4013: 'snprintf' 
undefined; assuming extern returning int

...

gallium.lib(u_tests.obj) : error LNK2019: unresolved external symbol _snprintf 
referenced in function _test_texture_barrier
build\windows-x86-debug\gallium\targets\graw-gdi\graw.dll : fatal error 
LNK1120: 1 unresolved externals
scons: *** [build\windows-x86-debug\gallium\targets\graw-gdi\graw.dll] Error 
1120
scons: building terminated because of errors.

Fixes: 56342c97ee7 ("gallium/u_tests: test FBFETCH and shader-based blending 
with MSAA")
Cc: Marek Olšák 
Cc: Brian Paul 
Cc: Roland Scheidegger 
Cc: Dieter Nützel 
Signed-off-by: Andres Gomez 
---
 src/gallium/auxiliary/util/u_tests.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_tests.c 
b/src/gallium/auxiliary/util/u_tests.c
index f8c001813c1..7360eb97639 100644
--- a/src/gallium/auxiliary/util/u_tests.c
+++ b/src/gallium/auxiliary/util/u_tests.c
@@ -622,8 +622,8 @@ test_texture_barrier(struct pipe_context *ctx, bool 
use_fbfetch,
 
assert(num_samples >= 1 && num_samples <= 8);
 
-   snprintf(name, sizeof(name), "%s: %s, %u samples", __func__,
-use_fbfetch ? "FBFETCH" : "sampler", MAX2(num_samples, 1));
+   util_snprintf(name, sizeof(name), "%s: %s, %u samples", __func__,
+ use_fbfetch ? "FBFETCH" : "sampler", MAX2(num_samples, 1));
 
if (!ctx->screen->get_param(ctx->screen, PIPE_CAP_TEXTURE_BARRIER)) {
   util_report_result_helper(SKIP, name);
-- 
2.18.0

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


[Mesa-dev] [PATCH 6/6] mesa: replace binary constants with hexadecimal constants

2018-08-01 Thread Andres Gomez
The binary constant notation "0b" is a GCC extension. Instead, we use
hexadecimal notation to fix the MSVC 2013 build:

Compiling src\mesa\main\texcompress_astc.cpp ...
texcompress_astc.cpp
src\mesa\main\texcompress_astc.cpp(111) : error C2059: syntax error : 'bad 
suffix on number'

...

src\mesa\main\texcompress_astc.cpp(1007) : fatal error C1003: error count 
exceeds 100; stopping compilation
scons: *** [build\windows-x86-debug\mesa\main\texcompress_astc.obj] Error 2
scons: building terminated because of errors.

Fixes: 38ab39f6501 ("mesa: add ASTC 2D LDR decoder")
Cc: Marek Olšák 
Cc: Brian Paul 
Cc: Roland Scheidegger 
Cc: Mike Lothian 
Cc: Gert Wollny 
Cc: Dieter Nützel 
Signed-off-by: Andres Gomez 
---
 src/mesa/main/texcompress_astc.cpp | 116 ++---
 1 file changed, 58 insertions(+), 58 deletions(-)

diff --git a/src/mesa/main/texcompress_astc.cpp 
b/src/mesa/main/texcompress_astc.cpp
index 996e8ea28d6..ae2733ea333 100644
--- a/src/mesa/main/texcompress_astc.cpp
+++ b/src/mesa/main/texcompress_astc.cpp
@@ -108,14 +108,14 @@ static void unpack_trit_block(int n, T in, uint8_t *out)
 {
assert(n <= 6); /* else output will overflow uint8_t */
 
-   uint8_t T0 = (in >> (n)) & 0b1;
-   uint8_t T1 = (in >> (n+1)) & 0b1;
-   uint8_t T2 = (in >> (2*n+2)) & 0b1;
-   uint8_t T3 = (in >> (2*n+3)) & 0b1;
-   uint8_t T4 = (in >> (3*n+4)) & 0b1;
-   uint8_t T5 = (in >> (4*n+5)) & 0b1;
-   uint8_t T6 = (in >> (4*n+6)) & 0b1;
-   uint8_t T7 = (in >> (5*n+7)) & 0b1;
+   uint8_t T0 = (in >> (n)) & 0x1;
+   uint8_t T1 = (in >> (n+1)) & 0x1;
+   uint8_t T2 = (in >> (2*n+2)) & 0x1;
+   uint8_t T3 = (in >> (2*n+3)) & 0x1;
+   uint8_t T4 = (in >> (3*n+4)) & 0x1;
+   uint8_t T5 = (in >> (4*n+5)) & 0x1;
+   uint8_t T6 = (in >> (4*n+6)) & 0x1;
+   uint8_t T7 = (in >> (5*n+7)) & 0x1;
uint8_t mmask = (1 << n) - 1;
uint8_t m0 = (in >> (0)) & mmask;
uint8_t m1 = (in >> (n+2)) & mmask;
@@ -125,12 +125,12 @@ static void unpack_trit_block(int n, T in, uint8_t *out)
 
uint8_t C;
uint8_t t4, t3, t2, t1, t0;
-   if (CAT_BITS_3(T4, T3, T2) == 0b111) {
+   if (CAT_BITS_3(T4, T3, T2) == 0x7) {
   C = CAT_BITS_5(T7, T6, T5, T1, T0);
   t4 = t3 = 2;
} else {
   C = CAT_BITS_5(T4, T3, T2, T1, T0);
-  if (CAT_BITS_2(T6, T5) == 0b11) {
+  if (CAT_BITS_2(T6, T5) == 0x3) {
  t4 = 2;
  t3 = T7;
   } else {
@@ -139,21 +139,21 @@ static void unpack_trit_block(int n, T in, uint8_t *out)
   }
}
 
-   if ((C & 0b11) == 0b11) {
+   if ((C & 0x3) == 0x3) {
   t2 = 2;
-  t1 = (C >> 4) & 0b1;
-  uint8_t C3 = (C >> 3) & 0b1;
-  uint8_t C2 = (C >> 2) & 0b1;
+  t1 = (C >> 4) & 0x1;
+  uint8_t C3 = (C >> 3) & 0x1;
+  uint8_t C2 = (C >> 2) & 0x1;
   t0 = (C3 << 1) | (C2 & ~C3);
-   } else if (((C >> 2) & 0b11) == 0b11) {
+   } else if (((C >> 2) & 0x3) == 0x3) {
   t2 = 2;
   t1 = 2;
-  t0 = C & 0b11;
+  t0 = C & 0x3;
} else {
-  t2 = (C >> 4) & 0b1;
-  t1 = (C >> 2) & 0b11;
-  uint8_t C1 = (C >> 1) & 0b1;
-  uint8_t C0 = (C >> 0) & 0b1;
+  t2 = (C >> 4) & 0x1;
+  t1 = (C >> 2) & 0x3;
+  uint8_t C1 = (C >> 1) & 0x1;
+  uint8_t C0 = (C >> 0) & 0x1;
   t0 = (C1 << 1) | (C0 & ~C1);
}
 
@@ -171,13 +171,13 @@ static void unpack_quint_block(int n, uint32_t in, 
uint8_t *out)
 {
assert(n <= 5); /* else output will overflow uint8_t */
 
-   uint8_t Q0 = (in >> (n)) & 0b1;
-   uint8_t Q1 = (in >> (n+1)) & 0b1;
-   uint8_t Q2 = (in >> (n+2)) & 0b1;
-   uint8_t Q3 = (in >> (2*n+3)) & 0b1;
-   uint8_t Q4 = (in >> (2*n+4)) & 0b1;
-   uint8_t Q5 = (in >> (3*n+5)) & 0b1;
-   uint8_t Q6 = (in >> (3*n+6)) & 0b1;
+   uint8_t Q0 = (in >> (n)) & 0x1;
+   uint8_t Q1 = (in >> (n+1)) & 0x1;
+   uint8_t Q2 = (in >> (n+2)) & 0x1;
+   uint8_t Q3 = (in >> (2*n+3)) & 0x1;
+   uint8_t Q4 = (in >> (2*n+4)) & 0x1;
+   uint8_t Q5 = (in >> (3*n+5)) & 0x1;
+   uint8_t Q6 = (in >> (3*n+6)) & 0x1;
uint8_t mmask = (1 << n) - 1;
uint8_t m0 = (in >> (0)) & mmask;
uint8_t m1 = (in >> (n+3)) & mmask;
@@ -185,24 +185,24 @@ static void unpack_quint_block(int n, uint32_t in, 
uint8_t *out)
 
uint8_t C;
uint8_t q2, q1, q0;
-   if (CAT_BITS_4(Q6, Q5, Q2, Q1) == 0b0011) {
+   if (CAT_BITS_4(Q6, Q5, Q2, Q1) == 0x3) {
   q2 = CAT_BITS_3(Q0, Q4 & ~Q0, Q3 & ~Q0);
   q1 = 4;
   q0 = 4;
} else {
-  if (CAT_BITS_2(Q2, Q1) == 0b11) {
+  if (CAT_BITS_2(Q2, Q1) == 0x3) {
  q2 = 4;
- C = CAT_BITS_5(Q4, Q3, 0b1 & ~Q6, 0b1 & ~Q5, Q0);
+ C = CAT_BITS_5(Q4, Q3, 0x1 & ~Q6, 0x1 & ~Q5, Q0);
   } else {
  q2 = CAT_BITS_2(Q6, Q5);
  C = CAT_BITS_5(Q4, Q3, Q2, Q1, Q0);
   }
-  if ((C & 0b111) == 0b101) {
+  if ((C & 0x7) == 0x5) {
  q1 = 4;
- q0 = (C >> 3) & 0b11;
+ q0 = (C >> 3) & 0x3;
   } else {
- q1 = (C >> 3) & 0b11;
- q0 = C & 0b111;
+ q1 = (C >> 3) & 0x3;
+ q0 = C & 0x7;

Re: [Mesa-dev] [PATCH v3 1/8] nir: evaluate if condition uses inside the if branches

2018-08-01 Thread Dieter Nützel

Am 01.08.2018 17:53, schrieb Marek Olšák:
On Wed, Aug 1, 2018 at 2:39 AM, Dieter Nützel  
wrote:

Am 01.08.2018 05:56, schrieb Timothy Arceri:


On 01/08/18 13:09, Dieter Nützel wrote:


Am 31.07.2018 13:34, schrieb Timothy Arceri:


On 31/07/18 13:50, Dieter Nützel wrote:


Am 30.07.2018 05:24, schrieb Dieter Nützel:


For the series

Tested-by: Dieter Nützel 

with glmark2, glxgears, UH, UV, Blender 2.79 and FreeCAD 0.17

on RX 580.

With UH I saw some small light blue triangles spreading around.
Have to bisect which patch set was the culprit. (If I have some 
time.)

Tried your's above
configure-bump-libdrm-for-AMDGPU-to-2.4.92.mbox (Samuel)
ASTC-texture-compression-for-all-Gallium-drivers.mbox (Marek)

Dieter



It has something to do with tessellation.
If I disable it (F3) all small light blue triangles are _gone_.



Are you able to bisect?



In short, it has _nothing_ to do with _this_ series.
Tested on e6ff5ac446.
So my tb stands.

After some sleep (Nothern Germany is _very_ hot and _dry_ this year) 
I'll

do my very best... ;-)



hehe. Yes I've experienced a "heat wave" in Northern Europe before,
but some of us have very different definitions of _very_ hot and 
_dry_

:P



With tonight's shower we had only _4_ (really 3, first day was 10 
minutes

with only some drops)
days with rain since last week of April!!!
Our fields and forests need badly water.
We never had such dry spring/early summer/summer for ages.

So back to work.

/opt/mesa> git bisect bad
86b52d42368ac496fe24bc6674e754c323381635 is the first bad commit
commit 86b52d42368ac496fe24bc6674e754c323381635
Author: Marek Olšák 
Date:   Fri Jul 13 00:23:36 2018 -0400

radeonsi: reduce LDS stalls by 40% for tessellation

40% is the decrease in the LGKM counter (which includes SMEM too)
for the GFX9 LSHS stage.

This will make the LDS size slightly larger, but I wasn't able to
increase
the patch stride without corruption, so I'm increasing the vertex
stride.

:04 04 8d457bbd593fe44ca0c7080820f3428f64d5ba19
56feae85455f50d6e5ab7a0285db7319d0601afe M src

Reverting it (on top of master + _this_ series) makes all smooth and
dandy, again - at least on RX580.

Going to bed.


Can you provide more info? Is it only happening with NIR?


Yes, only if I set R600_DEBUG sisched,nir (I'm running sisched all the 
time).

Do you need more info?

Greetings,

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


Re: [Mesa-dev] [PATCH] nir: Add a couple of iand/ior optimizations

2018-08-01 Thread Ian Romanick
On 07/23/2018 07:10 AM, Jason Ekstrand wrote:
> On Mon, Jul 23, 2018 at 1:08 AM Timothy Arceri  > wrote:
> 
> Ian and I have been looking at these type of things recently. Ian has
> started work on a pass to cover this stuff without having to add dozens
> of these types of opts.
> 
> https://lists.freedesktop.org/archives/mesa-dev/2018-July/200583.html
> 
> 
> Does said pass work only on logical operations with booleans or also
> regular bitwise operations?  This patch is for bitwise operations though
> it naturally works with booleans.

Currently I'm only tackling Booleans, but I have plans to eventually
extend it to regular bitwise operations.

A bunch of these kinds of algebraic optimizations will "fight" with the
new pass leading to infinite optimization loops.  I'll probably have to
add some sort of @nonbool tag to a bunch of these.  I've still got 99
problems, and this isn't in the top 10. :(

> --Jason
>  
> 
> On 23/07/18 17:36, Jason Ekstrand wrote:
> > Spotted in a shader in Batman: Arkham City.
> > ---
> >   src/compiler/nir/nir_opt_algebraic.py | 2 ++
> >   1 file changed, 2 insertions(+)
> >
> > diff --git a/src/compiler/nir/nir_opt_algebraic.py
> b/src/compiler/nir/nir_opt_algebraic.py
> > index ba277fdfd0e..f2007852b21 100644
> > --- a/src/compiler/nir/nir_opt_algebraic.py
> > +++ b/src/compiler/nir/nir_opt_algebraic.py
> > @@ -377,6 +377,8 @@ optimizations = [
> >      (('ixor', a, a), 0),
> >      (('ixor', a, 0), a),
> >      (('inot', ('inot', a)), a),
> > +   (('ior', ('iand', a, b), b), b),
> > +   (('iand', ('ior', a, b), b), b),
> >      # DeMorgan's Laws
> >      (('iand', ('inot', a), ('inot', b)), ('inot', ('ior',  a, b))),
> >      (('ior',  ('inot', a), ('inot', b)), ('inot', ('iand', a, b))),
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 1/2] mesa: add switch case for GL 2.1 in _mesa_compute_version()

2018-08-01 Thread Ian Romanick
On 07/27/2018 12:07 PM, Brian Paul wrote:
> The xlib/swrast driver only supports GL 2.1.  This patch fixes a
> crash if the app calls glGetString(GL_SHADING_LANGUAGE_VERSION).
> ---
>  src/mesa/main/version.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/src/mesa/main/version.c b/src/mesa/main/version.c
> index 58e68b4..2c5bd77 100644
> --- a/src/mesa/main/version.c
> +++ b/src/mesa/main/version.c
> @@ -617,6 +617,9 @@ _mesa_compute_version(struct gl_context *ctx)
>  */
> if (_mesa_is_desktop_gl(ctx)) {
>switch (ctx->Version) {
> +  case 21:
> + ctx->Const.GLSLVersion = 120;
> + break;

GLSL 1.20 is the minimum version supported by Mesa, so I thought we set
120 when initializing ctx->Const.  What happens if a driver only
supports OpenGL 2.0?

>case 30:
>   ctx->Const.GLSLVersion = 130;
>   break;
> 

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


Re: [Mesa-dev] [PATCH 2/2] ac, radeonsi: reduce optimizations for complex compute shaders on older APUs

2018-08-01 Thread Marek Olšák
On Wed, Aug 1, 2018 at 3:20 PM, Dave Airlie  wrote:
> Sounds like a major project for someone to fix llvm, doesn't AMD have
> compiled devs?

Yes, but they are from entirely different teams.

Marek

>
> Acked-by: Dave Airlie 
>
> Dave.
>
> On Thu., 2 Aug. 2018, 04:43 Marek Olšák,  wrote:
>>
>> On Mon, Jul 23, 2018 at 11:33 PM, Timothy Arceri 
>> wrote:
>> > On 24/07/18 11:15, Marek Olšák wrote:
>> >>
>> >> On Fri, Jul 20, 2018 at 12:53 AM, Dave Airlie 
>> >> wrote:
>> >>>
>> >>> On 20 July 2018 at 13:12, Marek Olšák  wrote:
>> 
>>  From: Marek Olšák 
>> 
>>  To make
>>  dEQP-GLES31.functional.ssbo.layout.random.all_shared_buffer.23
>>  finish sooner on the older CPUs. (otherwise it gets killed and we
>>  fail
>>  the test)
>> >>>
>> >>>
>> >>> I think this is possibly a bad idea, since it's clear LLVM has some
>> >>> pathalogical
>> >>> behaviour the AMDGPU backend for this shader and we are just papering
>> >>> over it.
>> >>>
>> >>> A quick dig into LLVM shows horrible misuse of a SmallVector data
>> >>> structure
>> >>> for what ends up having 2000 entries in it.
>> >>>
>> >>> I'm not going to out right NAK this, but it would be nice to have it
>> >>> accompanied
>> >>> by a pointer to an llvm bug against the amdgpu backend for the
>> >>> pathalogical case.
>> >>
>> >>
>> >> Even if I comment out the push_back call in LLVM, it's still too slow.
>> >> (the dEQP test times out and fails) LLVMCodeGenLevelLess is faster,
>> >> but I don't know yet if it's enough for the test.
>> >
>> >
>> > I hard-coded the second buffer block to column_major rather than
>> > row_major
>> > which reduced total run time from 15 -> 9 seconds on my machine. So it
>> > seems
>> > temps would definitely help. Proper packing support would also likely
>> > help a
>> > little more but not as much.
>>
>> 15 -> 9 is not enough. We need to decrease the compile time by 60% or
>> more.
>>
>> For Dave: Commenting out the "push_back" call in LLVM is also not enough.
>>
>> Only LLVMCodeGenLevelLess gives the desired improvement (~60%), though
>> the test is dangerously close to timing out and getting killed.
>> LLVMCodeGenLevelNone is fastest, but the bytecode is horrible (live
>> variables between blocks are always spilled).
>>
>> If there is no straightforward way to improve compile times (I think
>> there isn't), I'll have to push this.
>>
>> Marek
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 0/1] swr: Remove unnecessary memset call

2018-08-01 Thread Vlad Golovkin
This patch is identical to the previous one, but that time I forgot to
mention that I didn't have commit rights, so I am sending the rebased
patch for the review.

Vlad Golovkin (1):
  swr: Remove unnecessary memset call

 src/gallium/drivers/swr/swr_screen.cpp | 1 -
 1 file changed, 1 deletion(-)

-- 
2.17.1

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


Re: [Mesa-dev] [PATCH] gallium/swr: Enable support bptc format.

2018-08-01 Thread Cherniak, Bruce

On Aug 1, 2018, at 8:10 AM, Denis Pauk 
mailto:pauk.de...@gmail.com>> wrote:

Hi Marek,

Could you merge this changes to master? Or someone else with push rights?

Do mesa have some formal rule what amount of commits/contribution required for 
recieve "merge" rights?

Hi Denis,

We will push this for you on our next commit.  Alok has just gotten married and 
is out on honeymoon,
so it may be a little while.  If Marek (or anyone else) would like to get to it 
sooner, that would be
great.

Thanks,
Bruce


On Sat, Jul 28, 2018 at 11:03 PM Denis Pauk 
mailto:pauk.de...@gmail.com>> wrote:
Hi Bruce,

Thank you, could you please merge commits? (I don't have commit rights.)

On Fri, Jul 27, 2018 at 11:02 PM Cherniak, Bruce 
mailto:bruce.chern...@intel.com>> wrote:
Reviewed-by: Bruce Cherniak 
mailto:bruce.chern...@intel.com>>

> On Jul 27, 2018, at 1:45 PM, Denis Pauk 
> mailto:pauk.de...@gmail.com>> wrote:
>
> Reuse Code from:
> f69bc797e1 gallium/auxiliary: Add helper support for bptc format 
> compress/decompress
>
> Signed-off-by: Denis Pauk mailto:pauk.de...@gmail.com>>
> CC: Marek Olšák mailto:mar...@gmail.com>>
> CC: Bruce Cherniak mailto:bruce.chern...@intel.com>>
> CC: Tim Rowley mailto:timothy.o.row...@intel.com>>
> ---
> src/gallium/drivers/swr/swr_screen.cpp | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/src/gallium/drivers/swr/swr_screen.cpp 
> b/src/gallium/drivers/swr/swr_screen.cpp
> index 65fa1bc50e..1cc01aa47d 100644
> --- a/src/gallium/drivers/swr/swr_screen.cpp
> +++ b/src/gallium/drivers/swr/swr_screen.cpp
> @@ -137,8 +137,7 @@ swr_is_format_supported(struct pipe_screen *_screen,
>  return FALSE;
>}
>
> -   if (format_desc->layout == UTIL_FORMAT_LAYOUT_BPTC ||
> -   format_desc->layout == UTIL_FORMAT_LAYOUT_ASTC) {
> +   if (format_desc->layout == UTIL_FORMAT_LAYOUT_ASTC) {
>   return FALSE;
>}
>
> --
> 2.18.0
>



--
Best regards,
  Denis.


--
Best regards,
  Denis.

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


Re: [Mesa-dev] [PATCH] vc4: Fix automake linking error.

2018-08-01 Thread Andres Gomez
This looks good but, unfortunately, it seems to be breaking Travis
build for the scons targets:
https://travis-ci.org/Igalia/mesa/jobs/410431266

Please, Eric, could you try to see a way of solving this. I'm stuck not
 being able to create the 18.2 branch because of this build regression.

On Tue, 2018-07-31 at 19:14 +0200, Juan A. Suarez Romero wrote:
>   CXXLDgallium_dri.la
> ../../../../src/gallium/drivers/vc4/.libs/libvc4.a(vc4_cl_dump.o): In 
> function `vc4_dump_cl':
> src/gallium/drivers/vc4/vc4_cl_dump.c:45: undefined reference to 
> `clif_dump_init'
> src/gallium/drivers/vc4/vc4_cl_dump.c:82: undefined reference to 
> `clif_dump_destroy'
> ../../../../src/broadcom/cle/.libs/libbroadcom_cle.a(cle_libbroadcom_cle_la-v3d_decoder.o):
>  In function `v3d_field_iterator_next':
> src/broadcom/cle/v3d_decoder.c:902: undefined reference to `clif_lookup_bo'
> 
> Fixes: e92959c4e0 ("v3d: Pass the whole clif_dump structure to 
> v3d_print_group().")
> CC: Eric Anholt 
> ---
>  src/gallium/drivers/vc4/Automake.inc | 7 +++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/src/gallium/drivers/vc4/Automake.inc 
> b/src/gallium/drivers/vc4/Automake.inc
> index b1aa9726bd6..c9afa2478e9 100644
> --- a/src/gallium/drivers/vc4/Automake.inc
> +++ b/src/gallium/drivers/vc4/Automake.inc
> @@ -7,4 +7,11 @@ TARGET_LIB_DEPS += \
>   $(top_builddir)/src/gallium/drivers/vc4/libvc4.la \
>   $(top_builddir)/src/broadcom/cle/libbroadcom_cle.la
>  
> +if !HAVE_GALLIUM_V3D
> +TARGET_LIB_DEPS += \
> + $(top_builddir)/src/broadcom/libbroadcom.la \
> + $(top_builddir)/src/broadcom/libbroadcom_v33.la \
> + $(top_builddir)/src/broadcom/libbroadcom_v41.la
> +endif
> +
>  endif
-- 
Br,

Andres

signature.asc
Description: This is a digitally signed message part
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] glx: Add checks for context being direct before calling GetGLXDRIDrawable

2018-08-01 Thread Danylo Piliaiev
If indirect context is explicitly created by application and not
with LIBGL_ALWAYS_INDIRECT=1 then dri may be initialized in
__glXInitialize which allows Mesa to take invalid code paths
due to GetGLXDRIDrawable returning non-null value.
In most such places there are already checks for context being
direct before calling GetGLXDRIDrawable. This patch adds checks
where they were missed.

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

Signed-off-by: Danylo Piliaiev 
---
 src/glx/glx_pbuffer.c | 12 ++--
 src/glx/glxcmds.c |  3 +++
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/src/glx/glx_pbuffer.c b/src/glx/glx_pbuffer.c
index fd3327f120..6ee2ed58d2 100644
--- a/src/glx/glx_pbuffer.c
+++ b/src/glx/glx_pbuffer.c
@@ -133,6 +133,10 @@ ChangeDrawableAttribute(Display * dpy, GLXDrawable 
drawable,
SyncHandle();
 
 #ifdef GLX_DIRECT_RENDERING
+   struct glx_context *gc = __glXGetCurrentContext();
+   if (!gc->isDirect)
+  return;
+
pdraw = GetGLXDRIDrawable(dpy, drawable);
 
if (!pdraw)
@@ -286,7 +290,7 @@ __glXGetDrawableAttribute(Display * dpy, GLXDrawable 
drawable,
GLboolean use_glx_1_3;
 
 #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
-   __GLXDRIdrawable *pdraw;
+   __GLXDRIdrawable *pdraw = NULL;
 #endif
 
if (dpy == NULL)
@@ -316,7 +320,11 @@ __glXGetDrawableAttribute(Display * dpy, GLXDrawable 
drawable,
   return 0;
 
 #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
-   pdraw = GetGLXDRIDrawable(dpy, drawable);
+   struct glx_context *gc = __glXGetCurrentContext();
+
+   if (gc->isDirect) {
+  pdraw = GetGLXDRIDrawable(dpy, drawable);
+   }
 
if (attribute == GLX_BACK_BUFFER_AGE_EXT) {
   struct glx_context *gc = __glXGetCurrentContext();
diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c
index 4db0228eab..3eb86b02a9 100644
--- a/src/glx/glxcmds.c
+++ b/src/glx/glxcmds.c
@@ -799,6 +799,8 @@ glXDestroyGLXPixmap(Display * dpy, GLXPixmap glxpixmap)
DestroyGLXDrawable(dpy, glxpixmap);
 
 #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
+   struct glx_context *gc = __glXGetCurrentContext();
+   if (gc->isDirect)
{
   struct glx_display *const priv = __glXInitialize(dpy);
   __GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, glxpixmap);
@@ -831,6 +833,7 @@ glXSwapBuffers(Display * dpy, GLXDrawable drawable)
gc = __glXGetCurrentContext();
 
 #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
+   if (gc->isDirect)
{
   __GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable);
 
-- 
2.17.1

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


Re: [Mesa-dev] [PATCH v2 0/4] Android kms_swrast support

2018-08-01 Thread Robert Foss

Hey Rob,

On 2018-07-18 15:30, Rob Herring wrote:

On Tue, Jul 17, 2018 at 4:33 AM Robert Foss  wrote:


This series implements kms_swrast support for the Android
platform. And since having to debug a null pointer dereference,
simplify that process for the next guy.


So is this working for you now?


As it stands now, any kernel must have the following ioctls flagged with
DRM_RENDER_ALLOW[1], which isn't the case in the mainline kernel.

DRM_IOCTL_MODE_CREATE_DUMB
DRM_IOCTL_MODE_MAP_DUMB


Ah, sorry. I should have mentioned this. We have discussed this issue
in the past, but to no further conclusion.

But as I recall, I thought the issue was also allowing import and
export of dumb buffers?


While it would be possible to open a non-render node to pass the
authentication check, this would still cause authentication issues
when the /dev/dri/cardX node needs to be opened as master by both mesa
and the compositor.


Right. We've pretty much stripped the support that was there out. Plus
I don't think it will work with Treble.


I don't know how acceptable this series is for upstreaming, while relying on
a non-mainline kernel. I think the policy is to not accept changes that
don't have both a user and kernel space solution in place.

Like I noted yesterday[2] the alternative to using dumb buffers and having
authentication issues is using VGEM, which is new territory to me, and it would
take me a little bit of time to figure exactly how it fits into the current
kms_swrast approach.
Input, like noted before, is very much welcome.


I'm very much in favor of the former approach. VGEM seems like an
overly complicated solution when there's a very simple solution.


I've started a discussion about this on the LKML[1], but I havent really managed 
to get it off the ground.


But, about VGEM, what are the complicated parts you're referring to ^^?
I'm only asking, because I have a pretty poor understanding of what it would 
look like.


[1] https://lkml.org/lkml/2018/7/24/187



Rob


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


[Mesa-dev] [Bug 107224] Incorrect Rendering in Deus Ex: Mankind Divided in-game menu

2018-08-01 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=107224

--- Comment #9 from Alex Smith  ---
(In reply to Timothy Arceri from comment #8)
> Hmm ... I'm seeing the same issue on a i965 skylake machine that should
> never have exposed compatibility profile support.

Unfortunately the bug there is that that option has always been incorrectly set
on Intel (though the game does not support Intel). FWIW, the rendering issues
when it is set also occur on the NVIDIA proprietary driver, so definitely not
Mesa-specific.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] gallium/swr: Enable support bptc format.

2018-08-01 Thread Denis Pauk
Hi Marek,

Could you merge this changes to master? Or someone else with push rights?

Do mesa have some formal rule what amount of commits/contribution required
for recieve "merge" rights?

On Sat, Jul 28, 2018 at 11:03 PM Denis Pauk  wrote:

> Hi Bruce,
>
> Thank you, could you please merge commits? (I don't have commit rights.)
>
> On Fri, Jul 27, 2018 at 11:02 PM Cherniak, Bruce 
> wrote:
>
>> Reviewed-by: Bruce Cherniak 
>>
>> > On Jul 27, 2018, at 1:45 PM, Denis Pauk  wrote:
>> >
>> > Reuse Code from:
>> > f69bc797e1 gallium/auxiliary: Add helper support for bptc format
>> compress/decompress
>> >
>> > Signed-off-by: Denis Pauk 
>> > CC: Marek Olšák 
>> > CC: Bruce Cherniak 
>> > CC: Tim Rowley 
>> > ---
>> > src/gallium/drivers/swr/swr_screen.cpp | 3 +--
>> > 1 file changed, 1 insertion(+), 2 deletions(-)
>> >
>> > diff --git a/src/gallium/drivers/swr/swr_screen.cpp
>> b/src/gallium/drivers/swr/swr_screen.cpp
>> > index 65fa1bc50e..1cc01aa47d 100644
>> > --- a/src/gallium/drivers/swr/swr_screen.cpp
>> > +++ b/src/gallium/drivers/swr/swr_screen.cpp
>> > @@ -137,8 +137,7 @@ swr_is_format_supported(struct pipe_screen *_screen,
>> >  return FALSE;
>> >}
>> >
>> > -   if (format_desc->layout == UTIL_FORMAT_LAYOUT_BPTC ||
>> > -   format_desc->layout == UTIL_FORMAT_LAYOUT_ASTC) {
>> > +   if (format_desc->layout == UTIL_FORMAT_LAYOUT_ASTC) {
>> >   return FALSE;
>> >}
>> >
>> > --
>> > 2.18.0
>> >
>>
>>
>
> --
> Best regards,
>   Denis.
>


-- 
Best regards,
  Denis.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] loader_dri3: Handle mismatched depth 30 formats for Prime renderoffload.

2018-08-01 Thread Eric Engestrom
On Thursday, 2018-06-14 06:04:24 +0200, Mario Kleiner wrote:
> Detect if the display (X-Server) gpu and Prime renderoffload gpu prefer
> different channel ordering for color depth 30 formats ([X/A]BGR2101010
> vs. [X/A]RGB2101010) and perform format conversion during the blitImage()
> detiling op from tiled backbuffer -> linear buffer.
> 
> For this we need to find the visual (= red channel mask) for the
> X-Drawable used to display on the server gpu. We use the same proven
> logic for finding that visual as in commit "egl/x11: Handle both depth
> 30 formats for eglCreateImage()".
> 
> This is mostly to allow "NVidia Optimus" at depth 30, as Intel/AMD
> gpu's prefer xRGB2101010 ordering, whereas NVidia gpu's prefer
> xBGR2101010 ordering, so we can offload to nouveau without getting
> funky colors.
> 
> Tested on Intel single gpu, NVidia single gpu, Intel + NVidia prime
> offload with DRI3/Present.
> 
> Note: An unintended but pleasant surprise of this patch is that it also
> seems to make the modesetting-ddx of server 1.20.0 work at depth 30
> on nouveau, at least with unredirected "classic" X rendering, and
> with redirected desktop compositing under XRender accel, and with OpenGL
> compositing under GLX. Only X11 compositing via OpenGL + EGL still gives
> funky colors. modesetting-ddx + glamor are not yet ready to deal with
> nouveau's ABGR2101010 format, and treat it as ARGB2101010, also exposing
> X-visuals with ARGB2101010 style channel masks. Seems somehow this triggers
> the logic in this patch on modesetting-ddx + depth 30 + DRI3 buffer sharing
> and does the "wrong" channel swizzling that then cancels out the "wrong"
> swizzling of glamor and we end up with the proper pixel formatting in
> the scanout buffer :). This so far tested on a NVA5 Tesla card under KDE5
> Plasma as shipping with Ubuntu 16.04.4 LTS.
> 
> Signed-off-by: Mario Kleiner 
> Cc: Ilia Mirkin 
> Cc: Eric Engestrom 

Reviewed-by: Eric Engestrom 

> ---
>  src/loader/loader_dri3_helper.c | 83 -
>  src/loader/loader_dri3_helper.h |  1 +
>  2 files changed, 83 insertions(+), 1 deletion(-)
> 
> diff --git a/src/loader/loader_dri3_helper.c b/src/loader/loader_dri3_helper.c
> index f0ff2f07bd..a9a18921ce 100644
> --- a/src/loader/loader_dri3_helper.c
> +++ b/src/loader/loader_dri3_helper.c
> @@ -64,6 +64,55 @@ dri3_flush_present_events(struct loader_dri3_drawable 
> *draw);
>  static struct loader_dri3_buffer *
>  dri3_find_back_alloc(struct loader_dri3_drawable *draw);
>  
> +static xcb_screen_t *
> +get_screen_for_root(xcb_connection_t *conn, xcb_window_t root)
> +{
> +   xcb_screen_iterator_t screen_iter =
> +   xcb_setup_roots_iterator(xcb_get_setup(conn));
> +
> +   for (; screen_iter.rem; xcb_screen_next (_iter)) {
> +  if (screen_iter.data->root == root)
> + return screen_iter.data;
> +   }
> +
> +   return NULL;
> +}
> +
> +static xcb_visualtype_t *
> +get_xcb_visualtype_for_depth(struct loader_dri3_drawable *draw, int depth)
> +{
> +   xcb_visualtype_iterator_t visual_iter;
> +   xcb_screen_t *screen = draw->screen;
> +   xcb_depth_iterator_t depth_iter;
> +
> +   if (!screen)
> +  return NULL;
> +
> +   depth_iter = xcb_screen_allowed_depths_iterator(screen);
> +   for (; depth_iter.rem; xcb_depth_next(_iter)) {
> +  if (depth_iter.data->depth != depth)
> + continue;
> +
> +  visual_iter = xcb_depth_visuals_iterator(depth_iter.data);
> +  if (visual_iter.rem)
> + return visual_iter.data;
> +   }
> +
> +   return NULL;
> +}
> +
> +/* Get red channel mask for given drawable at given depth. */
> +static unsigned int
> +dri3_get_red_mask_for_depth(struct loader_dri3_drawable *draw, int depth)
> +{
> +   xcb_visualtype_t *visual = get_xcb_visualtype_for_depth(draw, depth);
> +
> +   if (visual)
> +  return visual->red_mask;
> +
> +   return 0;
> +}
> +
>  /**
>   * Do we have blit functionality in the image blit extension?
>   *
> @@ -323,6 +372,7 @@ loader_dri3_drawable_init(xcb_connection_t *conn,
>return 1;
> }
>  
> +   draw->screen = get_screen_for_root(draw->conn, reply->root);
> draw->width = reply->width;
> draw->height = reply->height;
> draw->depth = reply->depth;
> @@ -1030,6 +1080,36 @@ dri3_cpp_for_format(uint32_t format) {
> }
>  }
>  
> +/* Map format of render buffer to corresponding format for the linear_buffer
> + * used for sharing with the display gpu of a Prime setup (== 
> is_different_gpu).
> + * Usually linear_format == format, except for depth >= 30 formats, where
> + * different gpu vendors have different preferences wrt. color channel 
> ordering.
> + */
> +static uint32_t
> +dri3_linear_format_for_format(struct loader_dri3_drawable *draw, uint32_t 
> format)
> +{
> +   switch (format) {
> +  case  __DRI_IMAGE_FORMAT_XRGB2101010:
> +  case  __DRI_IMAGE_FORMAT_XBGR2101010:
> + /* Different preferred formats for different hw */
> + if (dri3_get_red_mask_for_depth(draw, 30) == 

Re: [Mesa-dev] [RFC] add a config file for dri loader to choose a different dri driver

2018-08-01 Thread Emil Velikov
On 31 July 2018 at 14:35, Michel Dänzer  wrote:
> On 2018-07-31 10:03 AM, Yu, Qiang wrote:
>>
>> Seems the mesa driconf infrastructure is just what I need:
>> https://dri.freedesktop.org/wiki/ConfigurationInfrastructure/
>>
>> So I can reference the loader_get_dri_config_device_id implementation
>> for adding loader driver override functionality in /etc/drirc:
>> 
>>   
>> 
>>   
>> 
>>
>> Thoughts?
>
> Using the driconf infrastructure is definitely better than creating a
> new mechanism. It'll even allow configuring the driver per application. :)
>
> Grepping for device_id in src/util/xmlpool/t_options.h and
> src/loader/loader.c might be useful.
>
> Here's an example of how I imagine general and per-application driver
> configuration could work:
>
> 
>  
>
>   
>   
>
>   
>   
>
>   
>
>  
> 
>
Good suggestion Michel, I love it. I'm a fan of the full names -
kernel_driver/dri_driver.
There's plenty of inconsistencies in Mesa when using the shorthand "driver".

Thanks
Emil
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 0/2] support config for third-party DRI driver load

2018-08-01 Thread Qiang Yu
This patch series is discussed in thread:
https://lists.freedesktop.org/archives/mesa-dev/2018-July/201348.html

amdgpu-pro driver can use drirc config to override the mesa radeonsi
dri driver so that it can use the mesa libgbm instead of maintain
a customized one.

We also expand drirc config file location to some directories for the
ease of driver and application to add their own config files.

Qiang Yu (2):
  xmlconfig: read more config files from drirc.d/
  loader: add dri_driver drirc option to override dri driver to load

 docs/autoconf.html   |  11 -
 src/loader/loader.c  |  75 ---
 src/util/Makefile.am |   1 +
 src/util/meson.build |   4 +-
 src/util/xmlconfig.c | 104 +--
 src/util/xmlpool/t_options.h |   5 +++
 6 files changed, 147 insertions(+), 53 deletions(-)

-- 
2.7.4

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


[Mesa-dev] [PATCH 1/2] xmlconfig: read more config files from drirc.d/

2018-08-01 Thread Qiang Yu
Add two places for hosting drirc config files:
/usr/share/drirc.d/ /etc/drirc.d/

Driver and application can put their drirc files in
these places with name xxx.conf. Config files will be
read and applied in file name alphabete order.

So there are four places for drirc listed in order:
1. /usr/share/drirc.d/
2. /etc/drirc.d/
3. /etc/drirc
4. ~/.drirc

Signed-off-by: Qiang Yu 
---
 docs/autoconf.html   |  11 +-
 src/util/Makefile.am |   1 +
 src/util/meson.build |   4 +-
 src/util/xmlconfig.c | 104 ++-
 4 files changed, 83 insertions(+), 37 deletions(-)

diff --git a/docs/autoconf.html b/docs/autoconf.html
index df243c2..5f1a006 100644
--- a/docs/autoconf.html
+++ b/docs/autoconf.html
@@ -90,8 +90,15 @@ tree.
 --sysconfdir=DIR
 This option specifies the directory where the configuration
 files will be installed. The default is ${prefix}/etc.
-Currently there's only one config file provided when dri drivers are
-enabled - it's drirc.
+Currently when dri drivers are enabled, drirc drirc.d/
+are in this place.
+
+
+--datadir=DIR
+This option specifies the directory where the data files will
+be installed. The default is ${prefix}/share.
+Currently when dri drivers are enabled, drirc.d/ is at
+this place.
 
 
 --enable-static, --disable-shared
diff --git a/src/util/Makefile.am b/src/util/Makefile.am
index bafb574..8d8c156 100644
--- a/src/util/Makefile.am
+++ b/src/util/Makefile.am
@@ -67,6 +67,7 @@ libxmlconfig_la_CFLAGS = \
-I$(top_srcdir)/include \
-I$(top_srcdir)/src \
-DSYSCONFDIR=\"$(sysconfdir)\" \
+   -DDATADIR=\"$(datadir)\" \
$(VISIBILITY_CFLAGS) \
$(EXPAT_CFLAGS)
 libxmlconfig_la_LIBADD = $(EXPAT_LIBS) -lm
diff --git a/src/util/meson.build b/src/util/meson.build
index 8c91be8..108524b 100644
--- a/src/util/meson.build
+++ b/src/util/meson.build
@@ -121,7 +121,9 @@ libxmlconfig = static_library(
   c_args : [
 c_msvc_compat_args, c_vis_args,
 '-DSYSCONFDIR="@0@"'.format(
-  join_paths(get_option('prefix'), get_option('sysconfdir'))
+  join_paths(get_option('prefix'), get_option('sysconfdir')),
+'-DDATADIR="@0@"'.format(
+  join_paths(get_option('prefix'), get_option('datadir'))
 ),
   ],
   build_by_default : false,
diff --git a/src/util/xmlconfig.c b/src/util/xmlconfig.c
index d384791..a3869ac 100644
--- a/src/util/xmlconfig.c
+++ b/src/util/xmlconfig.c
@@ -36,6 +36,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 #include "xmlconfig.h"
 #include "process.h"
 
@@ -866,9 +868,8 @@ initOptionCache(driOptionCache *cache, const driOptionCache 
*info)
 }
 }
 
-/** \brief Parse the named configuration file */
 static void
-parseOneConfigFile(XML_Parser p)
+_parseOneConfigFile(XML_Parser p)
 {
 #define BUF_SIZE 0x1000
 struct OptConfData *data = (struct OptConfData *)XML_GetUserData (p);
@@ -907,17 +908,75 @@ parseOneConfigFile(XML_Parser p)
 #undef BUF_SIZE
 }
 
+/** \brief Parse the named configuration file */
+static void
+parseOneConfigFile(struct OptConfData *data, const char *filename)
+{
+XML_Parser p;
+
+p = XML_ParserCreate (NULL); /* use encoding specified by file */
+XML_SetElementHandler (p, optConfStartElem, optConfEndElem);
+XML_SetUserData (p, data);
+data->parser = p;
+data->name = filename;
+data->ignoringDevice = 0;
+data->ignoringApp = 0;
+data->inDriConf = 0;
+data->inDevice = 0;
+data->inApp = 0;
+data->inOption = 0;
+
+_parseOneConfigFile (p);
+XML_ParserFree (p);
+}
+
+static int
+scandir_filter(const struct dirent *ent)
+{
+if (ent->d_type != DT_REG && ent->d_type != DT_LNK)
+   return 0;
+
+if (fnmatch("*.conf", ent->d_name, 0))
+   return 0;
+
+return 1;
+}
+
+/** \brief Parse configuration files in a directory */
+static void
+parseConfigDir(struct OptConfData *data, const char *dirname)
+{
+int i, count;
+struct dirent **entries = NULL;
+
+count = scandir(dirname, , scandir_filter, alphasort);
+if (count < 0)
+return;
+
+for (i = 0; i < count; i++) {
+char filename[PATH_MAX];
+
+snprintf(filename, PATH_MAX, "%s/%s", dirname, entries[i]->d_name);
+parseOneConfigFile(data, filename);
+}
+
+if (entries)
+free(entries);
+}
+
 #ifndef SYSCONFDIR
 #define SYSCONFDIR "/etc"
 #endif
 
+#ifndef DATADIR
+#define DATADIR "/usr/share"
+#endif
+
 void
 driParseConfigFiles(driOptionCache *cache, const driOptionCache *info,
 int screenNum, const char *driverName)
 {
-char *filenames[2] = { SYSCONFDIR "/drirc", NULL};
 char *home;
-uint32_t i;
 struct OptConfData userData;
 
 initOptionCache (cache, info);
@@ -927,39 +986,16 @@ driParseConfigFiles(driOptionCache *cache, const 
driOptionCache *info,
 userData.driverName = driverName;
 userData.execName = util_get_process_name();
 
+parseConfigDir(, DATADIR "/drirc.d");
+parseConfigDir(, SYSCONFDIR 

[Mesa-dev] [PATCH 2/2] loader: add dri_driver drirc option to override dri driver to load

2018-08-01 Thread Qiang Yu
drirc implementation of MESA_LOADER_DRIVER_OVERRIDE which can be
used to override dri driver to load.

Usage:

override dri driver for device with spec kernel driver name:

  


Signed-off-by: Qiang Yu 
---
 src/loader/loader.c  | 75 ++--
 src/util/xmlpool/t_options.h |  5 +++
 2 files changed, 64 insertions(+), 16 deletions(-)

diff --git a/src/loader/loader.c b/src/loader/loader.c
index 4327548..8c78096 100644
--- a/src/loader/loader.c
+++ b/src/loader/loader.c
@@ -82,15 +82,65 @@ loader_open_device(const char *device_name)
return fd;
 }
 
-#if defined(HAVE_LIBDRM)
+static char *loader_get_kernel_driver_name(int fd)
+{
+#if HAVE_LIBDRM
+   char *driver;
+   drmVersionPtr version = drmGetVersion(fd);
+
+   if (!version) {
+  log_(_LOADER_WARNING, "failed to get driver name for fd %d\n", fd);
+  return NULL;
+   }
+
+   driver = strndup(version->name, version->name_len);
+
+   drmFreeVersion(version);
+   return driver;
+#else
+   return NULL;
+#endif
+}
+
 #ifdef USE_DRICONF
 static const char __driConfigOptionsLoader[] =
 DRI_CONF_BEGIN
 DRI_CONF_SECTION_INITIALIZATION
 DRI_CONF_DEVICE_ID_PATH_TAG()
+DRI_CONF_DRI_DRIVER()
 DRI_CONF_SECTION_END
 DRI_CONF_END;
 
+static char *loader_get_dri_config_driver(int fd)
+{
+   driOptionCache defaultInitOptions;
+   driOptionCache userInitOptions;
+   char driver[32] = "k:null";
+   char *dri_driver = NULL;
+   char *kernel_driver = loader_get_kernel_driver_name(fd);
+
+   if (kernel_driver) {
+  snprintf(driver, 32, "k:%s", kernel_driver);
+  free(kernel_driver);
+   }
+
+   driParseOptionInfo(, __driConfigOptionsLoader);
+   driParseConfigFiles(, , 0, driver);
+   if (driCheckOption(, "dri_driver", DRI_STRING)) {
+  char *opt = driQueryOptionstr(, "dri_driver");
+  /* not an empty string */
+  if (*opt)
+ dri_driver = strdup(opt);
+   }
+   driDestroyOptionCache();
+   driDestroyOptionInfo();
+
+   return dri_driver;
+}
+#endif
+
+#if defined(HAVE_LIBDRM)
+#ifdef USE_DRICONF
 static char *loader_get_dri_config_device_id(void)
 {
driOptionCache defaultInitOptions;
@@ -338,23 +388,16 @@ loader_get_driver_for_fd(int fd)
  return strdup(driver);
}
 
-   if (!loader_get_pci_id_for_fd(fd, _id, _id)) {
-
-#if HAVE_LIBDRM
-  /* fallback to drmGetVersion(): */
-  drmVersionPtr version = drmGetVersion(fd);
-
-  if (!version) {
- log_(_LOADER_WARNING, "failed to get driver name for fd %d\n", fd);
- return NULL;
-  }
-
-  driver = strndup(version->name, version->name_len);
-  log_(_LOADER_INFO, "using driver %s for %d\n", driver, fd);
-
-  drmFreeVersion(version);
+#ifdef USE_DRICONF
+   driver = loader_get_dri_config_driver(fd);
+   if (driver)
+  return driver;
 #endif
 
+   if (!loader_get_pci_id_for_fd(fd, _id, _id)) {
+  driver = loader_get_kernel_driver_name(fd);
+  if (driver)
+ log_(_LOADER_INFO, "using driver %s for %d\n", driver, fd);
   return driver;
}
 
diff --git a/src/util/xmlpool/t_options.h b/src/util/xmlpool/t_options.h
index f0537e9..d4881b3 100644
--- a/src/util/xmlpool/t_options.h
+++ b/src/util/xmlpool/t_options.h
@@ -411,6 +411,11 @@ DRI_CONF_OPT_BEGIN(device_id, string, def) \
 DRI_CONF_DESC(en,gettext("Define the graphic device to use if 
possible")) \
 DRI_CONF_OPT_END
 
+#define DRI_CONF_DRI_DRIVER(def) \
+DRI_CONF_OPT_BEGIN(dri_driver, string, def) \
+DRI_CONF_DESC(en,gettext("Override the DRI driver to load")) \
+DRI_CONF_OPT_END
+
 /**
  * \brief Gallium-Nine specific configuration options
  */
-- 
2.7.4

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


[Mesa-dev] [Bug 107439] mesa defines likely/unlikely and these are C++20 keywords

2018-08-01 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=107439

--- Comment #1 from Gustaw Smolarczyk  ---
Are these really reserved keywords? I thought the attribute namespace was
different from the keyword namespace.

These are not listed as keywords, even for C++20:

https://en.cppreference.com/w/cpp/keyword

You should be able to define variables called "likely", for example.

https://wandbox.org/permlink/hFczuKlzyOjFjvkA

Using the [[likely]] syntax while having likely() defined as a macro might be a
problem though, but that is a separate issue.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH v3 1/8] nir: evaluate if condition uses inside the if branches

2018-08-01 Thread Dieter Nützel

Am 01.08.2018 05:56, schrieb Timothy Arceri:

On 01/08/18 13:09, Dieter Nützel wrote:

Am 31.07.2018 13:34, schrieb Timothy Arceri:

On 31/07/18 13:50, Dieter Nützel wrote:

Am 30.07.2018 05:24, schrieb Dieter Nützel:

For the series

Tested-by: Dieter Nützel 

with glmark2, glxgears, UH, UV, Blender 2.79 and FreeCAD 0.17

on RX 580.

With UH I saw some small light blue triangles spreading around.
Have to bisect which patch set was the culprit. (If I have some 
time.)

Tried your's above
configure-bump-libdrm-for-AMDGPU-to-2.4.92.mbox (Samuel)
ASTC-texture-compression-for-all-Gallium-drivers.mbox (Marek)

Dieter


It has something to do with tessellation.
If I disable it (F3) all small light blue triangles are _gone_.


Are you able to bisect?


In short, it has _nothing_ to do with _this_ series.
Tested on e6ff5ac446.
So my tb stands.

After some sleep (Nothern Germany is _very_ hot and _dry_ this year) 
I'll do my very best... ;-)


hehe. Yes I've experienced a "heat wave" in Northern Europe before,
but some of us have very different definitions of _very_ hot and _dry_
:P


With tonight's shower we had only _4_ (really 3, first day was 10 
minutes with only some drops)

days with rain since last week of April!!!
Our fields and forests need badly water.
We never had such dry spring/early summer/summer for ages.

So back to work.

/opt/mesa> git bisect bad
   86b52d42368ac496fe24bc6674e754c323381635 is 
the first bad commit

commit 86b52d42368ac496fe24bc6674e754c323381635
Author: Marek Olšák 
Date:   Fri Jul 13 00:23:36 2018 -0400

radeonsi: reduce LDS stalls by 40% for tessellation

40% is the decrease in the LGKM counter (which includes SMEM too)
for the GFX9 LSHS stage.

This will make the LDS size slightly larger, but I wasn't able to 
increase
the patch stride without corruption, so I'm increasing the vertex 
stride.


:04 04 8d457bbd593fe44ca0c7080820f3428f64d5ba19 
56feae85455f50d6e5ab7a0285db7319d0601afe M src


Reverting it (on top of master + _this_ series) makes all smooth and
dandy, again - at least on RX580.

Going to bed.







Regards,
Dieter


Am 28.07.2018 03:07, schrieb Timothy Arceri:

On 28/07/18 11:06, Timothy Arceri wrote:

Since we know what side of the branch we ended up on we can just
replace the use with a constant.

All the spill changes in shader-db are from Dolphin uber shaders,
despite some small regressions the change is clearly positive.

V2: insert new constant after any phis in the
 use->parent_instr->type == nir_instr_type_phi path.


Meh this was meant to be V3
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

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

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