Re: [Mesa-dev] [PATCH] docs: add the beginning of the 18.3 cycle

2018-09-01 Thread Dylan Baker
Ack

Dylan

On August 31, 2018 4:43:50 PM PDT, Andres Gomez  wrote:
>Cc: Dylan Baker 
>Cc: Juan A. Suarez 
>Cc: Emil Velikov 
>Signed-off-by: Andres Gomez 
>---
> docs/release-calendar.html | 25 +
> 1 file changed, 25 insertions(+)
>
>This is just a proposal for the beginning of the 18.3 releasing
>process.
>
>18.2 has gotten exceptionally long to be released but that's not a
>reason for delaying 18.3 as we have agreed to get one release every 3
>months. 18.2 will just be shorter if 18.3 gets released by the planned
>scheduled date.
>
>Juan has transmitted me his wish to skip this cycle as he sees himself
>very busy during those weeks. He may also have to back me up in some
>of the 18.2 releases, in any case.
>
>Emil also commented his wish to rest for a bit from release
>duties. Therefore, I'm proposing Dylan to manage 18.3.
>
>diff --git a/docs/release-calendar.html b/docs/release-calendar.html
>index 2e3bb8a..669d692ecc4 100644
>--- a/docs/release-calendar.html
>+++ b/docs/release-calendar.html
>@@ -58,6 +58,31 @@ if you'd like to nominate a patch in the next stable
>release.
> Andres Gomez
> Last planned RC/Final release
> 
>+
>+18.3
>+2018-10-10
>+18.3.0-rc1
>+Dylan Baker
>+
>+
>+
>+2018-10-17
>+18.3.0-rc2
>+Dylan Baker
>+
>+
>+
>+2018-10-24
>+18.3.0-rc3
>+Dylan Baker
>+
>+
>+
>+2018-10-31
>+18.3.0-rc4
>+Dylan Baker
>+Last planned RC/Final release
>+
> 
> 
> 
>-- 
>2.18.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


Re: [Mesa-dev] Etnaviv on mesa master vs. Array._DrawVAO

2018-09-01 Thread Guido Günther
Hi,
On Sat, Sep 01, 2018 at 09:07:46AM +0200, Mathias Fröhlich wrote:
> Hi,
> 
> On Friday, 31 August 2018 12:40:01 CEST Guido Günther wrote:
> > Hi,
> > I'm looking into forward porting laanwj's patches for GC7000 support to
> > current mesa master. Luckily most of it already got merged last November
> > with mostly only the texture descriptor support missing(
> > https://github.com/laanwj/mesa/commit/b71802207432543745dff471c68fbc40495b48
> > 58)
> > 
> > Putting this on current master leads to this assertion in mesa when running
> > kmscube like:
> > 
> > kmscube: ../src/gallium/drivers/etnaviv/etnaviv_state.c:536:
> > etna_vertex_elements_state_create: Assertion `element_size != 0 &&
> > end_offset <= 256' failed.
> > 
> > Printing the value there gives:
> > 
> > etna_vertex_elements_state_create:535: size: 12, offset: 0, end_offset:
> > 12 etna_vertex_elements_state_create:535: size: 12, offset: 576,
> > end_offset: 588
> > 
> > And the bt is:
> > 
> >Stack trace of thread 2158:
> >#0  0xa93427c0 raise (libc.so.6)
> >#1  0xa934274c raise (libc.so.6)
> >#2  0xa9343bac abort (libc.so.6)
> >#3  0xa933bd2c n/a (libc.so.6)
> >#4  0xa933bdac __assert_fail (libc.so.6)
> >#5  0xa8de468c etna_vertex_elements_state_create
> > (imx-drm_dri.so) #6  0xa8757178 u_vbuf_set_vertex_elements_internal
> > (imx-drm_dri.so) #7  0xa875726c u_vbuf_set_vertex_elements
> > (imx-drm_dri.so) #8  0xa8711bcc cso_set_vertex_elements
> > (imx-drm_dri.so) #9  0xa8b28760 set_vertex_attribs (imx-drm_dri.so)
> >#10 0xa8b28c9c st_update_array (imx-drm_dri.so)
> >#11 0xa8ad4e44 st_validate_state (imx-drm_dri.so)
> >#12 0xa8a1e410 prepare_draw (imx-drm_dri.so)
> >#13 0xa8a1e488 st_draw_vbo (imx-drm_dri.so)
> >#14 0xa8a0ea9c vbo_draw_arrays (imx-drm_dri.so)
> >#15 0xa8a0f408 vbo_exec_DrawArrays (imx-drm_dri.so)
> >#16 0xa953f7e0 glDrawArrays (libGLESv2.so.2)
> >#17 0xd7e62ea0 draw_cube_smooth (kmscube)
> >#18 0xd7e64160 atomic_run (kmscube)
> >#19 0xa93306e0 __libc_start_main (libc.so.6)
> >#20 0xd7e621fc $x (kmscube)
> >#21 0xd7e621fc $x (kmscube)
> > 
> > I've traced this back to this commit:
> > 
> > 19a91841c347107d877bc750371c5fa4e9b4de19 is the first bad commit
> > commit 19a91841c347107d877bc750371c5fa4e9b4de19
> > Author: Mathias Fröhlich 
> > Date:   Sun Apr 1 20:18:36 2018 +0200
> > 
> > st/mesa: Use Array._DrawVAO in st_atom_array.c.
> > 
> > Finally make use of the binding information in the VAO when
> > setting up arrays for draw.
> > 
> > v2: Emit less relocations also for interleaved userspace arrays.
> > 
> > Reviewed-by: Brian Paul 
> > Signed-off-by: Mathias Fröhlich 
> > 
> > And indeed commits prior to that one work as expected. Any hints what
> > would be the right fix to not trigger the assert?
> 
> 
> Introduce a gallium cap and feed ctx->Const.MaxVertexAttribRelativeOffset 
> with 
> the value that limits the actual hardware.
> 
> I have something prepared for that but did not get any response for a some 
> preparation patch so put that issue somehow down on my list.
> The point for today is, is that my development system is down, means I can 
> prepare this once this machine is back up hopefully by the beginning of this 
> week.
> Else feel free to just introduce that cap.

I will be away from the hw for the next week but I'm happy to cook up a
patch and test it afterwards.
Cheers,
 -- Guido
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 2/2] nir: add lowering for fceil

2018-09-01 Thread Christian Gmeiner
Am Sa., 1. Sep. 2018 um 21:15 Uhr schrieb Christian Gmeiner
:
>
> Signed-off-by: Christian Gmeiner 
> ---
>  src/compiler/nir/nir.h| 3 +++
>  src/compiler/nir/nir_opt_algebraic.py | 1 +
>  2 files changed, 4 insertions(+)
>
> diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h
> index d81eefc032..1dcc221777 100644
> --- a/src/compiler/nir/nir.h
> +++ b/src/compiler/nir/nir.h
> @@ -2057,6 +2057,9 @@ typedef struct nir_shader_compiler_options {
> /** lowers ffloor to fsub+ffract: */
> bool lower_ffloor;
>
> +   /** lowers fceil to fadd+ffract: */
> +   bool lower_fceil;
> +
> /** lowers ffract to fsub+ffloor: */
> bool lower_ffract;
>
> diff --git a/src/compiler/nir/nir_opt_algebraic.py 
> b/src/compiler/nir/nir_opt_algebraic.py
> index 3d2b861a42..43a1642aa5 100644
> --- a/src/compiler/nir/nir_opt_algebraic.py
> +++ b/src/compiler/nir/nir_opt_algebraic.py
> @@ -119,6 +119,7 @@ optimizations = [
> (('flrp@32', a, b, c), ('fadd', ('fmul', c, ('fsub', b, a)), a), 
> 'options->lower_flrp32'),
> (('flrp@64', a, b, c), ('fadd', ('fmul', c, ('fsub', b, a)), a), 
> 'options->lower_flrp64'),
> (('ffloor', a), ('fsub', a, ('ffract', a)), 'options->lower_ffloor'),
> +   (('fceil', a), ('fadd', a, ('ffract', a)), 'options->lower_fceil'),

I missed a fneg(..) here .. will be fixed in v2.

> (('ffract', a), ('fsub', a, ('ffloor', a)), 'options->lower_ffract'),
> (('~fadd', ('fmul', a, ('fadd', 1.0, ('fneg', ('b2f', c, ('fmul', b, 
> ('b2f', c))), ('bcsel', c, b, a), 'options->lower_flrp32'),
> (('~fadd@32', ('fmul', a, ('fadd', 1.0, ('fneg', c ))), ('fmul', 
> b, c )), ('flrp', a, b, c), '!options->lower_flrp32'),
> --
> 2.17.1
>


-- 
greets
--
Christian Gmeiner, MSc

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


Re: [Mesa-dev] [PATCH 1/2] nir: add lowering for ffloor

2018-09-01 Thread Jason Ekstrand

I don't think either of these work for negative numbers

On September 1, 2018 14:16:11 Christian Gmeiner 
 wrote:



Signed-off-by: Christian Gmeiner 
---
src/compiler/nir/nir.h| 3 +++
src/compiler/nir/nir_opt_algebraic.py | 1 +
2 files changed, 4 insertions(+)

diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h
index 169fa1fa20..d81eefc032 100644
--- a/src/compiler/nir/nir.h
+++ b/src/compiler/nir/nir.h
@@ -2054,6 +2054,9 @@ typedef struct nir_shader_compiler_options {
*/
   bool fdot_replicates;

+   /** lowers ffloor to fsub+ffract: */
+   bool lower_ffloor;
+
   /** lowers ffract to fsub+ffloor: */
   bool lower_ffract;

diff --git a/src/compiler/nir/nir_opt_algebraic.py 
b/src/compiler/nir/nir_opt_algebraic.py

index ae1261f874..3d2b861a42 100644
--- a/src/compiler/nir/nir_opt_algebraic.py
+++ b/src/compiler/nir/nir_opt_algebraic.py
@@ -118,6 +118,7 @@ optimizations = [
   (('~flrp', a, 0.0, c), ('fadd', ('fmul', ('fneg', a), c), a)),
   (('flrp@32', a, b, c), ('fadd', ('fmul', c, ('fsub', b, a)), a), 
   'options->lower_flrp32'),
   (('flrp@64', a, b, c), ('fadd', ('fmul', c, ('fsub', b, a)), a), 
   'options->lower_flrp64'),

+   (('ffloor', a), ('fsub', a, ('ffract', a)), 'options->lower_ffloor'),
   (('ffract', a), ('fsub', a, ('ffloor', a)), 'options->lower_ffract'),
   (('~fadd', ('fmul', a, ('fadd', 1.0, ('fneg', ('b2f', c, ('fmul', b, 
   ('b2f', c))), ('bcsel', c, b, a), 'options->lower_flrp32'),
   (('~fadd@32', ('fmul', a, ('fadd', 1.0, ('fneg', c ))), ('fmul', b, 
   c )), ('flrp', a, b, c), '!options->lower_flrp32'),

--
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 2/2] nir: add lowering for fceil

2018-09-01 Thread Christian Gmeiner
Signed-off-by: Christian Gmeiner 
---
 src/compiler/nir/nir.h| 3 +++
 src/compiler/nir/nir_opt_algebraic.py | 1 +
 2 files changed, 4 insertions(+)

diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h
index d81eefc032..1dcc221777 100644
--- a/src/compiler/nir/nir.h
+++ b/src/compiler/nir/nir.h
@@ -2057,6 +2057,9 @@ typedef struct nir_shader_compiler_options {
/** lowers ffloor to fsub+ffract: */
bool lower_ffloor;
 
+   /** lowers fceil to fadd+ffract: */
+   bool lower_fceil;
+
/** lowers ffract to fsub+ffloor: */
bool lower_ffract;
 
diff --git a/src/compiler/nir/nir_opt_algebraic.py 
b/src/compiler/nir/nir_opt_algebraic.py
index 3d2b861a42..43a1642aa5 100644
--- a/src/compiler/nir/nir_opt_algebraic.py
+++ b/src/compiler/nir/nir_opt_algebraic.py
@@ -119,6 +119,7 @@ optimizations = [
(('flrp@32', a, b, c), ('fadd', ('fmul', c, ('fsub', b, a)), a), 
'options->lower_flrp32'),
(('flrp@64', a, b, c), ('fadd', ('fmul', c, ('fsub', b, a)), a), 
'options->lower_flrp64'),
(('ffloor', a), ('fsub', a, ('ffract', a)), 'options->lower_ffloor'),
+   (('fceil', a), ('fadd', a, ('ffract', a)), 'options->lower_fceil'),
(('ffract', a), ('fsub', a, ('ffloor', a)), 'options->lower_ffract'),
(('~fadd', ('fmul', a, ('fadd', 1.0, ('fneg', ('b2f', c, ('fmul', b, 
('b2f', c))), ('bcsel', c, b, a), 'options->lower_flrp32'),
(('~fadd@32', ('fmul', a, ('fadd', 1.0, ('fneg', c ))), ('fmul', b, 
c )), ('flrp', a, b, c), '!options->lower_flrp32'),
-- 
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] nir: add lowering for ffloor

2018-09-01 Thread Christian Gmeiner
Signed-off-by: Christian Gmeiner 
---
 src/compiler/nir/nir.h| 3 +++
 src/compiler/nir/nir_opt_algebraic.py | 1 +
 2 files changed, 4 insertions(+)

diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h
index 169fa1fa20..d81eefc032 100644
--- a/src/compiler/nir/nir.h
+++ b/src/compiler/nir/nir.h
@@ -2054,6 +2054,9 @@ typedef struct nir_shader_compiler_options {
 */
bool fdot_replicates;
 
+   /** lowers ffloor to fsub+ffract: */
+   bool lower_ffloor;
+
/** lowers ffract to fsub+ffloor: */
bool lower_ffract;
 
diff --git a/src/compiler/nir/nir_opt_algebraic.py 
b/src/compiler/nir/nir_opt_algebraic.py
index ae1261f874..3d2b861a42 100644
--- a/src/compiler/nir/nir_opt_algebraic.py
+++ b/src/compiler/nir/nir_opt_algebraic.py
@@ -118,6 +118,7 @@ optimizations = [
(('~flrp', a, 0.0, c), ('fadd', ('fmul', ('fneg', a), c), a)),
(('flrp@32', a, b, c), ('fadd', ('fmul', c, ('fsub', b, a)), a), 
'options->lower_flrp32'),
(('flrp@64', a, b, c), ('fadd', ('fmul', c, ('fsub', b, a)), a), 
'options->lower_flrp64'),
+   (('ffloor', a), ('fsub', a, ('ffract', a)), 'options->lower_ffloor'),
(('ffract', a), ('fsub', a, ('ffloor', a)), 'options->lower_ffract'),
(('~fadd', ('fmul', a, ('fadd', 1.0, ('fneg', ('b2f', c, ('fmul', b, 
('b2f', c))), ('bcsel', c, b, a), 'options->lower_flrp32'),
(('~fadd@32', ('fmul', a, ('fadd', 1.0, ('fneg', c ))), ('fmul', b, 
c )), ('flrp', a, b, c), '!options->lower_flrp32'),
-- 
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/u_threaded: increase batch size to increase performance

2018-09-01 Thread Kenneth Graunke
On Saturday, September 1, 2018 12:14:38 AM PDT Marek Olšák wrote:
> From: Marek Olšák 
> 
> This reduces mutex overhead.
> 
> +4.4% performance with piglit/drawoverhead, DrawElements, Ryzen X1700

+14% with piglit/drawoverhead and iris_dri.so, DrawArrays, i7 7700HQ.

Acked-by: Kenneth Graunke 

> ---
>  src/gallium/auxiliary/util/u_threaded_context.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/gallium/auxiliary/util/u_threaded_context.h 
> b/src/gallium/auxiliary/util/u_threaded_context.h
> index 53c5a7e8c4c..be6933d05a4 100644
> --- a/src/gallium/auxiliary/util/u_threaded_context.h
> +++ b/src/gallium/auxiliary/util/u_threaded_context.h
> @@ -213,21 +213,21 @@ struct tc_unflushed_batch_token;
>   * slots.
>   */
>  #define TC_MAX_BATCHES10
>  
>  /* The size of one batch. Non-trivial calls (i.e. not setting a CSO pointer)
>   * can occupy multiple call slots.
>   *
>   * The idea is to have batches as small as possible but large enough so that
>   * the queuing and mutex overhead is negligible.
>   */
> -#define TC_CALLS_PER_BATCH192
> +#define TC_CALLS_PER_BATCH768
>  
>  /* Threshold for when to use the queue or sync. */
>  #define TC_MAX_STRING_MARKER_BYTES  512
>  
>  /* Threshold for when to enqueue buffer/texture_subdata as-is.
>   * If the upload size is greater than this, it will do instead:
>   * - for buffers: DISCARD_RANGE is done by the threaded context
>   * - for textures: sync and call the driver directly
>   */
>  #define TC_MAX_SUBDATA_BYTES320
> 



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] [Bug 97516] GLX_OML_swap_method not fully supported

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

Sven Arvidsson  changed:

   What|Removed |Added

 CC||s...@whiz.se

--- Comment #1 from Sven Arvidsson  ---
*** Bug 107687 has been marked as a duplicate of this bug. ***

-- 
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 2/4] anv: Implement a VF cache invalidate workaround

2018-09-01 Thread Jason Ekstrand
This appears to hang broadwell; we should probably think twice before
enabling it so broadly.  I'll adjust it to be gen9 only or we can just can
the patch entirely.

On Tue, Aug 21, 2018 at 8:58 PM Jason Ekstrand  wrote:

> Known to fix nothing whatsoever but it's in the docs.
> ---
>  src/intel/vulkan/genX_cmd_buffer.c | 9 +
>  1 file changed, 9 insertions(+)
>
> diff --git a/src/intel/vulkan/genX_cmd_buffer.c
> b/src/intel/vulkan/genX_cmd_buffer.c
> index 18f80e8d1bd..75b3dd54275 100644
> --- a/src/intel/vulkan/genX_cmd_buffer.c
> +++ b/src/intel/vulkan/genX_cmd_buffer.c
> @@ -1743,6 +1743,9 @@ genX(cmd_buffer_apply_pipe_flushes)(struct
> anv_cmd_buffer *cmd_buffer)
> }
>
> if (bits & ANV_PIPE_INVALIDATE_BITS) {
> +  if (bits & ANV_PIPE_VF_CACHE_INVALIDATE_BIT)
> + anv_batch_emit(_buffer->batch, GENX(PIPE_CONTROL), pipe);
> +
>anv_batch_emit(_buffer->batch, GENX(PIPE_CONTROL), pipe) {
>   pipe.StateCacheInvalidationEnable =
>  bits & ANV_PIPE_STATE_CACHE_INVALIDATE_BIT;
> @@ -1754,6 +1757,12 @@ genX(cmd_buffer_apply_pipe_flushes)(struct
> anv_cmd_buffer *cmd_buffer)
>  bits & ANV_PIPE_TEXTURE_CACHE_INVALIDATE_BIT;
>   pipe.InstructionCacheInvalidateEnable =
>  bits & ANV_PIPE_INSTRUCTION_CACHE_INVALIDATE_BIT;
> +
> + if (pipe.VFCacheInvalidationEnable) {
> +pipe.PostSyncOperation = WriteImmediateData;
> +pipe.Address =
> +   (struct anv_address) { _buffer->device->workaround_bo,
> 0 };
> + }
>}
>
>bits &= ~ANV_PIPE_INVALIDATE_BITS;
> --
> 2.17.1
>
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] Introduction to Community and Queries Regarding Task : Unit and performance tests for VA-API

2018-09-01 Thread Benson Muite

Am not a mentor, but welcome to the community.


On 08/31/2018 11:38 AM, Iti Shree wrote:

Good morning,

I am Iti Shree currently pursuing B.Tech degree in Information and 
Technology. I was browsing through some project and saw Xorg project 
ideas. Many of them are indeed interesting, though they have precise 
hardware requirement (I have AMD processor).


I was reading ideas and I think it's good to start with " Unit and 
performance tests for VA-API", however, the task doesn't mention 
potential mentors, therefore, I thought I should send a mail.


I'd like to know more about this project and to know who to contact 
exactly for further queries regarding the same.


I've already joined irc channels for the respective task as mentioned 
in the blog. Thank you for your time.


With regards,
Iti


___
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] glsl: fixer lexer for unreachable defines

2018-09-01 Thread Timothy Arceri
If we have something like:

   #ifdef NOT_DEFINED
   #define A_MACRO(x) \
if (x)
   #endif

The # on the #define is not skipped but the define itself is so
this then gets recognised as #if.

Until 28a3731e3f this didn't happen because we ended up in
{NONSPACE} where BEGIN INITIAL was called stopping the
problem from happening.

This change makes sure we never call RETURN_TOKEN_NEVER_SKIP for
if/else/endif when processing a define.

Cc: Ian Romanick 
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107772
---
 src/compiler/glsl/glcpp/glcpp-lex.l | 60 ++---
 src/compiler/glsl/glcpp/glcpp.h |  1 +
 2 files changed, 38 insertions(+), 23 deletions(-)

diff --git a/src/compiler/glsl/glcpp/glcpp-lex.l 
b/src/compiler/glsl/glcpp/glcpp-lex.l
index fe5845acd4e..f7003da0cc8 100644
--- a/src/compiler/glsl/glcpp/glcpp-lex.l
+++ b/src/compiler/glsl/glcpp/glcpp-lex.l
@@ -289,6 +289,7 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]?
  * token. */
if (parser->first_non_space_token_this_line) {
BEGIN HASH;
+   yyextra->in_define = false;
}
 
RETURN_TOKEN_NEVER_SKIP (HASH_TOKEN);
@@ -336,43 +337,55 @@ HEXADECIMAL_INTEGER   0[xX][0-9a-fA-F]+[uU]?
/* For the pre-processor directives, we return these tokens
 * even when we are otherwise skipping. */
 ifdef {
-   BEGIN INITIAL;
-   yyextra->lexing_directive = 1;
-   yyextra->space_tokens = 0;
-   RETURN_TOKEN_NEVER_SKIP (IFDEF);
+   if (!yyextra->in_define) {
+   BEGIN INITIAL;
+   yyextra->lexing_directive = 1;
+   yyextra->space_tokens = 0;
+   RETURN_TOKEN_NEVER_SKIP (IFDEF);
+   }
 }
 
 ifndef {
-   BEGIN INITIAL;
-   yyextra->lexing_directive = 1;
-   yyextra->space_tokens = 0;
-   RETURN_TOKEN_NEVER_SKIP (IFNDEF);
+   if (!yyextra->in_define) {
+   BEGIN INITIAL;
+   yyextra->lexing_directive = 1;
+   yyextra->space_tokens = 0;
+   RETURN_TOKEN_NEVER_SKIP (IFNDEF);
+   }
 }
 
 if/[^_a-zA-Z0-9] {
-   BEGIN INITIAL;
-   yyextra->lexing_directive = 1;
-   yyextra->space_tokens = 0;
-   RETURN_TOKEN_NEVER_SKIP (IF);
+   if (!yyextra->in_define) {
+   BEGIN INITIAL;
+   yyextra->lexing_directive = 1;
+   yyextra->space_tokens = 0;
+   RETURN_TOKEN_NEVER_SKIP (IF);
+   }
 }
 
 elif/[^_a-zA-Z0-9] {
-   BEGIN INITIAL;
-   yyextra->lexing_directive = 1;
-   yyextra->space_tokens = 0;
-   RETURN_TOKEN_NEVER_SKIP (ELIF);
+   if (!yyextra->in_define) {
+   BEGIN INITIAL;
+   yyextra->lexing_directive = 1;
+   yyextra->space_tokens = 0;
+   RETURN_TOKEN_NEVER_SKIP (ELIF);
+   }
 }
 
 else {
-   BEGIN INITIAL;
-   yyextra->space_tokens = 0;
-   RETURN_TOKEN_NEVER_SKIP (ELSE);
+   if (!yyextra->in_define) {
+   BEGIN INITIAL;
+   yyextra->space_tokens = 0;
+   RETURN_TOKEN_NEVER_SKIP (ELSE);
+   }
 }
 
 endif {
-   BEGIN INITIAL;
-   yyextra->space_tokens = 0;
-   RETURN_TOKEN_NEVER_SKIP (ENDIF);
+   if (!yyextra->in_define) {
+   BEGIN INITIAL;
+   yyextra->space_tokens = 0;
+   RETURN_TOKEN_NEVER_SKIP (ENDIF);
+   }
 }
 
 error[^\r\n]* {
@@ -399,7 +412,8 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]?
 *and not whitespace). This will generate an error.
 */
 define{HSPACE}* {
-   if (! parser->skipping) {
+   yyextra->in_define = true;
+   if (!parser->skipping) {
BEGIN DEFINE;
yyextra->space_tokens = 0;
RETURN_TOKEN (DEFINE_TOKEN);
diff --git a/src/compiler/glsl/glcpp/glcpp.h b/src/compiler/glsl/glcpp/glcpp.h
index c7e382ed30c..e786b24b132 100644
--- a/src/compiler/glsl/glcpp/glcpp.h
+++ b/src/compiler/glsl/glcpp/glcpp.h
@@ -197,6 +197,7 @@ struct glcpp_parser {
int first_non_space_token_this_line;
int newline_as_space;
int in_control_line;
+   bool in_define;
int paren_count;
int commented_newlines;
skip_node_t *skip_stack;
-- 
2.17.1

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


Re: [Mesa-dev] [PATCH 0/3] nir: Rework 64-bit attribute handling

2018-09-01 Thread Alejandro Piñeiro
As with the original RFC:

Tested-by: Alejandro Piñeiro  (ARB_gl_spirv tests)

Patches 1 and 3:

Reviewed-by: Alejandro Piñeiro 


On 01/09/18 05:11, Jason Ekstrand wrote:
> NIR handling of 64-bit vertex attributes is inconsistent at best.  When it
> comes vertex attributes which are 196 or 256 bits (dvec3 or dvec4), some
> passes assume they consume two slots, some passes assume they consume one,
> and some passes are configurable.  When you combine that with the limited
> number of tests and apps which use attrib_64bit, it's an utter minefield.
> Since both gallium and i965 want 196-bit and 256-bit attributes to map to
> two slots eventually, you have the challenge of mapping back and forth
> between the two in all the right places.  This series attempts to fix the
> problem and make all of NIR consistently have the dual-slot behavior.
>
> Cc: Timothy Arceri 
>
> Jason Ekstrand (3):
>   compiler: Move double_inputs to gl_program::DualSlotInputs
>   radeonsi/nir: Set vs_inputs_dual_locations and let NIR do the remap
>   nir: Drop the vs_inputs_dual_locations option
>
>  src/amd/vulkan/radv_shader.c  |  1 -
>  src/compiler/glsl/glsl_to_nir.cpp | 11 +
>  src/compiler/glsl/ir_set_program_inouts.cpp   |  2 +-
>  src/compiler/glsl/serialize.cpp   |  2 +
>  src/compiler/nir/nir.c| 45 ++-
>  src/compiler/nir/nir.h| 11 ++---
>  src/compiler/nir/nir_gather_info.c| 26 ++-
>  .../nir/nir_lower_io_arrays_to_elements.c |  5 +--
>  src/compiler/shader_info.h|  3 --
>  src/intel/compiler/brw_compiler.c |  3 --
>  src/mesa/drivers/dri/i965/brw_draw_upload.c   | 21 -
>  src/mesa/drivers/dri/i965/genX_state_upload.c |  1 +
>  src/mesa/main/glspirv.c   | 20 +
>  src/mesa/main/mtypes.h| 15 +++
>  src/mesa/state_tracker/st_glsl_to_nir.cpp | 45 +--
>  src/mesa/state_tracker/st_glsl_to_tgsi.cpp|  2 +-
>  src/mesa/state_tracker/st_program.c   |  3 +-
>  17 files changed, 96 insertions(+), 120 deletions(-)
>

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


[Mesa-dev] [Bug 106394] Black Mesa cannot compile shaders because of missing GL_EXT_gpu_shader4

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

b...@besd.de  changed:

   What|Removed |Added

 Status|REOPENED|RESOLVED
 Resolution|--- |FIXED

--- Comment #7 from b...@besd.de  ---
I can capture and successfully compile the shaders with shader-db now.

The game still crashes with out of memory errors, but this seems to be a
problem with the game itself, as this always happens when it tries to allocate
more than 4 GB of system memory.

I think the original problem is solved and the rest doesnt seem to be mesa
related.

-- 
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] tnl: Fix green gun regression in xonotic.

2018-09-01 Thread Mathias Fröhlich
Hi,

On Wednesday, 22 August 2018 06:57:57 CEST mathias.froehl...@gmx.net wrote:
> From: Mathias Fröhlich 
> 
> Hi Ville, Brian,
> 
> The below patch fixes the regression to tnl drivers that Ville reported
> a hand full weeks ago.
> Please review!

Ping?
Or is the habit in mesa that a Tested-by:... is sufficient to push it?

best
Mathias


> 
> best
> Mathias
> 
> 
> Fix an other regression of patch 64d2a2048054
> mesa: Make gl_vertex_array contain pointers to first order VAO members.
> The regression showed up with drivers using the tnl module and
> was reproducible using xonotic-glx -benchmark demos/the-big-keybench.dem.
> 
> This patch survives intels CI system without changes in the tests.
> 
> Tested-by: Ville Syrjälä 
> Signed-off-by: Mathias Fröhlich 
> ---
>  src/mesa/tnl/t_split_copy.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/mesa/tnl/t_split_copy.c b/src/mesa/tnl/t_split_copy.c
> index cbb7eb409f..085ae9a28c 100644
> --- a/src/mesa/tnl/t_split_copy.c
> +++ b/src/mesa/tnl/t_split_copy.c
> @@ -531,7 +531,7 @@ replay_init(struct copy_context *copy)
> for (offset = 0, i = 0; i < copy->nr_varying; i++) {
>const struct tnl_vertex_array *src = copy->varying[i].array;
>const struct gl_array_attributes *srcattr = src->VertexAttrib;
> -  struct tnl_vertex_array *dst = >dstarray[i];
> +  struct tnl_vertex_array *dst =
> >dstarray[copy->varying[i].attr]; struct gl_vertex_buffer_binding
> *dstbind = >varying[i].dstbinding; struct gl_array_attributes
> *dstattr = >varying[i].dstattribs;




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


[Mesa-dev] Introduction to Community and Queries Regarding Task : Unit and performance tests for VA-API

2018-09-01 Thread Iti Shree
Good morning,

I am Iti Shree currently pursuing B.Tech degree in Information and
Technology. I was browsing through some project and saw Xorg project ideas.
Many of them are indeed interesting, though they have precise hardware
requirement (I have AMD processor).

I was reading ideas and I think it's good to start with " Unit and
performance tests for VA-API", however, the task doesn't mention potential
mentors, therefore, I thought I should send a mail.

I'd like to know more about this project and to know who to contact exactly
for further queries regarding the same.

I've already joined irc channels for the respective task as mentioned in
the blog. Thank you for your time.

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


[Mesa-dev] [PATCH] gallium/u_threaded: increase batch size to increase performance

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

This reduces mutex overhead.

+4.4% performance with piglit/drawoverhead, DrawElements, Ryzen X1700
---
 src/gallium/auxiliary/util/u_threaded_context.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/auxiliary/util/u_threaded_context.h 
b/src/gallium/auxiliary/util/u_threaded_context.h
index 53c5a7e8c4c..be6933d05a4 100644
--- a/src/gallium/auxiliary/util/u_threaded_context.h
+++ b/src/gallium/auxiliary/util/u_threaded_context.h
@@ -213,21 +213,21 @@ struct tc_unflushed_batch_token;
  * slots.
  */
 #define TC_MAX_BATCHES10
 
 /* The size of one batch. Non-trivial calls (i.e. not setting a CSO pointer)
  * can occupy multiple call slots.
  *
  * The idea is to have batches as small as possible but large enough so that
  * the queuing and mutex overhead is negligible.
  */
-#define TC_CALLS_PER_BATCH192
+#define TC_CALLS_PER_BATCH768
 
 /* Threshold for when to use the queue or sync. */
 #define TC_MAX_STRING_MARKER_BYTES  512
 
 /* Threshold for when to enqueue buffer/texture_subdata as-is.
  * If the upload size is greater than this, it will do instead:
  * - for buffers: DISCARD_RANGE is done by the threaded context
  * - for textures: sync and call the driver directly
  */
 #define TC_MAX_SUBDATA_BYTES320
-- 
2.17.1

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


Re: [Mesa-dev] Etnaviv on mesa master vs. Array._DrawVAO

2018-09-01 Thread Mathias Fröhlich
Hi,

On Friday, 31 August 2018 12:40:01 CEST Guido Günther wrote:
> Hi,
> I'm looking into forward porting laanwj's patches for GC7000 support to
> current mesa master. Luckily most of it already got merged last November
> with mostly only the texture descriptor support missing(
> https://github.com/laanwj/mesa/commit/b71802207432543745dff471c68fbc40495b48
> 58)
> 
> Putting this on current master leads to this assertion in mesa when running
> kmscube like:
> 
> kmscube: ../src/gallium/drivers/etnaviv/etnaviv_state.c:536:
> etna_vertex_elements_state_create: Assertion `element_size != 0 &&
> end_offset <= 256' failed.
> 
> Printing the value there gives:
> 
> etna_vertex_elements_state_create:535: size: 12, offset: 0, end_offset:
> 12 etna_vertex_elements_state_create:535: size: 12, offset: 576,
> end_offset: 588
> 
> And the bt is:
> 
>Stack trace of thread 2158:
>#0  0xa93427c0 raise (libc.so.6)
>#1  0xa934274c raise (libc.so.6)
>#2  0xa9343bac abort (libc.so.6)
>#3  0xa933bd2c n/a (libc.so.6)
>#4  0xa933bdac __assert_fail (libc.so.6)
>#5  0xa8de468c etna_vertex_elements_state_create
> (imx-drm_dri.so) #6  0xa8757178 u_vbuf_set_vertex_elements_internal
> (imx-drm_dri.so) #7  0xa875726c u_vbuf_set_vertex_elements
> (imx-drm_dri.so) #8  0xa8711bcc cso_set_vertex_elements
> (imx-drm_dri.so) #9  0xa8b28760 set_vertex_attribs (imx-drm_dri.so)
>#10 0xa8b28c9c st_update_array (imx-drm_dri.so)
>#11 0xa8ad4e44 st_validate_state (imx-drm_dri.so)
>#12 0xa8a1e410 prepare_draw (imx-drm_dri.so)
>#13 0xa8a1e488 st_draw_vbo (imx-drm_dri.so)
>#14 0xa8a0ea9c vbo_draw_arrays (imx-drm_dri.so)
>#15 0xa8a0f408 vbo_exec_DrawArrays (imx-drm_dri.so)
>#16 0xa953f7e0 glDrawArrays (libGLESv2.so.2)
>#17 0xd7e62ea0 draw_cube_smooth (kmscube)
>#18 0xd7e64160 atomic_run (kmscube)
>#19 0xa93306e0 __libc_start_main (libc.so.6)
>#20 0xd7e621fc $x (kmscube)
>#21 0xd7e621fc $x (kmscube)
> 
> I've traced this back to this commit:
> 
> 19a91841c347107d877bc750371c5fa4e9b4de19 is the first bad commit
> commit 19a91841c347107d877bc750371c5fa4e9b4de19
> Author: Mathias Fröhlich 
> Date:   Sun Apr 1 20:18:36 2018 +0200
> 
> st/mesa: Use Array._DrawVAO in st_atom_array.c.
> 
> Finally make use of the binding information in the VAO when
> setting up arrays for draw.
> 
> v2: Emit less relocations also for interleaved userspace arrays.
> 
> Reviewed-by: Brian Paul 
> Signed-off-by: Mathias Fröhlich 
> 
> And indeed commits prior to that one work as expected. Any hints what
> would be the right fix to not trigger the assert?


Introduce a gallium cap and feed ctx->Const.MaxVertexAttribRelativeOffset with 
the value that limits the actual hardware.

I have something prepared for that but did not get any response for a some 
preparation patch so put that issue somehow down on my list.
The point for today is, is that my development system is down, means I can 
prepare this once this machine is back up hopefully by the beginning of this 
week.
Else feel free to just introduce that cap.

best
Mathias


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


[Mesa-dev] [PATCH 3/4] gallium/u_inlines: improve pipe_reference_described perf for debug builds

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

+41% performance in debug builds
(testing piglit/drawoverhead + u_threaded_context)
---
 src/gallium/auxiliary/util/u_inlines.h | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_inlines.h 
b/src/gallium/auxiliary/util/u_inlines.h
index 19c6c7b75dd..815ac5c97ac 100644
--- a/src/gallium/auxiliary/util/u_inlines.h
+++ b/src/gallium/auxiliary/util/u_inlines.h
@@ -72,28 +72,29 @@ pipe_is_referenced(struct pipe_reference *src)
 static inline boolean
 pipe_reference_described(struct pipe_reference *dst,
  struct pipe_reference *src,
  debug_reference_descriptor get_desc)
 {
boolean destroy = FALSE;
 
if (dst != src) {
   /* bump the reference.count first */
   if (src) {
- assert(pipe_is_referenced(src));
- p_atomic_inc(>count);
+ MAYBE_UNUSED int count = p_atomic_inc_return(>count);
+ assert(count != 1); /* src had to be referenced */
  debug_reference(src, get_desc, 1);
   }
 
   if (dst) {
- assert(pipe_is_referenced(dst));
- if (p_atomic_dec_zero(>count))
+ int count = p_atomic_dec_return(>count);
+ assert(count != -1); /* dst had to be referenced */
+ if (!count)
 destroy = TRUE;
 
  debug_reference(dst, get_desc, -1);
   }
}
 
return destroy;
 }
 
 static inline boolean
-- 
2.17.1

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


[Mesa-dev] [PATCH 2/4] gallium/auxiliary: don't dereference counters twice needlessly

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

+1.2% performance
---
 src/gallium/auxiliary/util/u_inlines.h | 17 ++---
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_inlines.h 
b/src/gallium/auxiliary/util/u_inlines.h
index 7eb243779f7..19c6c7b75dd 100644
--- a/src/gallium/auxiliary/util/u_inlines.h
+++ b/src/gallium/auxiliary/util/u_inlines.h
@@ -102,50 +102,52 @@ pipe_reference(struct pipe_reference *dst, struct 
pipe_reference *src)
return pipe_reference_described(dst, src,
(debug_reference_descriptor)
debug_describe_reference);
 }
 
 static inline void
 pipe_surface_reference(struct pipe_surface **dst, struct pipe_surface *src)
 {
struct pipe_surface *old_dst = *dst;
 
-   if (pipe_reference_described(&(*dst)->reference, >reference,
+   if (pipe_reference_described(_dst->reference, >reference,
 (debug_reference_descriptor)
 debug_describe_surface))
   old_dst->context->surface_destroy(old_dst->context, old_dst);
*dst = src;
 }
 
 /**
  * Similar to pipe_surface_reference() but always set the pointer to NULL
  * and pass in an explicit context.  The explicit context avoids the problem
  * of using a deleted context's surface_destroy() method when freeing a surface
  * that's shared by multiple contexts.
  */
 static inline void
 pipe_surface_release(struct pipe_context *pipe, struct pipe_surface **ptr)
 {
-   if (pipe_reference_described(&(*ptr)->reference, NULL,
+   struct pipe_surface *old = *ptr;
+
+   if (pipe_reference_described(>reference, NULL,
 (debug_reference_descriptor)
 debug_describe_surface))
-  pipe->surface_destroy(pipe, *ptr);
+  pipe->surface_destroy(pipe, old);
*ptr = NULL;
 }
 
 
 static inline void
 pipe_resource_reference(struct pipe_resource **dst, struct pipe_resource *src)
 {
struct pipe_resource *old_dst = *dst;
 
-   if (pipe_reference_described(&(*dst)->reference, >reference,
+   if (pipe_reference_described(_dst->reference, >reference,
 (debug_reference_descriptor)
 debug_describe_resource)) {
   /* Avoid recursion, which would prevent inlining this function */
   do {
  struct pipe_resource *next = old_dst->next;
 
  old_dst->screen->resource_destroy(old_dst->screen, old_dst);
  old_dst = next;
   } while (pipe_reference_described(_dst->reference, NULL,
 (debug_reference_descriptor)
@@ -159,53 +161,54 @@ pipe_resource_reference(struct pipe_resource **dst, 
struct pipe_resource *src)
  *
  * The caller must guarantee that \p view and *ptr must have been created in
  * the same context (if they exist), and that this must be the current context.
  */
 static inline void
 pipe_sampler_view_reference(struct pipe_sampler_view **dst,
 struct pipe_sampler_view *src)
 {
struct pipe_sampler_view *old_dst = *dst;
 
-   if (pipe_reference_described(&(*dst)->reference, >reference,
+   if (pipe_reference_described(_dst->reference, >reference,
 (debug_reference_descriptor)
 debug_describe_sampler_view))
   old_dst->context->sampler_view_destroy(old_dst->context, old_dst);
*dst = src;
 }
 
 /**
  * Similar to pipe_sampler_view_reference() but always set the pointer to
  * NULL and pass in the current context explicitly.
  *
  * If *ptr is non-NULL, it may refer to a view that was created in a different
  * context (however, that context must still be alive).
  */
 static inline void
 pipe_sampler_view_release(struct pipe_context *ctx,
   struct pipe_sampler_view **ptr)
 {
struct pipe_sampler_view *old_view = *ptr;
-   if (pipe_reference_described(&(*ptr)->reference, NULL,
+
+   if (pipe_reference_described(_view->reference, NULL,
 (debug_reference_descriptor)debug_describe_sampler_view)) {
   ctx->sampler_view_destroy(ctx, old_view);
}
*ptr = NULL;
 }
 
 static inline void
 pipe_so_target_reference(struct pipe_stream_output_target **dst,
  struct pipe_stream_output_target *src)
 {
struct pipe_stream_output_target *old_dst = *dst;
 
-   if (pipe_reference_described(&(*dst)->reference, >reference,
+   if (pipe_reference_described(_dst->reference, >reference,
  (debug_reference_descriptor)debug_describe_so_target))
   old_dst->context->stream_output_target_destroy(old_dst->context, 
old_dst);
*dst = src;
 }
 
 static inline void
 pipe_vertex_buffer_unreference(struct pipe_vertex_buffer *dst)
 {
if (dst->is_user_buffer)
   dst->buffer.user = NULL;
-- 
2.17.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org

[Mesa-dev] [PATCH 4/4] gallium/u_inlines: remove the destroy variable in pipe_reference_described

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

---
 src/gallium/auxiliary/util/u_inlines.h | 9 +++--
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_inlines.h 
b/src/gallium/auxiliary/util/u_inlines.h
index 815ac5c97ac..8f468c58e6a 100644
--- a/src/gallium/auxiliary/util/u_inlines.h
+++ b/src/gallium/auxiliary/util/u_inlines.h
@@ -67,41 +67,38 @@ pipe_is_referenced(struct pipe_reference *src)
  * Update reference counting.
  * The old thing pointed to, if any, will be unreferenced.
  * Both 'ptr' and 'reference' may be NULL.
  * \return TRUE if the object's refcount hits zero and should be destroyed.
  */
 static inline boolean
 pipe_reference_described(struct pipe_reference *dst,
  struct pipe_reference *src,
  debug_reference_descriptor get_desc)
 {
-   boolean destroy = FALSE;
-
if (dst != src) {
   /* bump the reference.count first */
   if (src) {
  MAYBE_UNUSED int count = p_atomic_inc_return(>count);
  assert(count != 1); /* src had to be referenced */
  debug_reference(src, get_desc, 1);
   }
 
   if (dst) {
  int count = p_atomic_dec_return(>count);
  assert(count != -1); /* dst had to be referenced */
- if (!count)
-destroy = TRUE;
-
  debug_reference(dst, get_desc, -1);
+ if (!count)
+return true;
   }
}
 
-   return destroy;
+   return false;
 }
 
 static inline boolean
 pipe_reference(struct pipe_reference *dst, struct pipe_reference *src)
 {
return pipe_reference_described(dst, src,
(debug_reference_descriptor)
debug_describe_reference);
 }
 
-- 
2.17.1

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


[Mesa-dev] [PATCH 1/4] gallium/u_inlines: normalize naming, use dst & src, style fixes

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

---
 src/gallium/auxiliary/util/u_inlines.h | 86 +-
 1 file changed, 43 insertions(+), 43 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_inlines.h 
b/src/gallium/auxiliary/util/u_inlines.h
index dee6f8f2d9e..7eb243779f7 100644
--- a/src/gallium/auxiliary/util/u_inlines.h
+++ b/src/gallium/auxiliary/util/u_inlines.h
@@ -45,139 +45,139 @@
 extern "C" {
 #endif
 
 
 /*
  * Reference counting helper functions.
  */
 
 
 static inline void
-pipe_reference_init(struct pipe_reference *reference, unsigned count)
+pipe_reference_init(struct pipe_reference *dst, unsigned count)
 {
-   p_atomic_set(>count, count);
+   p_atomic_set(>count, count);
 }
 
 static inline boolean
-pipe_is_referenced(struct pipe_reference *reference)
+pipe_is_referenced(struct pipe_reference *src)
 {
-   return p_atomic_read(>count) != 0;
+   return p_atomic_read(>count) != 0;
 }
 
 /**
  * Update reference counting.
  * The old thing pointed to, if any, will be unreferenced.
  * Both 'ptr' and 'reference' may be NULL.
  * \return TRUE if the object's refcount hits zero and should be destroyed.
  */
 static inline boolean
-pipe_reference_described(struct pipe_reference *ptr,
- struct pipe_reference *reference,
+pipe_reference_described(struct pipe_reference *dst,
+ struct pipe_reference *src,
  debug_reference_descriptor get_desc)
 {
boolean destroy = FALSE;
 
-   if(ptr != reference) {
+   if (dst != src) {
   /* bump the reference.count first */
-  if (reference) {
- assert(pipe_is_referenced(reference));
- p_atomic_inc(>count);
- debug_reference(reference, get_desc, 1);
+  if (src) {
+ assert(pipe_is_referenced(src));
+ p_atomic_inc(>count);
+ debug_reference(src, get_desc, 1);
   }
 
-  if (ptr) {
- assert(pipe_is_referenced(ptr));
- if (p_atomic_dec_zero(>count)) {
+  if (dst) {
+ assert(pipe_is_referenced(dst));
+ if (p_atomic_dec_zero(>count))
 destroy = TRUE;
- }
- debug_reference(ptr, get_desc, -1);
+
+ debug_reference(dst, get_desc, -1);
   }
}
 
return destroy;
 }
 
 static inline boolean
-pipe_reference(struct pipe_reference *ptr, struct pipe_reference *reference)
+pipe_reference(struct pipe_reference *dst, struct pipe_reference *src)
 {
-   return pipe_reference_described(ptr, reference,
+   return pipe_reference_described(dst, src,
(debug_reference_descriptor)
debug_describe_reference);
 }
 
 static inline void
-pipe_surface_reference(struct pipe_surface **ptr, struct pipe_surface *surf)
+pipe_surface_reference(struct pipe_surface **dst, struct pipe_surface *src)
 {
-   struct pipe_surface *old_surf = *ptr;
+   struct pipe_surface *old_dst = *dst;
 
-   if (pipe_reference_described(&(*ptr)->reference, >reference,
+   if (pipe_reference_described(&(*dst)->reference, >reference,
 (debug_reference_descriptor)
 debug_describe_surface))
-  old_surf->context->surface_destroy(old_surf->context, old_surf);
-   *ptr = surf;
+  old_dst->context->surface_destroy(old_dst->context, old_dst);
+   *dst = src;
 }
 
 /**
  * Similar to pipe_surface_reference() but always set the pointer to NULL
  * and pass in an explicit context.  The explicit context avoids the problem
  * of using a deleted context's surface_destroy() method when freeing a surface
  * that's shared by multiple contexts.
  */
 static inline void
 pipe_surface_release(struct pipe_context *pipe, struct pipe_surface **ptr)
 {
if (pipe_reference_described(&(*ptr)->reference, NULL,
 (debug_reference_descriptor)
 debug_describe_surface))
   pipe->surface_destroy(pipe, *ptr);
*ptr = NULL;
 }
 
 
 static inline void
-pipe_resource_reference(struct pipe_resource **ptr, struct pipe_resource *tex)
+pipe_resource_reference(struct pipe_resource **dst, struct pipe_resource *src)
 {
-   struct pipe_resource *old_tex = *ptr;
+   struct pipe_resource *old_dst = *dst;
 
-   if (pipe_reference_described(&(*ptr)->reference, >reference,
+   if (pipe_reference_described(&(*dst)->reference, >reference,
 (debug_reference_descriptor)
 debug_describe_resource)) {
   /* Avoid recursion, which would prevent inlining this function */
   do {
- struct pipe_resource *next = old_tex->next;
+ struct pipe_resource *next = old_dst->next;
 
- old_tex->screen->resource_destroy(old_tex->screen, old_tex);
- old_tex = next;
-  } while (pipe_reference_described(_tex->reference, NULL,
+ old_dst->screen->resource_destroy(old_dst->screen, old_dst);
+ old_dst = next;
+  } while