[Mesa-dev] [PATCH] Android: use bionic pthread_barrier_* if possible

2017-06-03 Thread Chih-Wei Huang
The pthread_barrier_* functions were introduced to bionic
since Nougat.

Signed-off-by: Chih-Wei Huang 
---
 Android.common.mk| 1 +
 src/gallium/auxiliary/os/os_thread.h | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/Android.common.mk b/Android.common.mk
index 57c31fc..44ad97b 100644
--- a/Android.common.mk
+++ b/Android.common.mk
@@ -44,6 +44,7 @@ LOCAL_CFLAGS += \
 # It's likely due to a bug elsewhere, but let's temporarily add them
 # here to fix the radeonsi build.
 LOCAL_CFLAGS += \
+   -DANDROID_API_LEVEL=$(PLATFORM_SDK_VERSION) \
-DENABLE_SHADER_CACHE \
-D__STDC_CONSTANT_MACROS \
-D__STDC_LIMIT_MACROS \
diff --git a/src/gallium/auxiliary/os/os_thread.h 
b/src/gallium/auxiliary/os/os_thread.h
index b6e0698..0a238e5 100644
--- a/src/gallium/auxiliary/os/os_thread.h
+++ b/src/gallium/auxiliary/os/os_thread.h
@@ -75,7 +75,7 @@ __pipe_mutex_assert_locked(mtx_t *mutex)
  * pipe_barrier
  */
 
-#if (defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || 
defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_HURD)) && !defined(PIPE_OS_ANDROID)
+#if (defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || 
defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_HURD)) && 
(!defined(PIPE_OS_ANDROID) || ANDROID_API_LEVEL >= 24)
 
 typedef pthread_barrier_t pipe_barrier;
 
-- 
1.9.1

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


[Mesa-dev] [PATCH] Android: define PIPE_OS_BSD

2017-06-03 Thread Chih-Wei Huang
Android bionic is derived from OpenBSD. So the logics of BSD
almost apply to Android as well.

It fixes the warnings

external/mesa/src/gallium/auxiliary/os/os_process.c:43:2: warning: unexpected 
platform in os_process.c [-W#warnings]
 ^
external/mesa/src/gallium/auxiliary/os/os_process.c:97:2: warning: unexpected 
platform in os_process.c [-W#warnings]
 ^
2 warnings generated.

Actually it's the only affected file by the change.

Signed-off-by: Chih-Wei Huang 
---
 src/gallium/include/pipe/p_config.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/gallium/include/pipe/p_config.h 
b/src/gallium/include/pipe/p_config.h
index 3fa43ed..0d8e9f7 100644
--- a/src/gallium/include/pipe/p_config.h
+++ b/src/gallium/include/pipe/p_config.h
@@ -158,6 +158,7 @@
  */
 #if defined(ANDROID)
 #define PIPE_OS_ANDROID
+#define PIPE_OS_BSD
 #endif
 
 #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
-- 
1.9.1

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


Re: [Mesa-dev] [PATCH 2/2] radeonsi: move PSIZE and CLIPDIST unique IO indices after GENERIC

2017-06-03 Thread Dieter Nützel

It improves Uningine Heaven performance here (RX 580, 8 GB),too.

without Tessellation

Before:
FPS:  79.0
Score:1991
Min FPS:  20.8
Max FPS: 189.8

After:
FPS:  79.1
Score:1993
Min FPS:  19.6
Max FPS: 185.9


with Tessellation

Before:
FPS:  67.7
Score:1705
Min FPS:   8.8
Max FPS: 182.6

After:
FPS:  68.3
Score:1720
Min FPS:  15.9
Max FPS: 179.6


System

Platform:   Linux 4.20.0-amd-staging-4.11-1.g7262353-default+ x86_64
CPU model:  Intel(R) Xeon(R) CPU X3470 @ 2.93GHz (2925MHz) x8
GPU model:  Unknown GPU (256MB) x1

Marek is this the 'tessellation regression' you tried to solve?

For this series:
Tested-by: Dieter Nützel 

Dieter

Am 03.06.2017 18:04, schrieb Marek Olšák:

From: Marek Olšák 

Heaven LDS usage for LS+HS is below. The masks are "outputs_written"
for LS and HS. Note that 32K is the maximum size.

Before:
  heaven_x64: ls=1f1 tcs=1f1, lds=32K
  heaven_x64: ls=31 tcs=31, lds=24K
  heaven_x64: ls=71 tcs=71, lds=28K

After:
  heaven_x64: ls=3f tcs=3f, lds=24K
  heaven_x64: ls=7 tcs=7, lds=13K
  heaven_x64: ls=f tcs=f, lds=17K

All other apps have a similar decrease in LDS usage, because
the "outputs_written" masks are similar. Also, most apps don't write
POSITION in these shader stages, so there is room for improvement.
(tight per-component input/output packing might help even more)

It's unknown whether this improves performance.
---
 src/gallium/drivers/radeonsi/si_shader.c| 18 
+++---

 src/gallium/drivers/radeonsi/si_state_shaders.c |  4 +++-
 2 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_shader.c
b/src/gallium/drivers/radeonsi/si_shader.c
index ddfaa3b..3a86c0b 100644
--- a/src/gallium/drivers/radeonsi/si_shader.c
+++ b/src/gallium/drivers/radeonsi/si_shader.c
@@ -129,32 +129,36 @@ unsigned
si_shader_io_get_unique_index_patch(unsigned semantic_name, unsigned
in
 /**
  * Returns a unique index for a semantic name and index. The index 
must be
  * less than 64, so that a 64-bit bitmask of used inputs or outputs 
can be

  * calculated.
  */
 unsigned si_shader_io_get_unique_index(unsigned semantic_name, 
unsigned index)

 {
switch (semantic_name) {
case TGSI_SEMANTIC_POSITION:
return 0;
-   case TGSI_SEMANTIC_PSIZE:
-   return 1;
-   case TGSI_SEMANTIC_CLIPDIST:
-   assert(index <= 1);
-   return 2 + index;
case TGSI_SEMANTIC_GENERIC:
+   /* Since some shader stages use the the highest used IO index
+* to determine the size to allocate for inputs/outputs
+* (in LDS, tess and GS rings). GENERIC should be placed right
+* after POSITION to make that size as small as possible.
+*/
if (index < SI_MAX_IO_GENERIC)
-   return 4 + index;
+   return 1 + index;

assert(!"invalid generic index");
return 0;
-
+   case TGSI_SEMANTIC_PSIZE:
+   return SI_MAX_IO_GENERIC + 1;
+   case TGSI_SEMANTIC_CLIPDIST:
+   assert(index <= 1);
+   return SI_MAX_IO_GENERIC + 2 + index;
case TGSI_SEMANTIC_FOG:
return SI_MAX_IO_GENERIC + 4;
case TGSI_SEMANTIC_LAYER:
return SI_MAX_IO_GENERIC + 5;
case TGSI_SEMANTIC_VIEWPORT_INDEX:
return SI_MAX_IO_GENERIC + 6;
case TGSI_SEMANTIC_PRIMID:
return SI_MAX_IO_GENERIC + 7;
case TGSI_SEMANTIC_COLOR: /* these alias */
case TGSI_SEMANTIC_BCOLOR:
diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.c
b/src/gallium/drivers/radeonsi/si_state_shaders.c
index 8ac4309..f36997b 100644
--- a/src/gallium/drivers/radeonsi/si_state_shaders.c
+++ b/src/gallium/drivers/radeonsi/si_state_shaders.c
@@ -1226,21 +1226,23 @@ static void
si_shader_selector_key_hw_vs(struct si_context *sctx,
ps_disabled = sctx->queued.named.rasterizer->rasterizer_discard 
||
  (!ps_colormask &&
   !ps_modifies_zs &&
   !ps->info.writes_memory);
}

/* Find out which VS outputs aren't used by the PS. */
uint64_t outputs_written = vs->outputs_written;
uint64_t inputs_read = 0;

-   outputs_written &= ~0x3; /* ignore POSITION, PSIZE */
+   /* ignore POSITION, PSIZE */
+   outputs_written &= ~((1ull <<
si_shader_io_get_unique_index(TGSI_SEMANTIC_POSITION, 0) |
+			 (1ull << si_shader_io_get_unique_index(TGSI_SEMANTIC_PSIZE, 
0;


if (!ps_disabled) {
inputs_read = ps->inputs_read;
}

uint64_t linked = outputs_written & inputs_read;

key->opt.hw_vs.kill_outputs = ~linked & outputs_written;
 }

___
mesa-dev mailing list

[Mesa-dev] [Bug 101291] FAIL: glsl/tests/optimization-test

2017-06-03 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=101291

Bug ID: 101291
   Summary: FAIL: glsl/tests/optimization-test
   Product: Mesa
   Version: 17.0
  Hardware: Other
OS: All
Status: NEW
  Severity: normal
  Priority: medium
 Component: Mesa core
  Assignee: mesa-dev@lists.freedesktop.org
  Reporter: ved...@miletic.net
QA Contact: mesa-dev@lists.freedesktop.org

$ /autogen.sh --enable-egl --enable-driglx-direct --disable-gles1
--enable-gles2 --enable-shared-glapi --enable-glx-tls --enable-dri
--enable-texture-float --with-dri-drivers=""
--with-egl-platforms=drm,wayland,surfaceless,x11
--with-gallium-drivers=r600,radeonsi,swrast --with-vulkan-drivers=radeon
--enable-opencl --enable-opencl-icd PKG_CONFIG_PATH=/usr/local/share/pkgconfig
--enable-nine --enable-gbm --enable-va --enable-vdpau --libdir=/usr/local/lib64

$ make -j4; make -j4 check

FAIL: glsl/tests/optimization-test

==
   Mesa 17.0.7: src/compiler/test-suite.log
==

# TOTAL: 10
# PASS:  9
# SKIP:  0
# XFAIL: 0
# FAIL:  1
# XPASS: 0
# ERROR: 0

.. contents:: :depth: 2

FAIL: glsl/tests/optimization-test
==

==   Generating tests  ==
tests/*/
== Testing optimization passes ==
Testing ./glsl/tests/lower_jumps/lower_breaks_2.opt_test...FAIL
python2.7: can't open file
'/home/vedranm/workspace/mesa/src/compiler/tests/compare_ir': [Errno 2] No such
file or directory
Testing ./glsl/tests/lower_jumps/lower_returns_main_false.opt_test...FAIL
python2.7: can't open file
'/home/vedranm/workspace/mesa/src/compiler/tests/compare_ir': [Errno 2] No such
file or directory
Testing ./glsl/tests/lower_jumps/lower_returns_1.opt_test...FAIL
python2.7: can't open file
'/home/vedranm/workspace/mesa/src/compiler/tests/compare_ir': [Errno 2] No such
file or directory
Testing ./glsl/tests/lower_jumps/lower_returns_sub_false.opt_test...FAIL
python2.7: can't open file
'/home/vedranm/workspace/mesa/src/compiler/tests/compare_ir': [Errno 2] No such
file or directory
Testing ./glsl/tests/lower_jumps/lower_returns_main_true.opt_test...FAIL
python2.7: can't open file
'/home/vedranm/workspace/mesa/src/compiler/tests/compare_ir': [Errno 2] No such
file or directory
Testing
./glsl/tests/lower_jumps/lower_guarded_conditional_break.opt_test...FAIL
python2.7: can't open file
'/home/vedranm/workspace/mesa/src/compiler/tests/compare_ir': [Errno 2] No such
file or directory
Testing ./glsl/tests/lower_jumps/lower_returns_2.opt_test...FAIL
python2.7: can't open file
'/home/vedranm/workspace/mesa/src/compiler/tests/compare_ir': [Errno 2] No such
file or directory
Testing ./glsl/tests/lower_jumps/lower_returns_sub_true.opt_test...FAIL
python2.7: can't open file
'/home/vedranm/workspace/mesa/src/compiler/tests/compare_ir': [Errno 2] No such
file or directory
Testing ./glsl/tests/lower_jumps/lower_breaks_4.opt_test...FAIL
python2.7: can't open file
'/home/vedranm/workspace/mesa/src/compiler/tests/compare_ir': [Errno 2] No such
file or directory
Testing ./glsl/tests/lower_jumps/lower_breaks_3.opt_test...FAIL
python2.7: can't open file
'/home/vedranm/workspace/mesa/src/compiler/tests/compare_ir': [Errno 2] No such
file or directory
Testing ./glsl/tests/lower_jumps/lower_breaks_6.opt_test...FAIL
python2.7: can't open file
'/home/vedranm/workspace/mesa/src/compiler/tests/compare_ir': [Errno 2] No such
file or directory
Testing
./glsl/tests/lower_jumps/return_non_void_at_end_of_loop_lower_nothing.opt_test...FAIL
python2.7: can't open file
'/home/vedranm/workspace/mesa/src/compiler/tests/compare_ir': [Errno 2] No such
file or directory
Testing
./glsl/tests/lower_jumps/return_non_void_at_end_of_loop_lower_return.opt_test...FAIL
python2.7: can't open file
'/home/vedranm/workspace/mesa/src/compiler/tests/compare_ir': [Errno 2] No such
file or directory
Testing ./glsl/tests/lower_jumps/lower_returns_3.opt_test...FAIL
python2.7: can't open file
'/home/vedranm/workspace/mesa/src/compiler/tests/compare_ir': [Errno 2] No such
file or directory
Testing
./glsl/tests/lower_jumps/return_non_void_at_end_of_loop_lower_return_and_break.opt_test...FAIL
python2.7: can't open file
'/home/vedranm/workspace/mesa/src/compiler/tests/compare_ir': [Errno 2] No such
file or directory
Testing
./glsl/tests/lower_jumps/return_void_at_end_of_loop_lower_return.opt_test...FAIL
python2.7: can't open file
'/home/vedranm/workspace/mesa/src/compiler/tests/compare_ir': [Errno 2] No such
file or directory
Testing ./glsl/tests/lower_jumps/lower_returns_4.opt_test...FAIL
python2.7: can't open file
'/home/vedranm/workspace/mesa/src/compiler/tests/compare_ir': [Errno 2] No such
file or directory
Testing ./glsl/tests/lower_jumps/lower_pulled_out_jump.opt_test...FAIL
python2.7: can't open file
'/home/vedranm/workspace/mesa/src/compiler/tests/compare_ir': [Errno 2] No such
file or 

Re: [Mesa-dev] [PATCH] i965: Change INTEL_DEBUG=vec4 to INTEL_SCALAR_VS for consistency.

2017-06-03 Thread Jason Ekstrand
Acked-by: Jason Ekstrand 

On Sat, Jun 3, 2017 at 12:29 PM, Kenneth Graunke 
wrote:

> We moved to INTEL_SCALAR_* when we added more than a single stage, but
> never went back and converted the VS to work that way.  Be consistent.
>
> Also update the documentation to actually mention these debug variables.
> ---
>  docs/envvars.html | 2 +-
>  src/intel/common/gen_debug.c  | 1 -
>  src/intel/common/gen_debug.h  | 2 +-
>  src/intel/compiler/brw_compiler.c | 2 +-
>  4 files changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/docs/envvars.html b/docs/envvars.html
> index a970a6668a1..9e2f8163644 100644
> --- a/docs/envvars.html
> +++ b/docs/envvars.html
> @@ -200,10 +200,10 @@ See the Xlib software
> driver page for details.
> tes - dump shader assembly for tessellation evaluation shaders
> tex - emit messages about textures.
> urb - emit messages about URB setup
> -   vec4 - force vec4 mode in vertex shader
> vert - emit messages about vertex assembly
> vs - dump shader assembly for vertex shaders
>  
> +INTEL_SCALAR_VS (or TCS, TES, GS) - force scalar/vec4 mode for a
> shader stage (Gen8-9 only)
>  INTEL_PRECISE_TRIG - if set to 1, true or yes, then the driver prefers
> accuracy over performance in trig functions.
>  
> diff --git a/src/intel/common/gen_debug.c b/src/intel/common/gen_debug.c
> index f5702f009bc..b604d56ef86 100644
> --- a/src/intel/common/gen_debug.c
> +++ b/src/intel/common/gen_debug.c
> @@ -68,7 +68,6 @@ static const struct debug_control debug_control[] = {
> { "optimizer",   DEBUG_OPTIMIZER },
> { "ann", DEBUG_ANNOTATION },
> { "no8", DEBUG_NO8 },
> -   { "vec4",DEBUG_VEC4VS },
> { "spill_fs",DEBUG_SPILL_FS },
> { "spill_vec4",  DEBUG_SPILL_VEC4 },
> { "cs",  DEBUG_CS },
> diff --git a/src/intel/common/gen_debug.h b/src/intel/common/gen_debug.h
> index f7f59c9b5d8..d290303682e 100644
> --- a/src/intel/common/gen_debug.h
> +++ b/src/intel/common/gen_debug.h
> @@ -69,7 +69,7 @@ extern uint64_t INTEL_DEBUG;
>  #define DEBUG_OPTIMIZER   (1ull << 25)
>  #define DEBUG_ANNOTATION  (1ull << 26)
>  #define DEBUG_NO8 (1ull << 27)
> -#define DEBUG_VEC4VS  (1ull << 28)
> +/* Hole - feel free to reuse  (1ull << 28) */
>  #define DEBUG_SPILL_FS(1ull << 29)
>  #define DEBUG_SPILL_VEC4  (1ull << 30)
>  #define DEBUG_CS  (1ull << 31)
> diff --git a/src/intel/compiler/brw_compiler.c b/src/intel/compiler/brw_
> compiler.c
> index aa896b9a336..f31f29d2ade 100644
> --- a/src/intel/compiler/brw_compiler.c
> +++ b/src/intel/compiler/brw_compiler.c
> @@ -118,7 +118,7 @@ brw_compiler_create(void *mem_ctx, const struct
> gen_device_info *devinfo)
>   compiler->scalar_stage[i] = true;
> } else {
>compiler->scalar_stage[MESA_SHADER_VERTEX] =
> - devinfo->gen >= 8 && !(INTEL_DEBUG & DEBUG_VEC4VS);
> + devinfo->gen >= 8 && env_var_as_boolean("INTEL_SCALAR_VS",
> true);
>compiler->scalar_stage[MESA_SHADER_TESS_CTRL] =
>   devinfo->gen >= 8 && env_var_as_boolean("INTEL_SCALAR_TCS",
> true);
>compiler->scalar_stage[MESA_SHADER_TESS_EVAL] =
> --
> 2.13.0
>
> ___
> 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] i965: Change INTEL_DEBUG=vec4 to INTEL_SCALAR_VS for consistency.

2017-06-03 Thread Kenneth Graunke
We moved to INTEL_SCALAR_* when we added more than a single stage, but
never went back and converted the VS to work that way.  Be consistent.

Also update the documentation to actually mention these debug variables.
---
 docs/envvars.html | 2 +-
 src/intel/common/gen_debug.c  | 1 -
 src/intel/common/gen_debug.h  | 2 +-
 src/intel/compiler/brw_compiler.c | 2 +-
 4 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/docs/envvars.html b/docs/envvars.html
index a970a6668a1..9e2f8163644 100644
--- a/docs/envvars.html
+++ b/docs/envvars.html
@@ -200,10 +200,10 @@ See the Xlib software driver 
page for details.
tes - dump shader assembly for tessellation evaluation shaders
tex - emit messages about textures.
urb - emit messages about URB setup
-   vec4 - force vec4 mode in vertex shader
vert - emit messages about vertex assembly
vs - dump shader assembly for vertex shaders
 
+INTEL_SCALAR_VS (or TCS, TES, GS) - force scalar/vec4 mode for a shader 
stage (Gen8-9 only)
 INTEL_PRECISE_TRIG - if set to 1, true or yes, then the driver prefers
accuracy over performance in trig functions.
 
diff --git a/src/intel/common/gen_debug.c b/src/intel/common/gen_debug.c
index f5702f009bc..b604d56ef86 100644
--- a/src/intel/common/gen_debug.c
+++ b/src/intel/common/gen_debug.c
@@ -68,7 +68,6 @@ static const struct debug_control debug_control[] = {
{ "optimizer",   DEBUG_OPTIMIZER },
{ "ann", DEBUG_ANNOTATION },
{ "no8", DEBUG_NO8 },
-   { "vec4",DEBUG_VEC4VS },
{ "spill_fs",DEBUG_SPILL_FS },
{ "spill_vec4",  DEBUG_SPILL_VEC4 },
{ "cs",  DEBUG_CS },
diff --git a/src/intel/common/gen_debug.h b/src/intel/common/gen_debug.h
index f7f59c9b5d8..d290303682e 100644
--- a/src/intel/common/gen_debug.h
+++ b/src/intel/common/gen_debug.h
@@ -69,7 +69,7 @@ extern uint64_t INTEL_DEBUG;
 #define DEBUG_OPTIMIZER   (1ull << 25)
 #define DEBUG_ANNOTATION  (1ull << 26)
 #define DEBUG_NO8 (1ull << 27)
-#define DEBUG_VEC4VS  (1ull << 28)
+/* Hole - feel free to reuse  (1ull << 28) */
 #define DEBUG_SPILL_FS(1ull << 29)
 #define DEBUG_SPILL_VEC4  (1ull << 30)
 #define DEBUG_CS  (1ull << 31)
diff --git a/src/intel/compiler/brw_compiler.c 
b/src/intel/compiler/brw_compiler.c
index aa896b9a336..f31f29d2ade 100644
--- a/src/intel/compiler/brw_compiler.c
+++ b/src/intel/compiler/brw_compiler.c
@@ -118,7 +118,7 @@ brw_compiler_create(void *mem_ctx, const struct 
gen_device_info *devinfo)
  compiler->scalar_stage[i] = true;
} else {
   compiler->scalar_stage[MESA_SHADER_VERTEX] =
- devinfo->gen >= 8 && !(INTEL_DEBUG & DEBUG_VEC4VS);
+ devinfo->gen >= 8 && env_var_as_boolean("INTEL_SCALAR_VS", true);
   compiler->scalar_stage[MESA_SHADER_TESS_CTRL] =
  devinfo->gen >= 8 && env_var_as_boolean("INTEL_SCALAR_TCS", true);
   compiler->scalar_stage[MESA_SHADER_TESS_EVAL] =
-- 
2.13.0

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


[Mesa-dev] [Bug 100876] Variable GALLIUM_HUD_DUMP_DIR is not working with Wine LFS

2017-06-03 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=100876

--- Comment #5 from Edmondo Tommasina  ---
Hi Balázs

Did you have a chance to check mesa 17.1 if the problem is solved for you?

Thanks
edmondo

-- 
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] Mesa 17.1.2 release candidate

2017-06-03 Thread Jason Ekstrand
On Sat, Jun 3, 2017 at 11:30 AM, Juan A. Suarez Romero 
wrote:

> On Sat, 2017-06-03 at 11:10 -0700, Jason Ekstrand wrote:
>
> On Sat, Jun 3, 2017 at 10:05 AM, Juan A. Suarez Romero <
> jasua...@igalia.com> wrote:
>
> On Thu, 2017-06-01 at 16:35 -0700, Jason Ekstrand wrote:
>
> On Thu, Jun 1, 2017 at 4:20 PM, Juan A. Suarez Romero  > wrote:
>
> Hello list,
>
> The candidate for the Mesa 17.1.2 is now available. Currently we have:
>  - 51 queued
>  - 3 nominated (outstanding)
>  - and 9 rejected patch(es)
>
>
> The current queue contains fixes in several places.
>
> The current queue consists of:
>
> Several fixes in the autotools' configure that improves handling of target
> platforms.
>
> Mesa receives a fix for a leaking in a surface.
>
> OMX has a couple of fixes when building in a X11-less setup.
>
> ANV driver receives several fixes, like adding some missing transitions
> between layouts, or improvements in setting memory types and heaps.
>
> There are a few fixes in i965, R100, R200, Radeonsi/GFX9, Radv and
> Freedreno drivers.
>
> Also, EGL/Android receives a fix for a segfault that replaces a previous
> one that was not correct.
>
> Vulkan's Wayland gets some fixes, including the use of proxy wrappers for
> swapchains, or per-display event queue usage.
>
> Likewise EGL's Wayland now use per-surface event queues, as well as other
> fixes like ensuring back buffer is obtained.
>
> Take a look at section "Mesa stable queue" for more information.
>
>
> Testing reports/general approval
> 
>
> Any testing reports (or general approval of the state of the branch)
> will be greatly appreciated.
>
> The plan is to have 17.1.2 this Friday (3rd of June), around or
> shortly after 23:00 GMT.
>
> If you have any questions or suggestions - be that about the current
> patch queue or otherwise, please go ahead.
>
>
> Trivial merge conflicts
> ---
>
> commit e064f7d826812598749ce27868d9ff865c137ef4
> Author: Jason Ekstrand 
>
> anv: Set up memory types and heaps during physical device init
>
> (cherry picked from commit c1f4343807d1040bd7b5440aa2f5fccf5f12842d)
>
> commit ce2b96dd8b5a6c4ea0c80c6c0f46652a0b591515
> Author: Bas Nieuwenhuizen 
>
> radv: Reserve space for descriptor and push constant user SGPR setting.
>
> (cherry picked from commit 18efb404cfb38f722a16df7539390cf9a4a71929)
>
>
> Cheers,
> J.A.
>
>
> Mesa stable queue
> -
>
> Nominated (3)
> =
> Chad Versace(1):
>   i965/dri: Fix bad GL error in intel_create_winsys_renderbuffer()
>
> Jason Ekstrand(1):
>   i965: Rework Sandy Bridge HiZ and stencil layouts
>
>
> This just landed in master.
>
>
>
>
> Ok. I've included it in the Queued.
>
>
> Nicolas Dechesne(1):
>   util/rand_xor: add missing include statements
>
>
> Queued (51)
> ===
> Bartosz Tomczyk (1):
>   mesa: Avoid leaking surface in st_renderbuffer_delete
>
> Bas Nieuwenhuizen (1):
>   radv: Reserve space for descriptor and push constant user SGPR
> setting.
>
> Daniel Stone (7):
>   vulkan: Fix Wayland uninitialised registry
>   vulkan/wsi/wayland: Remove roundtrip when creating image
>   vulkan/wsi/wayland: Use per-display event queue
>   vulkan/wsi/wayland: Use proxy wrappers for swapchain
> Squashed with
>   vulkan/wsi/wayland: Fix proxy wrappers for swapchain recreation
>   egl/wayland: Don't open-code roundtrip
>   egl/wayland: Use per-surface event queues
> Squashed with
>   egl/wayland: verify event queue was allocated
>   egl/wayland: Ensure we get a back buffer
>
> Emil Velikov (24):
>   docs: add sha256 checksums for 17.1.1
>   configure: move platform handling further up
>   configure: rename remaining HAVE_EGL_PLATFORM_* guards
>   configure: update remaining --with-egl-platforms references
>   configure: loosen --with-platforms heuristics
>   configure: enable the surfaceless platform by default
>   configure: set HAVE_foo_PLATFORM as applicable
>   configure: error out when building GLX w/o the X11 platform
>   configure: check once for DRI3 dependencies
> Squashed with
>   configure.ac: add xcb-fixes to the XCB DRI3 list
> Squashed with
>   configure.ac: s/xcb-fixes/xcb-xfixes/
>   loader: build libloader_dri3_helper.la only with HAVE_PLATFORM_X11
>   configure: error out when building X11 Vulkan without DRI3
>   auxiliary/vl: use vl_*_screen_create stubs when building w/o platform
>   st/va: fix misplaced closing bracket
>   st/omx: remove unneeded X11 include
>   st/omx: fix building against X11-less setups
>   gallium/targets: link against XCB only as needed
>   configure: error out if building VA w/o supported platform
>   configure: error out if building OMX w/o supported platform
>   configure: error out if building VDPAU w/o supported 

Re: [Mesa-dev] [PATCH 2/2] radeonsi: move PSIZE and CLIPDIST unique IO indices after GENERIC

2017-06-03 Thread Edmondo Tommasina
It improves Uningine Heaven performance here (RX 470).

Before: 47.5
After: 47.7

For this series:
Tested-by: Edmondo Tommasina 

Thanks
edmondo


On Sat, Jun 3, 2017 at 6:04 PM, Marek Olšák  wrote:
> From: Marek Olšák 
>
> Heaven LDS usage for LS+HS is below. The masks are "outputs_written"
> for LS and HS. Note that 32K is the maximum size.
>
> Before:
>   heaven_x64: ls=1f1 tcs=1f1, lds=32K
>   heaven_x64: ls=31 tcs=31, lds=24K
>   heaven_x64: ls=71 tcs=71, lds=28K
>
> After:
>   heaven_x64: ls=3f tcs=3f, lds=24K
>   heaven_x64: ls=7 tcs=7, lds=13K
>   heaven_x64: ls=f tcs=f, lds=17K
>
> All other apps have a similar decrease in LDS usage, because
> the "outputs_written" masks are similar. Also, most apps don't write
> POSITION in these shader stages, so there is room for improvement.
> (tight per-component input/output packing might help even more)
>
> It's unknown whether this improves performance.
> ---
>  src/gallium/drivers/radeonsi/si_shader.c| 18 +++---
>  src/gallium/drivers/radeonsi/si_state_shaders.c |  4 +++-
>  2 files changed, 14 insertions(+), 8 deletions(-)
>
> diff --git a/src/gallium/drivers/radeonsi/si_shader.c 
> b/src/gallium/drivers/radeonsi/si_shader.c
> index ddfaa3b..3a86c0b 100644
> --- a/src/gallium/drivers/radeonsi/si_shader.c
> +++ b/src/gallium/drivers/radeonsi/si_shader.c
> @@ -129,32 +129,36 @@ unsigned si_shader_io_get_unique_index_patch(unsigned 
> semantic_name, unsigned in
>  /**
>   * Returns a unique index for a semantic name and index. The index must be
>   * less than 64, so that a 64-bit bitmask of used inputs or outputs can be
>   * calculated.
>   */
>  unsigned si_shader_io_get_unique_index(unsigned semantic_name, unsigned 
> index)
>  {
> switch (semantic_name) {
> case TGSI_SEMANTIC_POSITION:
> return 0;
> -   case TGSI_SEMANTIC_PSIZE:
> -   return 1;
> -   case TGSI_SEMANTIC_CLIPDIST:
> -   assert(index <= 1);
> -   return 2 + index;
> case TGSI_SEMANTIC_GENERIC:
> +   /* Since some shader stages use the the highest used IO index
> +* to determine the size to allocate for inputs/outputs
> +* (in LDS, tess and GS rings). GENERIC should be placed right
> +* after POSITION to make that size as small as possible.
> +*/
> if (index < SI_MAX_IO_GENERIC)
> -   return 4 + index;
> +   return 1 + index;
>
> assert(!"invalid generic index");
> return 0;
> -
> +   case TGSI_SEMANTIC_PSIZE:
> +   return SI_MAX_IO_GENERIC + 1;
> +   case TGSI_SEMANTIC_CLIPDIST:
> +   assert(index <= 1);
> +   return SI_MAX_IO_GENERIC + 2 + index;
> case TGSI_SEMANTIC_FOG:
> return SI_MAX_IO_GENERIC + 4;
> case TGSI_SEMANTIC_LAYER:
> return SI_MAX_IO_GENERIC + 5;
> case TGSI_SEMANTIC_VIEWPORT_INDEX:
> return SI_MAX_IO_GENERIC + 6;
> case TGSI_SEMANTIC_PRIMID:
> return SI_MAX_IO_GENERIC + 7;
> case TGSI_SEMANTIC_COLOR: /* these alias */
> case TGSI_SEMANTIC_BCOLOR:
> diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.c 
> b/src/gallium/drivers/radeonsi/si_state_shaders.c
> index 8ac4309..f36997b 100644
> --- a/src/gallium/drivers/radeonsi/si_state_shaders.c
> +++ b/src/gallium/drivers/radeonsi/si_state_shaders.c
> @@ -1226,21 +1226,23 @@ static void si_shader_selector_key_hw_vs(struct 
> si_context *sctx,
> ps_disabled = 
> sctx->queued.named.rasterizer->rasterizer_discard ||
>   (!ps_colormask &&
>!ps_modifies_zs &&
>!ps->info.writes_memory);
> }
>
> /* Find out which VS outputs aren't used by the PS. */
> uint64_t outputs_written = vs->outputs_written;
> uint64_t inputs_read = 0;
>
> -   outputs_written &= ~0x3; /* ignore POSITION, PSIZE */
> +   /* ignore POSITION, PSIZE */
> +   outputs_written &= ~((1ull << 
> si_shader_io_get_unique_index(TGSI_SEMANTIC_POSITION, 0) |
> +(1ull << 
> si_shader_io_get_unique_index(TGSI_SEMANTIC_PSIZE, 0;
>
> if (!ps_disabled) {
> inputs_read = ps->inputs_read;
> }
>
> uint64_t linked = outputs_written & inputs_read;
>
> key->opt.hw_vs.kill_outputs = ~linked & outputs_written;
>  }
>
> --
> 2.7.4
>
> ___
> 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] Mesa 17.1.2 release candidate

2017-06-03 Thread Juan A. Suarez Romero
On Sat, 2017-06-03 at 11:10 -0700, Jason Ekstrand wrote:
> On Sat, Jun 3, 2017 at 10:05 AM, Juan A. Suarez Romero  ia.com> wrote:
> > On Thu, 2017-06-01 at 16:35 -0700, Jason Ekstrand wrote:
> > > On Thu, Jun 1, 2017 at 4:20 PM, Juan A. Suarez Romero  > > galia.com> wrote:
> > > > Hello list,
> > > > 
> > > > 
> > > > 
> > > > The candidate for the Mesa 17.1.2 is now available. Currently
> > > > we have:
> > > > 
> > > >  - 51 queued
> > > > 
> > > >  - 3 nominated (outstanding)
> > > > 
> > > >  - and 9 rejected patch(es)
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > The current queue contains fixes in several places.
> > > > 
> > > > 
> > > > 
> > > > The current queue consists of:
> > > > 
> > > > 
> > > > 
> > > > Several fixes in the autotools' configure that improves
> > > > handling of target platforms.
> > > > 
> > > > 
> > > > 
> > > > Mesa receives a fix for a leaking in a surface.
> > > > 
> > > > 
> > > > 
> > > > OMX has a couple of fixes when building in a X11-less setup.
> > > > 
> > > > 
> > > > 
> > > > ANV driver receives several fixes, like adding some missing
> > > > transitions between layouts, or improvements in setting memory
> > > > types and heaps.
> > > > 
> > > > 
> > > > 
> > > > There are a few fixes in i965, R100, R200, Radeonsi/GFX9, Radv
> > > > and Freedreno drivers.
> > > > 
> > > > 
> > > > 
> > > > Also, EGL/Android receives a fix for a segfault that replaces a
> > > > previous one that was not correct.
> > > > 
> > > > 
> > > > 
> > > > Vulkan's Wayland gets some fixes, including the use of proxy
> > > > wrappers for swapchains, or per-display event queue usage.
> > > > 
> > > > 
> > > > 
> > > > Likewise EGL's Wayland now use per-surface event queues, as
> > > > well as other fixes like ensuring back buffer is obtained.
> > > > 
> > > > 
> > > > 
> > > > Take a look at section "Mesa stable queue" for more
> > > > information.
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > Testing reports/general approval
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > Any testing reports (or general approval of the state of the
> > > > branch)
> > > > 
> > > > will be greatly appreciated.
> > > > 
> > > > 
> > > > 
> > > > The plan is to have 17.1.2 this Friday (3rd of June), around or
> > > > 
> > > > shortly after 23:00 GMT.
> > > > 
> > > > 
> > > > 
> > > > If you have any questions or suggestions - be that about the
> > > > current
> > > > 
> > > > patch queue or otherwise, please go ahead.
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > Trivial merge conflicts
> > > > 
> > > > ---
> > > > 
> > > > 
> > > > 
> > > > commit e064f7d826812598749ce27868d9ff865c137ef4
> > > > 
> > > > Author: Jason Ekstrand 
> > > > 
> > > > 
> > > > 
> > > > anv: Set up memory types and heaps during physical device
> > > > init
> > > > 
> > > > 
> > > > 
> > > > (cherry picked from commit
> > > > c1f4343807d1040bd7b5440aa2f5fccf5f12842d)
> > > > 
> > > > 
> > > > 
> > > > commit ce2b96dd8b5a6c4ea0c80c6c0f46652a0b591515
> > > > 
> > > > Author: Bas Nieuwenhuizen 
> > > > 
> > > > 
> > > > 
> > > > radv: Reserve space for descriptor and push constant user
> > > > SGPR setting.
> > > > 
> > > > 
> > > > 
> > > > (cherry picked from commit
> > > > 18efb404cfb38f722a16df7539390cf9a4a71929)
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > Cheers,
> > > > 
> > > > J.A.
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > Mesa stable queue
> > > > 
> > > > -
> > > > 
> > > > 
> > > > 
> > > > Nominated (3)
> > > > 
> > > > =
> > > > 
> > > > Chad Versace(1):
> > > > 
> > > >       i965/dri: Fix bad GL error in
> > > > intel_create_winsys_renderbuffer()
> > > > 
> > > > 
> > > > 
> > > > Jason Ekstrand(1):
> > > > 
> > > >       i965: Rework Sandy Bridge HiZ and stencil layouts
> > > 
> > > This just landed in master.
> > >  
> > 
> > 
> > Ok. I've included it in the Queued.
> > 
> > 
> > > > Nicolas Dechesne(1):
> > > > 
> > > >       util/rand_xor: add missing include statements
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > Queued (51)
> > > > 
> > > > ===
> > > > 
> > > > Bartosz Tomczyk (1):
> > > > 
> > > >       mesa: Avoid leaking surface in st_renderbuffer_delete
> > > > 
> > > > 
> > > > 
> > > > Bas Nieuwenhuizen (1):
> > > > 
> > > >       radv: Reserve space for descriptor and push constant user
> > > > SGPR setting.
> > > > 
> > > > 
> > > > 
> > > > Daniel Stone (7):
> > > > 
> > > >       vulkan: Fix Wayland uninitialised registry
> > > > 
> > > >       vulkan/wsi/wayland: Remove roundtrip when creating image
> > > > 
> > > >       vulkan/wsi/wayland: Use per-display event queue
> > > > 
> > > >       vulkan/wsi/wayland: Use proxy wrappers for swapchain
> > > > 
> > > > Squashed with
> > > > 
> > > >       vulkan/wsi/wayland: Fix proxy wrappers for swapchain
> > > > recreation
> 

[Mesa-dev] [PATCH 4/7] util: Port nir_array functionality to u_dynarray

2017-06-03 Thread Thomas Helland
---
 src/gallium/drivers/freedreno/freedreno_batch.c  |  6 +--
 src/gallium/drivers/nouveau/nv30/nvfx_fragprog.c |  2 +-
 src/gallium/drivers/nouveau/nv30/nvfx_vertprog.c |  2 +-
 src/gallium/drivers/nouveau/nv50/nv50_context.c  |  2 +-
 src/gallium/drivers/nouveau/nvc0/nvc0_context.c  |  2 +-
 src/gallium/state_trackers/va/surface.c  |  2 +-
 src/util/u_dynarray.h| 47 +++-
 7 files changed, 45 insertions(+), 18 deletions(-)

diff --git a/src/gallium/drivers/freedreno/freedreno_batch.c 
b/src/gallium/drivers/freedreno/freedreno_batch.c
index 5783ee8005..ce44e81355 100644
--- a/src/gallium/drivers/freedreno/freedreno_batch.c
+++ b/src/gallium/drivers/freedreno/freedreno_batch.c
@@ -76,14 +76,14 @@ batch_init(struct fd_batch *batch)
batch->max_scissor.minx = batch->max_scissor.miny = ~0;
batch->max_scissor.maxx = batch->max_scissor.maxy = 0;
 
-   util_dynarray_init(>draw_patches);
+   util_dynarray_init(>draw_patches, NULL);
 
if (is_a3xx(ctx->screen))
-   util_dynarray_init(>rbrc_patches);
+   util_dynarray_init(>rbrc_patches, NULL);
 
assert(batch->resources->entries == 0);
 
-   util_dynarray_init(>samples);
+   util_dynarray_init(>samples, NULL);
 }
 
 struct fd_batch *
diff --git a/src/gallium/drivers/nouveau/nv30/nvfx_fragprog.c 
b/src/gallium/drivers/nouveau/nv30/nvfx_fragprog.c
index 61a5701284..278a8a4a43 100644
--- a/src/gallium/drivers/nouveau/nv30/nvfx_fragprog.c
+++ b/src/gallium/drivers/nouveau/nv30/nvfx_fragprog.c
@@ -1119,7 +1119,7 @@ _nvfx_fragprog_translate(uint16_t oclass, struct 
nv30_fragprog *fp)
   goto out_err;
 
tgsi_parse_init(, fp->pipe.tokens);
-   util_dynarray_init();
+   util_dynarray_init(, NULL);
 
while (!tgsi_parse_end_of_tokens()) {
   tgsi_parse_token();
diff --git a/src/gallium/drivers/nouveau/nv30/nvfx_vertprog.c 
b/src/gallium/drivers/nouveau/nv30/nvfx_vertprog.c
index 03d711a4ce..bec9975de9 100644
--- a/src/gallium/drivers/nouveau/nv30/nvfx_vertprog.c
+++ b/src/gallium/drivers/nouveau/nv30/nvfx_vertprog.c
@@ -998,7 +998,7 @@ _nvfx_vertprog_translate(uint16_t oclass, struct 
nv30_vertprog *vp)
   vpc->cvtx_idx = vpc->hpos_idx;
}
 
-   util_dynarray_init();
+   util_dynarray_init(, NULL);
 
tgsi_parse_init(, vp->pipe.tokens);
while (!tgsi_parse_end_of_tokens()) {
diff --git a/src/gallium/drivers/nouveau/nv50/nv50_context.c 
b/src/gallium/drivers/nouveau/nv50/nv50_context.c
index 1ca6a0a178..61243438fc 100644
--- a/src/gallium/drivers/nouveau/nv50/nv50_context.c
+++ b/src/gallium/drivers/nouveau/nv50/nv50_context.c
@@ -377,7 +377,7 @@ nv50_create(struct pipe_screen *pscreen, void *priv, 
unsigned ctxflags)
 
nv50->base.scratch.bo_size = 2 << 20;
 
-   util_dynarray_init(>global_residents);
+   util_dynarray_init(>global_residents, NULL);
 
return pipe;
 
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_context.c 
b/src/gallium/drivers/nouveau/nvc0/nvc0_context.c
index 59edd3d7e6..d5ef5851da 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_context.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_context.c
@@ -461,7 +461,7 @@ nvc0_create(struct pipe_screen *pscreen, void *priv, 
unsigned ctxflags)
 
memset(nvc0->tex_handles, ~0, sizeof(nvc0->tex_handles));
 
-   util_dynarray_init(>global_residents);
+   util_dynarray_init(>global_residents, NULL);
 
return pipe;
 
diff --git a/src/gallium/state_trackers/va/surface.c 
b/src/gallium/state_trackers/va/surface.c
index c7d6ef7c8c..f968e9ede1 100644
--- a/src/gallium/state_trackers/va/surface.c
+++ b/src/gallium/state_trackers/va/surface.c
@@ -749,7 +749,7 @@ vlVaCreateSurfaces2(VADriverContextP ctx, unsigned int 
format,
  assert(0);
   }
 
-  util_dynarray_init(>subpics);
+  util_dynarray_init(>subpics, NULL);
   surfaces[i] = handle_table_add(drv->htab, surf);
   if (!surfaces[i]) {
  vaStatus = VA_STATUS_ERROR_ALLOCATION_FAILED;
diff --git a/src/util/u_dynarray.h b/src/util/u_dynarray.h
index 9143c5a60d..ad3889a7c8 100644
--- a/src/util/u_dynarray.h
+++ b/src/util/u_dynarray.h
@@ -28,6 +28,7 @@
 #define U_DYNARRAY_H
 
 #include 
+#include "ralloc.h"
 
 /* A zero-initialized version of this is guaranteed to represent an
  * empty array.
@@ -37,37 +38,51 @@
  */
 struct util_dynarray
 {
+   void *mem_ctx;
void *data;
unsigned size;
unsigned capacity;
 };
 
 static inline void
-util_dynarray_init(struct util_dynarray *buf)
+util_dynarray_init(struct util_dynarray *buf, void *mem_ctx)
 {
memset(buf, 0, sizeof(*buf));
+   buf->mem_ctx = mem_ctx;
 }
 
 static inline void
 util_dynarray_fini(struct util_dynarray *buf)
 {
if (buf->data) {
-  free(buf->data);
-  util_dynarray_init(buf);
+  if (buf->mem_ctx) {
+ ralloc_free(buf->data);
+  } else {
+ free(buf->data);
+  }
+  util_dynarray_init(buf, buf->mem_ctx);
}
 }
 
+#define DYN_ARRAY_INITIAL_SIZE 64
+
 /* 

[Mesa-dev] [PATCH 5/7] nir: Remove unused include

2017-06-03 Thread Thomas Helland
---
 src/compiler/nir/nir_lower_locals_to_regs.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/compiler/nir/nir_lower_locals_to_regs.c 
b/src/compiler/nir/nir_lower_locals_to_regs.c
index f1af237b5e..d0667bc504 100644
--- a/src/compiler/nir/nir_lower_locals_to_regs.c
+++ b/src/compiler/nir/nir_lower_locals_to_regs.c
@@ -26,7 +26,6 @@
  */
 
 #include "nir.h"
-#include "nir_array.h"
 
 struct locals_to_regs_state {
nir_shader *shader;
-- 
2.13.0

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


[Mesa-dev] [PATCH 6/7] nir: Port to u_dynarray and delete nir_array

2017-06-03 Thread Thomas Helland
---
 src/compiler/Makefile.sources|  1 -
 src/compiler/nir/nir_array.h | 99 
 src/compiler/spirv/vtn_cfg.c |  6 +--
 src/compiler/spirv/vtn_private.h |  4 +-
 4 files changed, 5 insertions(+), 105 deletions(-)
 delete mode 100644 src/compiler/nir/nir_array.h

diff --git a/src/compiler/Makefile.sources b/src/compiler/Makefile.sources
index b2a3a42818..d3447fb9de 100644
--- a/src/compiler/Makefile.sources
+++ b/src/compiler/Makefile.sources
@@ -186,7 +186,6 @@ NIR_GENERATED_FILES = \
 NIR_FILES = \
nir/nir.c \
nir/nir.h \
-   nir/nir_array.h \
nir/nir_builder.h \
nir/nir_clone.c \
nir/nir_constant_expressions.h \
diff --git a/src/compiler/nir/nir_array.h b/src/compiler/nir/nir_array.h
deleted file mode 100644
index 4d7a532a7f..00
--- a/src/compiler/nir/nir_array.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Copyright © 2015 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- *
- * Authors:
- *Jason Ekstrand (ja...@jlekstrand.net)
- *
- */
-
-#ifndef NIR_ARRAY_H
-#define NIR_ARRAY_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct {
-   void *mem_ctx;
-   size_t size;
-   size_t alloc;
-   void *data;
-} nir_array;
-
-static inline void
-nir_array_init(nir_array *arr, void *mem_ctx)
-{
-   arr->mem_ctx = mem_ctx;
-   arr->size = 0;
-   arr->alloc = 0;
-   arr->data = NULL;
-}
-
-static inline void
-nir_array_fini(nir_array *arr)
-{
-   if (arr->mem_ctx)
-  ralloc_free(arr->data);
-   else
-  free(arr->data);
-}
-
-#define NIR_ARRAY_INITIAL_SIZE 64
-
-/* Increments the size of the array by the given ammount and returns a
- * pointer to the beginning of the newly added space.
- */
-static inline void *
-nir_array_grow(nir_array *arr, size_t additional)
-{
-   size_t new_size = arr->size + additional;
-   if (new_size > arr->alloc) {
-  if (arr->alloc == 0)
- arr->alloc = NIR_ARRAY_INITIAL_SIZE;
-
-  while (new_size > arr->alloc)
- arr->alloc *= 2;
-
-  if (arr->mem_ctx)
- arr->data = reralloc_size(arr->mem_ctx, arr->data, arr->alloc);
-  else
- arr->data = realloc(arr->data, arr->alloc);
-   }
-
-   void *ptr = (void *)((char *)arr->data + arr->size);
-   arr->size = new_size;
-
-   return ptr;
-}
-
-#define nir_array_add(arr, type, elem) \
-   *(type *)nir_array_grow(arr, sizeof(type)) = (elem)
-
-#define nir_array_foreach(arr, type, elem) \
-   for (type *elem = (type *)(arr)->data; \
-elem < (type *)((char *)(arr)->data + (arr)->size); elem++)
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#endif /* NIR_ARRAY_H */
diff --git a/src/compiler/spirv/vtn_cfg.c b/src/compiler/spirv/vtn_cfg.c
index 54248b111d..50ef767dea 100644
--- a/src/compiler/spirv/vtn_cfg.c
+++ b/src/compiler/spirv/vtn_cfg.c
@@ -183,7 +183,7 @@ vtn_add_case(struct vtn_builder *b, struct vtn_switch 
*swtch,
   list_inithead(>body);
   c->start_block = case_block;
   c->fallthrough = NULL;
-  nir_array_init(>values, b);
+  util_dynarray_init(>values, b);
   c->is_default = false;
   c->visited = false;
 
@@ -195,7 +195,7 @@ vtn_add_case(struct vtn_builder *b, struct vtn_switch 
*swtch,
if (is_default) {
   case_block->switch_case->is_default = true;
} else {
-  nir_array_add(_block->switch_case->values, uint32_t, val);
+  util_dynarray_append(_block->switch_case->values, uint32_t, val);
}
 }
 
@@ -709,7 +709,7 @@ vtn_emit_cf_list(struct vtn_builder *b, struct list_head 
*cf_list,
 }
 
 nir_ssa_def *cond = NULL;
-nir_array_foreach(>values, uint32_t, val) {
+util_dynarray_foreach(>values, uint32_t, val) {
nir_ssa_def *is_val =
   nir_ieq(>nb, sel, nir_imm_int(>nb, *val));
 
diff --git a/src/compiler/spirv/vtn_private.h b/src/compiler/spirv/vtn_private.h
index 

[Mesa-dev] [PATCH 7/7] util: Add extern c to u_dynarray.h

2017-06-03 Thread Thomas Helland
---
 src/util/u_dynarray.h | 8 
 1 file changed, 8 insertions(+)

diff --git a/src/util/u_dynarray.h b/src/util/u_dynarray.h
index ad3889a7c8..e9109ccd2d 100644
--- a/src/util/u_dynarray.h
+++ b/src/util/u_dynarray.h
@@ -30,6 +30,10 @@
 #include 
 #include "ralloc.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* A zero-initialized version of this is guaranteed to represent an
  * empty array.
  *
@@ -134,5 +138,9 @@ util_dynarray_trim(struct util_dynarray *buf)
for (type *elem = (type *)(buf)->data; \
 elem < (type *)((char *)(buf)->data + (buf)->size); elem++)
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* U_DYNARRAY_H */
 
-- 
2.13.0

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


[Mesa-dev] [PATCH 0/7] Unify our two dynamic array implementations

2017-06-03 Thread Thomas Helland
We currently have two dynamic array implementations in mesa.
One lives in nir, and is used in only one location, and the
other lives in galliums util directory. Let's merge these two,
so that we can get the best of both worlds.

This series uses the u_dynarray from gallium as the basis,
and merges in the nir_array's iterator and support for using
ralloc for memory handling. It then ports the user of nir_array,
and deletes it.

I have not tested this on freedreno, as I'm having some issues
building it. It seems to be the only user of u_dynarray that
I have not been able to at least build-test, so there might be
similar include-related issues as uncovered for nouveau.

I still have to do some thorough testing, but I tested a quick
run with shader-db, and there where no immediate crashes and
no ir validation failures, so that counts for something.

Let me know what you think. A disadvantage is the slightly
higher memory usage due to the extra pointer stored for the
ralloc mem_ctx compared to u_dynarray before this series.

Thomas Helland (7):
  gallium: Add missing includes
  util: Move u_dynarray to src/util
  util: Remove unused includes and convert to lower-case memory ops
  util: Port nir_array functionality to u_dynarray
  nir: Remove unused include
  nir: Port to u_dynarray and delete nir_array
  util: Add extern c to u_dynarray.h

 src/compiler/Makefile.sources|  1 -
 src/compiler/nir/nir_array.h | 99 
 src/compiler/nir/nir_lower_locals_to_regs.c  |  1 -
 src/compiler/spirv/vtn_cfg.c |  6 +-
 src/compiler/spirv/vtn_private.h |  4 +-
 src/gallium/auxiliary/Makefile.sources   |  1 -
 src/gallium/drivers/freedreno/freedreno_batch.c  |  6 +-
 src/gallium/drivers/nouveau/nv30/nvfx_fragprog.c |  3 +-
 src/gallium/drivers/nouveau/nv30/nvfx_vertprog.c |  3 +-
 src/gallium/drivers/nouveau/nv50/nv50_context.c  |  2 +-
 src/gallium/drivers/nouveau/nvc0/nvc0_context.c  |  2 +-
 src/gallium/state_trackers/va/config.c   |  1 +
 src/gallium/state_trackers/va/postproc.c |  1 +
 src/gallium/state_trackers/va/surface.c  |  2 +-
 src/util/Makefile.sources|  1 +
 src/{gallium/auxiliary => }/util/u_dynarray.h| 72 -
 16 files changed, 70 insertions(+), 135 deletions(-)
 delete mode 100644 src/compiler/nir/nir_array.h
 rename src/{gallium/auxiliary => }/util/u_dynarray.h (70%)

-- 
2.13.0

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


[Mesa-dev] [PATCH 1/7] gallium: Add missing includes

2017-06-03 Thread Thomas Helland
These will need to be in place to avoid regressions when
removing these includes from u_dynarray
---
 src/gallium/drivers/nouveau/nv30/nvfx_fragprog.c | 1 +
 src/gallium/drivers/nouveau/nv30/nvfx_vertprog.c | 1 +
 src/gallium/state_trackers/va/config.c   | 1 +
 src/gallium/state_trackers/va/postproc.c | 1 +
 4 files changed, 4 insertions(+)

diff --git a/src/gallium/drivers/nouveau/nv30/nvfx_fragprog.c 
b/src/gallium/drivers/nouveau/nv30/nvfx_fragprog.c
index 4924d21f4c..61a5701284 100644
--- a/src/gallium/drivers/nouveau/nv30/nvfx_fragprog.c
+++ b/src/gallium/drivers/nouveau/nv30/nvfx_fragprog.c
@@ -5,6 +5,7 @@
 #include "util/u_dynarray.h"
 #include "util/u_inlines.h"
 #include "util/u_debug.h"
+#include "util/u_memory.h"
 
 #include "pipe/p_shader_tokens.h"
 #include "tgsi/tgsi_parse.h"
diff --git a/src/gallium/drivers/nouveau/nv30/nvfx_vertprog.c 
b/src/gallium/drivers/nouveau/nv30/nvfx_vertprog.c
index baea701a02..03d711a4ce 100644
--- a/src/gallium/drivers/nouveau/nv30/nvfx_vertprog.c
+++ b/src/gallium/drivers/nouveau/nv30/nvfx_vertprog.c
@@ -4,6 +4,7 @@
 #include "pipe/p_state.h"
 #include "util/u_dynarray.h"
 #include "util/u_debug.h"
+#include "util/u_memory.h"
 
 #include "pipe/p_shader_tokens.h"
 #include "tgsi/tgsi_parse.h"
diff --git a/src/gallium/state_trackers/va/config.c 
b/src/gallium/state_trackers/va/config.c
index 05f97a01ee..c5d69bdc97 100644
--- a/src/gallium/state_trackers/va/config.c
+++ b/src/gallium/state_trackers/va/config.c
@@ -29,6 +29,7 @@
 #include "pipe/p_screen.h"
 
 #include "util/u_video.h"
+#include "util/u_memory.h"
 
 #include "vl/vl_winsys.h"
 
diff --git a/src/gallium/state_trackers/va/postproc.c 
b/src/gallium/state_trackers/va/postproc.c
index 8467b0e8f4..5b23891c37 100644
--- a/src/gallium/state_trackers/va/postproc.c
+++ b/src/gallium/state_trackers/va/postproc.c
@@ -26,6 +26,7 @@
  **/
 
 #include "util/u_handle_table.h"
+#include "util/u_memory.h"
 
 #include "vl/vl_defines.h"
 #include "vl/vl_video_buffer.h"
-- 
2.13.0

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


[Mesa-dev] [PATCH 3/7] util: Remove unused includes and convert to lower-case memory ops

2017-06-03 Thread Thomas Helland
Also, prepare for the next commit by correcting some coding style
changes. This should be all non-functional changes.
---
 src/util/u_dynarray.h | 27 ---
 1 file changed, 12 insertions(+), 15 deletions(-)

diff --git a/src/util/u_dynarray.h b/src/util/u_dynarray.h
index 7b7a093d82..9143c5a60d 100644
--- a/src/util/u_dynarray.h
+++ b/src/util/u_dynarray.h
@@ -27,8 +27,7 @@
 #ifndef U_DYNARRAY_H
 #define U_DYNARRAY_H
 
-#include "pipe/p_compiler.h"
-#include "util/u_memory.h"
+#include 
 
 /* A zero-initialized version of this is guaranteed to represent an
  * empty array.
@@ -52,9 +51,8 @@ util_dynarray_init(struct util_dynarray *buf)
 static inline void
 util_dynarray_fini(struct util_dynarray *buf)
 {
-   if(buf->data)
-   {
-  FREE(buf->data);
+   if (buf->data) {
+  free(buf->data);
   util_dynarray_init(buf);
}
 }
@@ -63,18 +61,18 @@ util_dynarray_fini(struct util_dynarray *buf)
 static inline void *
 util_dynarray_resize(struct util_dynarray *buf, unsigned newsize)
 {
-   char *p;
-   if(newsize > buf->capacity)
-   {
+   void *p;
+   if (newsize > buf->capacity) {
   unsigned newcap = buf->capacity << 1;
-  if(newsize > newcap)
+  if (newsize > newcap)
  newcap = newsize;
-  buf->data = REALLOC(buf->data, buf->capacity, newcap);
+  buf->data = realloc(buf->data, newcap);
   buf->capacity = newcap;
}
 
-   p = (char *)buf->data + buf->size;
+   p = (void *)((char *)buf->data + buf->size);
buf->size = newsize;
+
return p;
 }
 
@@ -89,11 +87,10 @@ util_dynarray_trim(struct util_dynarray *buf)
 {
if (buf->size != buf->capacity) {
   if (buf->size) {
- buf->data = REALLOC(buf->data, buf->capacity, buf->size);
+ buf->data = realloc(buf->data, buf->size);
  buf->capacity = buf->size;
-  }
-  else {
- FREE(buf->data);
+  } else {
+ free(buf->data);
  buf->data = 0;
  buf->capacity = 0;
   }
-- 
2.13.0

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


[Mesa-dev] [PATCH 2/7] util: Move u_dynarray to src/util

2017-06-03 Thread Thomas Helland
This will be used as the basis for unification
---
 src/gallium/auxiliary/Makefile.sources| 1 -
 src/util/Makefile.sources | 1 +
 src/{gallium/auxiliary => }/util/u_dynarray.h | 0
 3 files changed, 1 insertion(+), 1 deletion(-)
 rename src/{gallium/auxiliary => }/util/u_dynarray.h (100%)

diff --git a/src/gallium/auxiliary/Makefile.sources 
b/src/gallium/auxiliary/Makefile.sources
index 0e450ab3d7..99ab0c00bb 100644
--- a/src/gallium/auxiliary/Makefile.sources
+++ b/src/gallium/auxiliary/Makefile.sources
@@ -221,7 +221,6 @@ C_SOURCES := \
util/u_dump_defines.c \
util/u_dump.h \
util/u_dump_state.c \
-   util/u_dynarray.h \
util/u_fifo.h \
util/u_format.c \
util/u_format.h \
diff --git a/src/util/Makefile.sources b/src/util/Makefile.sources
index e9057343dc..5f098c3831 100644
--- a/src/util/Makefile.sources
+++ b/src/util/Makefile.sources
@@ -45,6 +45,7 @@ MESA_UTIL_FILES := \
texcompress_rgtc_tmp.h \
u_atomic.c \
u_atomic.h \
+   u_dynarray.h \
u_endian.h \
u_queue.c \
u_queue.h \
diff --git a/src/gallium/auxiliary/util/u_dynarray.h b/src/util/u_dynarray.h
similarity index 100%
rename from src/gallium/auxiliary/util/u_dynarray.h
rename to src/util/u_dynarray.h
-- 
2.13.0

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


Re: [Mesa-dev] Mesa 17.1.2 release candidate

2017-06-03 Thread Jason Ekstrand
On Sat, Jun 3, 2017 at 10:05 AM, Juan A. Suarez Romero 
wrote:

> On Thu, 2017-06-01 at 16:35 -0700, Jason Ekstrand wrote:
>
> On Thu, Jun 1, 2017 at 4:20 PM, Juan A. Suarez Romero  > wrote:
>
> Hello list,
>
> The candidate for the Mesa 17.1.2 is now available. Currently we have:
>  - 51 queued
>  - 3 nominated (outstanding)
>  - and 9 rejected patch(es)
>
>
> The current queue contains fixes in several places.
>
> The current queue consists of:
>
> Several fixes in the autotools' configure that improves handling of target
> platforms.
>
> Mesa receives a fix for a leaking in a surface.
>
> OMX has a couple of fixes when building in a X11-less setup.
>
> ANV driver receives several fixes, like adding some missing transitions
> between layouts, or improvements in setting memory types and heaps.
>
> There are a few fixes in i965, R100, R200, Radeonsi/GFX9, Radv and
> Freedreno drivers.
>
> Also, EGL/Android receives a fix for a segfault that replaces a previous
> one that was not correct.
>
> Vulkan's Wayland gets some fixes, including the use of proxy wrappers for
> swapchains, or per-display event queue usage.
>
> Likewise EGL's Wayland now use per-surface event queues, as well as other
> fixes like ensuring back buffer is obtained.
>
> Take a look at section "Mesa stable queue" for more information.
>
>
> Testing reports/general approval
> 
>
> Any testing reports (or general approval of the state of the branch)
> will be greatly appreciated.
>
> The plan is to have 17.1.2 this Friday (3rd of June), around or
> shortly after 23:00 GMT.
>
> If you have any questions or suggestions - be that about the current
> patch queue or otherwise, please go ahead.
>
>
> Trivial merge conflicts
> ---
>
> commit e064f7d826812598749ce27868d9ff865c137ef4
> Author: Jason Ekstrand 
>
> anv: Set up memory types and heaps during physical device init
>
> (cherry picked from commit c1f4343807d1040bd7b5440aa2f5fccf5f12842d)
>
> commit ce2b96dd8b5a6c4ea0c80c6c0f46652a0b591515
> Author: Bas Nieuwenhuizen 
>
> radv: Reserve space for descriptor and push constant user SGPR setting.
>
> (cherry picked from commit 18efb404cfb38f722a16df7539390cf9a4a71929)
>
>
> Cheers,
> J.A.
>
>
> Mesa stable queue
> -
>
> Nominated (3)
> =
> Chad Versace(1):
>   i965/dri: Fix bad GL error in intel_create_winsys_renderbuffer()
>
> Jason Ekstrand(1):
>   i965: Rework Sandy Bridge HiZ and stencil layouts
>
>
> This just landed in master.
>
>
>
>
> Ok. I've included it in the Queued.
>
>
> Nicolas Dechesne(1):
>   util/rand_xor: add missing include statements
>
>
> Queued (51)
> ===
> Bartosz Tomczyk (1):
>   mesa: Avoid leaking surface in st_renderbuffer_delete
>
> Bas Nieuwenhuizen (1):
>   radv: Reserve space for descriptor and push constant user SGPR
> setting.
>
> Daniel Stone (7):
>   vulkan: Fix Wayland uninitialised registry
>   vulkan/wsi/wayland: Remove roundtrip when creating image
>   vulkan/wsi/wayland: Use per-display event queue
>   vulkan/wsi/wayland: Use proxy wrappers for swapchain
> Squashed with
>   vulkan/wsi/wayland: Fix proxy wrappers for swapchain recreation
>   egl/wayland: Don't open-code roundtrip
>   egl/wayland: Use per-surface event queues
> Squashed with
>   egl/wayland: verify event queue was allocated
>   egl/wayland: Ensure we get a back buffer
>
> Emil Velikov (24):
>   docs: add sha256 checksums for 17.1.1
>   configure: move platform handling further up
>   configure: rename remaining HAVE_EGL_PLATFORM_* guards
>   configure: update remaining --with-egl-platforms references
>   configure: loosen --with-platforms heuristics
>   configure: enable the surfaceless platform by default
>   configure: set HAVE_foo_PLATFORM as applicable
>   configure: error out when building GLX w/o the X11 platform
>   configure: check once for DRI3 dependencies
> Squashed with
>   configure.ac: add xcb-fixes to the XCB DRI3 list
> Squashed with
>   configure.ac: s/xcb-fixes/xcb-xfixes/
>   loader: build libloader_dri3_helper.la only with HAVE_PLATFORM_X11
>   configure: error out when building X11 Vulkan without DRI3
>   auxiliary/vl: use vl_*_screen_create stubs when building w/o platform
>   st/va: fix misplaced closing bracket
>   st/omx: remove unneeded X11 include
>   st/omx: fix building against X11-less setups
>   gallium/targets: link against XCB only as needed
>   configure: error out if building VA w/o supported platform
>   configure: error out if building OMX w/o supported platform
>   configure: error out if building VDPAU w/o supported platform
>   configure: error out if building XVMC w/o supported platform
>   travis: remove workarounds for the Vulkan target
>   anv: automake: 

[Mesa-dev] [Bug 101071] compiling glsl fails with undefined reference to `pthread_create'

2017-06-03 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=101071

--- Comment #14 from war...@o2.pl ---
Emil,
Now compiles OK.
I'm not sure why as I tested compilation with -lptrhead and -pthread...but with
this patch compiles OK :-)
thx for Your work with this!

-- 
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] Mesa 17.1.2 release candidate

2017-06-03 Thread Juan A. Suarez Romero
On Thu, 2017-06-01 at 16:35 -0700, Jason Ekstrand wrote:
> On Thu, Jun 1, 2017 at 4:20 PM, Juan A. Suarez Romero  
> wrote:
> > Hello list,
> > 
> > 
> > 
> > The candidate for the Mesa 17.1.2 is now available. Currently we have:
> > 
> >  - 51 queued
> > 
> >  - 3 nominated (outstanding)
> > 
> >  - and 9 rejected patch(es)
> > 
> > 
> > 
> > 
> > 
> > The current queue contains fixes in several places.
> > 
> > 
> > 
> > The current queue consists of:
> > 
> > 
> > 
> > Several fixes in the autotools' configure that improves handling of target 
> > platforms.
> > 
> > 
> > 
> > Mesa receives a fix for a leaking in a surface.
> > 
> > 
> > 
> > OMX has a couple of fixes when building in a X11-less setup.
> > 
> > 
> > 
> > ANV driver receives several fixes, like adding some missing transitions 
> > between layouts, or improvements in setting memory types and heaps.
> > 
> > 
> > 
> > There are a few fixes in i965, R100, R200, Radeonsi/GFX9, Radv and 
> > Freedreno drivers.
> > 
> > 
> > 
> > Also, EGL/Android receives a fix for a segfault that replaces a previous 
> > one that was not correct.
> > 
> > 
> > 
> > Vulkan's Wayland gets some fixes, including the use of proxy wrappers for 
> > swapchains, or per-display event queue usage.
> > 
> > 
> > 
> > Likewise EGL's Wayland now use per-surface event queues, as well as other 
> > fixes like ensuring back buffer is obtained.
> > 
> > 
> > 
> > Take a look at section "Mesa stable queue" for more information.
> > 
> > 
> > 
> > 
> > 
> > Testing reports/general approval
> > 
> > 
> > 
> > 
> > 
> > Any testing reports (or general approval of the state of the branch)
> > 
> > will be greatly appreciated.
> > 
> > 
> > 
> > The plan is to have 17.1.2 this Friday (3rd of June), around or
> > 
> > shortly after 23:00 GMT.
> > 
> > 
> > 
> > If you have any questions or suggestions - be that about the current
> > 
> > patch queue or otherwise, please go ahead.
> > 
> > 
> > 
> > 
> > 
> > Trivial merge conflicts
> > 
> > ---
> > 
> > 
> > 
> > commit e064f7d826812598749ce27868d9ff865c137ef4
> > 
> > Author: Jason Ekstrand 
> > 
> > 
> > 
> > anv: Set up memory types and heaps during physical device init
> > 
> > 
> > 
> > (cherry picked from commit c1f4343807d1040bd7b5440aa2f5fccf5f12842d)
> > 
> > 
> > 
> > commit ce2b96dd8b5a6c4ea0c80c6c0f46652a0b591515
> > 
> > Author: Bas Nieuwenhuizen 
> > 
> > 
> > 
> > radv: Reserve space for descriptor and push constant user SGPR setting.
> > 
> > 
> > 
> > (cherry picked from commit 18efb404cfb38f722a16df7539390cf9a4a71929)
> > 
> > 
> > 
> > 
> > 
> > Cheers,
> > 
> > J.A.
> > 
> > 
> > 
> > 
> > 
> > Mesa stable queue
> > 
> > -
> > 
> > 
> > 
> > Nominated (3)
> > 
> > =
> > 
> > Chad Versace(1):
> > 
> >       i965/dri: Fix bad GL error in intel_create_winsys_renderbuffer()
> > 
> > 
> > 
> > Jason Ekstrand(1):
> > 
> >       i965: Rework Sandy Bridge HiZ and stencil layouts
> 
> This just landed in master.
>  

Ok. I've included it in the Queued.

> > Nicolas Dechesne(1):
> > 
> >       util/rand_xor: add missing include statements
> > 
> > 
> > 
> > 
> > 
> > Queued (51)
> > 
> > ===
> > 
> > Bartosz Tomczyk (1):
> > 
> >       mesa: Avoid leaking surface in st_renderbuffer_delete
> > 
> > 
> > 
> > Bas Nieuwenhuizen (1):
> > 
> >       radv: Reserve space for descriptor and push constant user SGPR 
> > setting.
> > 
> > 
> > 
> > Daniel Stone (7):
> > 
> >       vulkan: Fix Wayland uninitialised registry
> > 
> >       vulkan/wsi/wayland: Remove roundtrip when creating image
> > 
> >       vulkan/wsi/wayland: Use per-display event queue
> > 
> >       vulkan/wsi/wayland: Use proxy wrappers for swapchain
> > 
> > Squashed with
> > 
> >       vulkan/wsi/wayland: Fix proxy wrappers for swapchain recreation
> > 
> >       egl/wayland: Don't open-code roundtrip
> > 
> >       egl/wayland: Use per-surface event queues
> > 
> > Squashed with
> > 
> >       egl/wayland: verify event queue was allocated
> > 
> >       egl/wayland: Ensure we get a back buffer
> > 
> > 
> > 
> > Emil Velikov (24):
> > 
> >       docs: add sha256 checksums for 17.1.1
> > 
> >       configure: move platform handling further up
> > 
> >       configure: rename remaining HAVE_EGL_PLATFORM_* guards
> > 
> >       configure: update remaining --with-egl-platforms references
> > 
> >       configure: loosen --with-platforms heuristics
> > 
> >       configure: enable the surfaceless platform by default
> > 
> >       configure: set HAVE_foo_PLATFORM as applicable
> > 
> >       configure: error out when building GLX w/o the X11 platform
> > 
> >       configure: check once for DRI3 dependencies
> > 
> > Squashed with
> > 
> >       configure.ac: add xcb-fixes to the XCB DRI3 list
> > 
> > Squashed with
> > 
> >       configure.ac: s/xcb-fixes/xcb-xfixes/
> > 
> >       

[Mesa-dev] [PATCH 2/2] radeonsi: move PSIZE and CLIPDIST unique IO indices after GENERIC

2017-06-03 Thread Marek Olšák
From: Marek Olšák 

Heaven LDS usage for LS+HS is below. The masks are "outputs_written"
for LS and HS. Note that 32K is the maximum size.

Before:
  heaven_x64: ls=1f1 tcs=1f1, lds=32K
  heaven_x64: ls=31 tcs=31, lds=24K
  heaven_x64: ls=71 tcs=71, lds=28K

After:
  heaven_x64: ls=3f tcs=3f, lds=24K
  heaven_x64: ls=7 tcs=7, lds=13K
  heaven_x64: ls=f tcs=f, lds=17K

All other apps have a similar decrease in LDS usage, because
the "outputs_written" masks are similar. Also, most apps don't write
POSITION in these shader stages, so there is room for improvement.
(tight per-component input/output packing might help even more)

It's unknown whether this improves performance.
---
 src/gallium/drivers/radeonsi/si_shader.c| 18 +++---
 src/gallium/drivers/radeonsi/si_state_shaders.c |  4 +++-
 2 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_shader.c 
b/src/gallium/drivers/radeonsi/si_shader.c
index ddfaa3b..3a86c0b 100644
--- a/src/gallium/drivers/radeonsi/si_shader.c
+++ b/src/gallium/drivers/radeonsi/si_shader.c
@@ -129,32 +129,36 @@ unsigned si_shader_io_get_unique_index_patch(unsigned 
semantic_name, unsigned in
 /**
  * Returns a unique index for a semantic name and index. The index must be
  * less than 64, so that a 64-bit bitmask of used inputs or outputs can be
  * calculated.
  */
 unsigned si_shader_io_get_unique_index(unsigned semantic_name, unsigned index)
 {
switch (semantic_name) {
case TGSI_SEMANTIC_POSITION:
return 0;
-   case TGSI_SEMANTIC_PSIZE:
-   return 1;
-   case TGSI_SEMANTIC_CLIPDIST:
-   assert(index <= 1);
-   return 2 + index;
case TGSI_SEMANTIC_GENERIC:
+   /* Since some shader stages use the the highest used IO index
+* to determine the size to allocate for inputs/outputs
+* (in LDS, tess and GS rings). GENERIC should be placed right
+* after POSITION to make that size as small as possible.
+*/
if (index < SI_MAX_IO_GENERIC)
-   return 4 + index;
+   return 1 + index;
 
assert(!"invalid generic index");
return 0;
-
+   case TGSI_SEMANTIC_PSIZE:
+   return SI_MAX_IO_GENERIC + 1;
+   case TGSI_SEMANTIC_CLIPDIST:
+   assert(index <= 1);
+   return SI_MAX_IO_GENERIC + 2 + index;
case TGSI_SEMANTIC_FOG:
return SI_MAX_IO_GENERIC + 4;
case TGSI_SEMANTIC_LAYER:
return SI_MAX_IO_GENERIC + 5;
case TGSI_SEMANTIC_VIEWPORT_INDEX:
return SI_MAX_IO_GENERIC + 6;
case TGSI_SEMANTIC_PRIMID:
return SI_MAX_IO_GENERIC + 7;
case TGSI_SEMANTIC_COLOR: /* these alias */
case TGSI_SEMANTIC_BCOLOR:
diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.c 
b/src/gallium/drivers/radeonsi/si_state_shaders.c
index 8ac4309..f36997b 100644
--- a/src/gallium/drivers/radeonsi/si_state_shaders.c
+++ b/src/gallium/drivers/radeonsi/si_state_shaders.c
@@ -1226,21 +1226,23 @@ static void si_shader_selector_key_hw_vs(struct 
si_context *sctx,
ps_disabled = sctx->queued.named.rasterizer->rasterizer_discard 
||
  (!ps_colormask &&
   !ps_modifies_zs &&
   !ps->info.writes_memory);
}
 
/* Find out which VS outputs aren't used by the PS. */
uint64_t outputs_written = vs->outputs_written;
uint64_t inputs_read = 0;
 
-   outputs_written &= ~0x3; /* ignore POSITION, PSIZE */
+   /* ignore POSITION, PSIZE */
+   outputs_written &= ~((1ull << 
si_shader_io_get_unique_index(TGSI_SEMANTIC_POSITION, 0) |
+(1ull << 
si_shader_io_get_unique_index(TGSI_SEMANTIC_PSIZE, 0;
 
if (!ps_disabled) {
inputs_read = ps->inputs_read;
}
 
uint64_t linked = outputs_written & inputs_read;
 
key->opt.hw_vs.kill_outputs = ~linked & outputs_written;
 }
 
-- 
2.7.4

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