[Mesa-dev] [Bug 107022] [RADV] The Witcher 3: Trembling of trees

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

--- Comment #22 from zefkerri...@gmail.com ---
Created attachment 142404
  --> https://bugs.freedesktop.org/attachment.cgi?id=142404&action=edit
All minimal settings

-- 
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


[Mesa-dev] [Bug 107022] [RADV] The Witcher 3: Trembling of trees

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

--- Comment #23 from Samuel Pitoiset  ---
I'm having troubles to reproduce the problem on my Pitcairn card. Can you show
me the output of R600_DEBUG=info glxgears ?

-- 
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 00/13] query validation fixes

2018-11-08 Thread Erik Faye-Lund
On Thu, 2018-11-08 at 08:47 +0200, Tapani Pälli wrote:
> FYI there's a whole lot of tests that start to fail when this series 
> running on Intel CI. It includes dEQP but also Piglit tests, can you
> do 
> Intel CI run or do you want me to send you results?

If you mean mesa-ci.01.org, then I have no clue how to do this... If
you could pass me the results, that'd be great! Or perhaps these are
the results? 
https://mesa-ci.01.org/tpalli/builds/623/group/63a9f0ea7bb98050796b649e85481845

I also wouldn't mind being able to trigger test-runs manually if some
credentials or whatnot could be set up ;)


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


Re: [Mesa-dev] [PATCH 00/13] query validation fixes

2018-11-08 Thread Tapani Pälli


On 11/8/18 10:44 AM, Erik Faye-Lund wrote:

On Thu, 2018-11-08 at 08:47 +0200, Tapani Pälli wrote:

FYI there's a whole lot of tests that start to fail when this series
running on Intel CI. It includes dEQP but also Piglit tests, can you
do
Intel CI run or do you want me to send you results?


If you mean mesa-ci.01.org, then I have no clue how to do this... If
you could pass me the results, that'd be great! Or perhaps these are
the results?
https://mesa-ci.01.org/tpalli/builds/623/group/63a9f0ea7bb98050796b649e85481845


Yep, this is it!


I also wouldn't mind being able to trigger test-runs manually if some
credentials or whatnot could be set up ;)



I'm not sure how this process goes but if you want me to do re-run 
that's fine.


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


Re: [Mesa-dev] [PATCH 00/13] query validation fixes

2018-11-08 Thread Erik Faye-Lund
On Thu, 2018-11-08 at 10:47 +0200, Tapani Pälli wrote:
> On 11/8/18 10:44 AM, Erik Faye-Lund wrote:
> > On Thu, 2018-11-08 at 08:47 +0200, Tapani Pälli wrote:
> > > FYI there's a whole lot of tests that start to fail when this
> > > series
> > > running on Intel CI. It includes dEQP but also Piglit tests, can
> > > you
> > > do
> > > Intel CI run or do you want me to send you results?
> > 
> > If you mean mesa-ci.01.org, then I have no clue how to do this...
> > If
> > you could pass me the results, that'd be great! Or perhaps these
> > are
> > the results?
> > https://mesa-ci.01.org/tpalli/builds/623/group/63a9f0ea7bb98050796b649e85481845
> 
> Yep, this is it!
> 
> > I also wouldn't mind being able to trigger test-runs manually if
> > some
> > credentials or whatnot could be set up ;)
> > 
> 
> I'm not sure how this process goes but if you want me to do re-run 
> that's fine.
> 
> // Tapani

Cool. I already have a tentative patch, seems I missed
OES_geometry_shader:

---8<---
diff --git a/src/mesa/main/queryobj.c b/src/mesa/main/queryobj.c
index 5c455a6db81..80ef3025285 100644
--- a/src/mesa/main/queryobj.c
+++ b/src/mesa/main/queryobj.c
@@ -187,7 +187,8 @@ get_query_binding_point(struct gl_context *ctx,
GLenum target, GLuint index)
   else
  return NULL;
case GL_PRIMITIVES_GENERATED:
-  if (_mesa_has_EXT_transform_feedback(ctx))
+  if (_mesa_has_EXT_transform_feedback(ctx) ||
+  _mesa_has_OES_geometry_shader(ctx))
  return &ctx->Query.PrimitivesGenerated[index];
   else
  return NULL;
---8<---

I'll dig a bit more through logs to look for more mistakes, though.

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


Re: [Mesa-dev] [PATCH 00/31] nir: Use a 1-bit data type for booleans

2018-11-08 Thread Iago Toral
I just noticed I never replied to this:
On Tue, 2018-10-30 at 10:18 -0500, Jason Ekstrand wrote:
> On Tue, Oct 30, 2018 at 2:50 AM Iago Toral  wrote:
> > Some quick comments on this after experimenting with it:
> > 
> > 
> > 
> > Intel hardware produces booleans of the same bit-size as the
> > operations
> > 
> > that generates them so I am working on expanding this to add
> > another
> > 
> > lowering pass that can lower them to smaller bit-sizes.
> > 
> > 
> > 
> > I have a work-in-progress prototype of this and it is significantly
> > 
> > easier, at least for us, to do this as a lowering pass in NIR SSA
> > form
> > 
> > than in the backend. Specifically, doing it in the backend means
> > that
> > 
> > we have to deal with propagating the bit-sizes of the booleans
> > across
> > 
> > operation chains and across CFG blocks, which isn't fun.
> > 
> > 
> > 
> > There are still a few things that I am figuring out:
> > 
> > 
> > 
> > Right now I lower instructions as I find them, deciding about the
> > bit-
> > 
> > size of the destination based on the bit-size of the sources. This
> > 
> > usually works fine because by the time we reach an instruction that
> > 
> > reads boolean sources we have already lowered the instructions that
> > 
> > produced them. However, this also means that we need to make
> > decisions
> > 
> > about the bit-sizes of constant booleans before we know which bit-
> > size
> > 
> > is required for them, it could be that we need them as 32-bit
> > booleans
> > 
> > only, 16-bit booleans only, or maybe both. Right now I am assuming
> > that
> > 
> > constants are 32-bit always, which means that at the moment I have
> > to
> > 
> > inject a MOV when they are used in 16-bit instructions. We can
> > probably
> > 
> > do better, at least in some cases, if we inspect all uses of the
> > 
> > constants before we lower them.
> 
> If we did a step of constant folding, wouldn't the constant booleans
> get nicely folded to the right bit-size?

The lowering pass runs late, so we have already run constant folding by
the time we get here. Anyway, I have double checked and the load_const
instructions seem to come with bit-size > 1 in all the cases I have
available from CTS, so maybe this just works already and we never hit
this. With that said, I am not 100% sure if there are any cases where
we could still end up having to lower a 1-bit bool load const
instruction and figuring our a bit-size for it, but at the very least
this looks like it would not be a common case anyway, so maybe we can
deal with that whenwe find an actual case.
> > Another thing we need to deal with is canonicalization. Some
> > 
> > instructions may have boolean sources of different native bit-sizes 
> > and
> > 
> > it looks like we need to choose a canonical bit-size for them in
> > this
> > 
> > case (at least in my experiments this seems to be required for
> > Intel).
> > 
> > For now I am just taking the bit-size of the first source as the
> > 
> > canonical form, but we could try to be smarter about this. In the
> > case
> > 
> > of Intel I think this isn't too bad, because constant operands are
> > 
> > usually second, so for instructions that use a boolean immediate,
> > if we
> > 
> > choose the first source as canonical, we can then adjust the
> > imediate
> > 
> > source without having to emit additional instructions.
> > Unfortunately,
> > 
> > the 16-bit integer tests in CTS are not good to test set for
> > 
> > canonicalization, since they focus very specifically in 16-bit
> > paths
> > 
> > and I don't think we have many cases (if any) of boolean
> > instructions
> > 
> > mixing booleans of different bit-sizzes, so we will probably have
> > to
> > 
> > try and write our more tests to exercise these cases properly.
> > Also, it
> > 
> > might be that some hardware that supports multiple bit-sized
> > booleans
> > 
> > doesn't require canonicalization, in which case we might want to do
> > 
> > this configurable.
> 
> Assuming a back-end that can properly handle 8 and 16-bit booleans, I
> suspect "always go down" would be a reasonable for two reasons:
> 
>  1) It always uses no more bits than the biggest so it helps with
> register pressure
>  2) We can do the conversion "for free" either with a mixed-type
> operation (or of D and W) or, if that doesn't work, by using a
> register region to just reinterpret the D as a scattered out W.
> 
> For that matter, there's a part of me that's tempted to always spill
> to 8-bit for everything other than the comparison operation itself. 
> Again, this is all dependent on having a competent back-end compiler
> which we currently don't have. :-(

Right, doing 8-bit is probably not a good idea for now. Byte
instructions have this annoying restriction by which destinations need
to have a stride of 2 which I think doesn't play well with the
optimizer in general right now, but beyond that, the hardware doesn't
support byte immediates, which means that we lose algebraic and cmod
o

[Mesa-dev] [Bug 107022] [RADV] The Witcher 3: Trembling of trees

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

--- Comment #24 from zefkerri...@gmail.com ---
Created attachment 142405
  --> https://bugs.freedesktop.org/attachment.cgi?id=142405&action=edit
The output of R600_DEBUG=info glxgears

(In reply to Samuel Pitoiset from comment #23)
> I'm having troubles to reproduce the problem on my Pitcairn card. Can you
> show me the output of R600_DEBUG=info glxgears ?

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


[Mesa-dev] [Bug 107022] [RADV] The Witcher 3: Trembling of trees

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

--- Comment #25 from Samuel Pitoiset  ---
Well, you don't have the OpenGL driver installed? (ie. radeonsi)

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


[Mesa-dev] [Bug 107022] [RADV] The Witcher 3: Trembling of trees

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

--- Comment #26 from Samuel Pitoiset  ---
RADV_DEBUG=info vulkaninfo please.

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


[Mesa-dev] [Bug 107022] [RADV] The Witcher 3: Trembling of trees

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

--- Comment #27 from zefkerri...@gmail.com ---
(In reply to Samuel Pitoiset from comment #25)
> Well, you don't have the OpenGL driver installed? (ie. radeonsi)

I use Mesa-git, Wine Staging+DXVK, so RadeonSI not in use.

-- 
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


[Mesa-dev] [Bug 107022] [RADV] The Witcher 3: Trembling of trees

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

--- Comment #28 from zefkerri...@gmail.com ---
(In reply to Samuel Pitoiset from comment #25)
> Well, you don't have the OpenGL driver installed? (ie. radeonsi)

But I haven't this issue with WineD3D/RadeonSI, only with DXVK/RADV.

-- 
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 00/13] query validation fixes

2018-11-08 Thread Erik Faye-Lund
On Thu, 2018-11-08 at 09:54 +0100, Erik Faye-Lund wrote:
> On Thu, 2018-11-08 at 10:47 +0200, Tapani Pälli wrote:
> > On 11/8/18 10:44 AM, Erik Faye-Lund wrote:
> > > On Thu, 2018-11-08 at 08:47 +0200, Tapani Pälli wrote:
> > > > FYI there's a whole lot of tests that start to fail when this
> > > > series
> > > > running on Intel CI. It includes dEQP but also Piglit tests,
> > > > can
> > > > you
> > > > do
> > > > Intel CI run or do you want me to send you results?
> > > 
> > > If you mean mesa-ci.01.org, then I have no clue how to do this...
> > > If
> > > you could pass me the results, that'd be great! Or perhaps these
> > > are
> > > the results?
> > > https://mesa-ci.01.org/tpalli/builds/623/group/63a9f0ea7bb98050796b649e85481845
> > 
> > Yep, this is it!
> > 
> > > I also wouldn't mind being able to trigger test-runs manually if
> > > some
> > > credentials or whatnot could be set up ;)
> > > 
> > 
> > I'm not sure how this process goes but if you want me to do re-run 
> > that's fine.
> > 
> > // Tapani
> 
> Cool. I already have a tentative patch, seems I missed
> OES_geometry_shader:
> 
> ---8<---
> diff --git a/src/mesa/main/queryobj.c b/src/mesa/main/queryobj.c
> index 5c455a6db81..80ef3025285 100644
> --- a/src/mesa/main/queryobj.c
> +++ b/src/mesa/main/queryobj.c
> @@ -187,7 +187,8 @@ get_query_binding_point(struct gl_context *ctx,
> GLenum target, GLuint index)
>else
>   return NULL;
> case GL_PRIMITIVES_GENERATED:
> -  if (_mesa_has_EXT_transform_feedback(ctx))
> +  if (_mesa_has_EXT_transform_feedback(ctx) ||
> +  _mesa_has_OES_geometry_shader(ctx))
>   return &ctx->Query.PrimitivesGenerated[index];
>else
>   return NULL;
> ---8<---
> 
> I'll dig a bit more through logs to look for more mistakes, though.
> 

Here's another one, I forgot to account for the fact that
ARB_occlusion_query isn't enabled in core-contexts:

---8<---
Author: Erik Faye-Lund 
Date:   Thu Nov 8 10:26:09 2018 +0100

squash! mesa/main: fix validation of GL_SAMPLES_PASSED

diff --git a/src/mesa/main/queryobj.c b/src/mesa/main/queryobj.c
index 80ef3025285..842067bff02 100644
--- a/src/mesa/main/queryobj.c
+++ b/src/mesa/main/queryobj.c
@@ -165,7 +165,8 @@ get_query_binding_point(struct gl_context *ctx,
GLenum target, GLuint index)
 {
switch (target) {
case GL_SAMPLES_PASSED:
-  if (_mesa_has_ARB_occlusion_query(ctx))
+  if (_mesa_has_ARB_occlusion_query(ctx) ||
+  _mesa_has_ARB_occlusion_query2(ctx))
  return &ctx->Query.CurrentOcclusionObject;
   else
  return NULL;
---8<---

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


[Mesa-dev] [Bug 107022] [RADV] The Witcher 3: Trembling of trees

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

--- Comment #29 from zefkerri...@gmail.com ---
Created attachment 142406
  --> https://bugs.freedesktop.org/attachment.cgi?id=142406&action=edit
RADV_DEBUG=info vulkaninfo

(In reply to Samuel Pitoiset from comment #26)
> RADV_DEBUG=info vulkaninfo please.

-- 
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


[Mesa-dev] [Bug 107022] [RADV] The Witcher 3: Trembling of trees

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

--- Comment #30 from Samuel Pitoiset  ---
Well, the output doesn't help... It should look like
https://hastebin.com/ujuyujobon

-- 
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 v4 1/2] i965/batch: avoid reverting batch buffer if saved state is an empty

2018-11-08 Thread andrey simiklit
Hello,

I don't know how we usually do in such cases.
Could I just restore back the 'review-by' tags here due to trivial changes
or this patch should pass review process once again?

Thanks,
Andrii.

On Mon, Nov 5, 2018 at 10:42 AM Jordan Justen 
wrote:

> On 2018-11-05 00:11:52, andrey simiklit wrote:
> > Hello,
> >
> > I tested this patch few times and have the following results:
> >
> https://mesa-ci.01.org/global_logic/builds/38/group/63a9f0ea7bb98050796b649e85481845
> >
> https://mesa-ci.01.org/global_logic/builds/41/group/63a9f0ea7bb98050796b649e85481845
> >
> https://mesa-ci.01.org/global_logic/builds/43/group/63a9f0ea7bb98050796b649e85481845
> >
> > All test runs are finished with the following issue on G965:
> >
> > https://mesa-ci.01.org/global_logic/builds/38/results/46496330
> > ext_framebuffer_multisample-accuracy all_samples srgb small depthstencil
> > linear -auto -fbo
> > 
> > ERROR: This test passed when it expected failure
> >
> > Note: Also I checked latest mesa master few times and there was no
> > regression:
> >
> >
> https://mesa-ci.01.org/global_logic/builds/42/group/63a9f0ea7bb98050796b649e85481845
> >
>
> It also looks like the tex3d-maxsize test is back to failing after a
> few seconds on g965, rather than running forever. (So, #108630 is
> fixed by this version.)
>
> https://mesa-ci.01.org/global_logic/builds/38/results/46492597
>
> -Jordan
>
> >
> > On Mon, Nov 5, 2018 at 9:48 AM  wrote:
> >
> > > From: Andrii Simiklit 
> > >
> > > There's no point reverting to the last saved point if that save point
> is
> > > the empty batch, we will just repeat ourselves.
> > >
> > > v2: Merge with new commits, changes was minimized, added the 'fixes'
> tag
> > > v3: Added in to patch series
> > > v4: Fixed the regression which was introduced by this patch
> > > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108630
> > > Reported-by:  Mark Janes 
> > > The solution provided by: Jordan Justen  >
> > >
> > > CC: Chris Wilson 
> > > Fixes: 3faf56ffbdeb "intel: Add an interface for saving/restoring
> > >  the batchbuffer state."
> > > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107626
> > > Signed-off-by: Andrii Simiklit 
> > > ---
> > >  src/mesa/drivers/dri/i965/brw_compute.c   | 3 ++-
> > >  src/mesa/drivers/dri/i965/brw_draw.c  | 3 ++-
> > >  src/mesa/drivers/dri/i965/genX_blorp_exec.c   | 1 +
> > >  src/mesa/drivers/dri/i965/intel_batchbuffer.c | 7 +++
> > >  src/mesa/drivers/dri/i965/intel_batchbuffer.h | 1 +
> > >  5 files changed, 13 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/src/mesa/drivers/dri/i965/brw_compute.c
> > > b/src/mesa/drivers/dri/i965/brw_compute.c
> > > index de08fc3ac1..5c8e3a5d4d 100644
> > > --- a/src/mesa/drivers/dri/i965/brw_compute.c
> > > +++ b/src/mesa/drivers/dri/i965/brw_compute.c
> > > @@ -167,7 +167,7 @@ static void
> > >  brw_dispatch_compute_common(struct gl_context *ctx)
> > >  {
> > > struct brw_context *brw = brw_context(ctx);
> > > -   bool fail_next = false;
> > > +   bool fail_next;
> > >
> > > if (!_mesa_check_conditional_render(ctx))
> > >return;
> > > @@ -185,6 +185,7 @@ brw_dispatch_compute_common(struct gl_context *ctx)
> > > intel_batchbuffer_require_space(brw, 600);
> > > brw_require_statebuffer_space(brw, 2500);
> > > intel_batchbuffer_save_state(brw);
> > > +   fail_next = intel_batchbuffer_saved_state_is_empty(brw);
> > >
> > >   retry:
> > > brw->batch.no_wrap = true;
> > > diff --git a/src/mesa/drivers/dri/i965/brw_draw.c
> > > b/src/mesa/drivers/dri/i965/brw_draw.c
> > > index 8536c04010..19ee3962d7 100644
> > > --- a/src/mesa/drivers/dri/i965/brw_draw.c
> > > +++ b/src/mesa/drivers/dri/i965/brw_draw.c
> > > @@ -885,7 +885,7 @@ brw_draw_single_prim(struct gl_context *ctx,
> > >  {
> > > struct brw_context *brw = brw_context(ctx);
> > > const struct gen_device_info *devinfo = &brw->screen->devinfo;
> > > -   bool fail_next = false;
> > > +   bool fail_next;
> > >
> > > /* Flag BRW_NEW_DRAW_CALL on every draw.  This allows us to have
> > >  * atoms that happen on every draw call.
> > > @@ -898,6 +898,7 @@ brw_draw_single_prim(struct gl_context *ctx,
> > > intel_batchbuffer_require_space(brw, 1500);
> > > brw_require_statebuffer_space(brw, 2400);
> > > intel_batchbuffer_save_state(brw);
> > > +   fail_next = intel_batchbuffer_saved_state_is_empty(brw);
> > >
> > > if (brw->num_instances != prim->num_instances ||
> > > brw->basevertex != prim->basevertex ||
> > > diff --git a/src/mesa/drivers/dri/i965/genX_blorp_exec.c
> > > b/src/mesa/drivers/dri/i965/genX_blorp_exec.c
> > > index 34bfcad03e..a62b88e166 100644
> > > --- a/src/mesa/drivers/dri/i965/genX_blorp_exec.c
> > > +++ b/src/mesa/drivers/dri/i965/genX_blorp_exec.c
> > > @@ -309,6 +309,7 @@ retry:
> > > intel_batchbuffer_require_space(brw, 1400);
> > > brw_require_statebuffer_space(brw, 600);
> > > intel_batchbuffer_save_sta

[Mesa-dev] [Bug 107022] [RADV] The Witcher 3: Trembling of trees

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

--- Comment #31 from zefkerri...@gmail.com ---
Created attachment 142407
  --> https://bugs.freedesktop.org/attachment.cgi?id=142407&action=edit
R600_DEBUG without the game starting

A try #2

-- 
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 08/13] mesa/main: fix validation of GL_TIME_ELAPSED

2018-11-08 Thread Tapani Pälli



On 11/7/18 5:58 PM, Erik Faye-Lund wrote:

ctx->Extensions.EXT_timer_query is set based on the driver-
capabilities, not based on the context type. We need to check against
_mesa_has_EXT_timer_query(ctx) instead to figure out if the extension
is really supported.

This turns usage of GL_TIME_ELAPSED into an error on ES 3, as is
required by the spec.

Signed-off-by: Erik Faye-Lund 
---
  src/mesa/main/queryobj.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/main/queryobj.c b/src/mesa/main/queryobj.c
index 2f178bbf483..e4185073e3b 100644
--- a/src/mesa/main/queryobj.c
+++ b/src/mesa/main/queryobj.c
@@ -196,7 +196,7 @@ get_query_binding_point(struct gl_context *ctx, GLenum 
target, GLuint index)
else
   return NULL;
 case GL_TIME_ELAPSED:
-  if (ctx->Extensions.EXT_timer_query)
+  if (_mesa_has_EXT_timer_query(ctx))
   return &ctx->Query.CurrentTimerObject;


This would need to be:

  if (_mesa_has_EXT_timer_query(ctx) ||
  _mesa_has_EXT_disjoint_timer_query)

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


[Mesa-dev] [Bug 107022] [RADV] The Witcher 3: Trembling of trees

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

--- Comment #32 from Samuel Pitoiset  ---
You have to run the native version of vulkaninfo, not via wine.

"RADV_DEBUG=info vulkaninfo" in a new terminal should just work.

-- 
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 08/13] mesa/main: fix validation of GL_TIME_ELAPSED

2018-11-08 Thread Erik Faye-Lund
On Thu, 2018-11-08 at 11:40 +0200, Tapani Pälli wrote:
> 
> On 11/7/18 5:58 PM, Erik Faye-Lund wrote:
> > ctx->Extensions.EXT_timer_query is set based on the driver-
> > capabilities, not based on the context type. We need to check
> > against
> > _mesa_has_EXT_timer_query(ctx) instead to figure out if the
> > extension
> > is really supported.
> > 
> > This turns usage of GL_TIME_ELAPSED into an error on ES 3, as is
> > required by the spec.
> > 
> > Signed-off-by: Erik Faye-Lund 
> > ---
> >   src/mesa/main/queryobj.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/src/mesa/main/queryobj.c b/src/mesa/main/queryobj.c
> > index 2f178bbf483..e4185073e3b 100644
> > --- a/src/mesa/main/queryobj.c
> > +++ b/src/mesa/main/queryobj.c
> > @@ -196,7 +196,7 @@ get_query_binding_point(struct gl_context *ctx,
> > GLenum target, GLuint index)
> > else
> >return NULL;
> >  case GL_TIME_ELAPSED:
> > -  if (ctx->Extensions.EXT_timer_query)
> > +  if (_mesa_has_EXT_timer_query(ctx))
> >return &ctx->Query.CurrentTimerObject;
> 
> This would need to be:
> 
>if (_mesa_has_EXT_timer_query(ctx) ||
>_mesa_has_EXT_disjoint_timer_query)
> 
> // Tapani

Yeah. There's a similar issue in "mesa/main: fix validation of
GL_TIMESTAMP", where EXT_disjoint_timer_query also allows TIMESTAMP
queries, it seems.

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


[Mesa-dev] [Bug 107022] [RADV] The Witcher 3: Trembling of trees

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

--- Comment #33 from zefkerri...@gmail.com ---
(In reply to Samuel Pitoiset from comment #32)
> You have to run the native version of vulkaninfo, not via wine.
> 
> "RADV_DEBUG=info vulkaninfo" in a new terminal should just work.

This is exactly what I did this time. The fact was that I had misunderstood in
the past times how it should have been done correctly. I believe that now I did
everything right this time.
See here: https://bugs.freedesktop.org/attachment.cgi?id=142407

-- 
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 00/13] query validation fixes

2018-11-08 Thread Erik Faye-Lund
On Thu, 2018-11-08 at 10:47 +0200, Tapani Pälli wrote:
> On 11/8/18 10:44 AM, Erik Faye-Lund wrote:
> > On Thu, 2018-11-08 at 08:47 +0200, Tapani Pälli wrote:
> > > FYI there's a whole lot of tests that start to fail when this
> > > series
> > > running on Intel CI. It includes dEQP but also Piglit tests, can
> > > you
> > > do
> > > Intel CI run or do you want me to send you results?
> > 
> > If you mean mesa-ci.01.org, then I have no clue how to do this...
> > If
> > you could pass me the results, that'd be great! Or perhaps these
> > are
> > the results?
> > https://mesa-ci.01.org/tpalli/builds/623/group/63a9f0ea7bb98050796b649e85481845
> 
> Yep, this is it!
> 

OK, so at least one of those piglit failures (khr_debug-object-
label_gles2) are bugs in the tests, where the test assumes
glBeginQuery(GL_SAMPLES_PASSED, ...) is OK on GLES 2.

The fix for the test is pretty simple, but yeah, it's not going to pass
until this has landed in piglit (I'll send a patch to the list soon):

---8<---
diff --git a/tests/spec/khr_debug/debug-object-label.c
b/tests/spec/khr_debug/debug-object-label.c
index e9617d719..d57315b49 100644
--- a/tests/spec/khr_debug/debug-object-label.c
+++ b/tests/spec/khr_debug/debug-object-label.c
@@ -236,8 +236,13 @@ test_object_label_types()
piglit_get_gl_version() >= 30) {
/* Test QUERY */
glGenQueries(1, &query);
-   glBeginQuery(GL_SAMPLES_PASSED, query);
-   glEndQuery(GL_SAMPLES_PASSED);
+   if
(piglit_is_extension_supported("GL_ARB_occlusion_query")) {
+   glBeginQuery(GL_SAMPLES_PASSED, query);
+   glEndQuery(GL_SAMPLES_PASSED);
+   } else {
+   glBeginQuery(GL_ANY_SAMPLES_PASSED, query);
+   glEndQuery(GL_ANY_SAMPLES_PASSED);
+   }
ObjectLabel(GL_QUERY, query, -1, TestLabel);
GetObjectLabel(GL_QUERY, query, TestLabelLen + 1,
&length[QUERY_IDX], label[QUERY_IDX]);
 
---8<---

> > I also wouldn't mind being able to trigger test-runs manually if
> > some
> > credentials or whatnot could be set up ;)
> > 
> 
> I'm not sure how this process goes but if you want me to do re-run 
> that's fine.

Would you mind re-run with this branch? 
https://gitlab.freedesktop.org/kusma/mesa/tree/queryobj-fixes

It's what I sent + 4 fixues.

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


Re: [Mesa-dev] [PATCH v3] intel/decoder: Engine parameter for instructions

2018-11-08 Thread Lionel Landwerlin

Reviewed-by: Lionel Landwerlin 

On 07/11/2018 14:49, Toni Lönnberg wrote:

Preliminary work for adding handling of different pipes to gen_decoder. Each
instruction needs to have a definition describing which engine it is meant for.
If left undefined, by default, the instruction is defined for all engines.

v2: Changed to use the engine class definitions from UAPI

v3: Changed I915_ENGINE_CLASS_TO_MASK to use BITSET_BIT, change engine to
engine_mask, added check for incorrect engine and added the possibility to
define an instruction to multiple engines using the "|" as a delimiter in the
engine attribute.
---
  src/intel/common/gen_decoder.c | 23 +++
  src/intel/common/gen_decoder.h |  6 ++
  2 files changed, 29 insertions(+)

diff --git a/src/intel/common/gen_decoder.c b/src/intel/common/gen_decoder.c
index 8148b2f1489..79404660f56 100644
--- a/src/intel/common/gen_decoder.c
+++ b/src/intel/common/gen_decoder.c
@@ -165,6 +165,9 @@ create_group(struct parser_context *ctx,
 group->fixed_length = fixed_length;
 group->dword_length_field = NULL;
 group->dw_length = 0;
+   group->engine_mask = I915_ENGINE_CLASS_TO_MASK(I915_ENGINE_CLASS_RENDER) |
+I915_ENGINE_CLASS_TO_MASK(I915_ENGINE_CLASS_VIDEO) |
+I915_ENGINE_CLASS_TO_MASK(I915_ENGINE_CLASS_COPY);
 group->bias = 1;
  
 for (int i = 0; atts[i]; i += 2) {

@@ -173,6 +176,26 @@ create_group(struct parser_context *ctx,
   group->dw_length = strtoul(atts[i + 1], &p, 0);
} else if (strcmp(atts[i], "bias") == 0) {
   group->bias = strtoul(atts[i + 1], &p, 0);
+  } else if (strcmp(atts[i], "engine") == 0) {
+ void *mem_ctx = ralloc_context(NULL);
+ char *tmp = ralloc_strdup(mem_ctx, atts[i + 1]);
+ char *save_ptr;
+ char *tok = strtok_r(tmp, "|", &save_ptr);
+
+ group->engine_mask = 0;
+ while (tok != NULL) {
+if (strcmp(tok, "render") == 0) {
+   group->engine_mask |= 
I915_ENGINE_CLASS_TO_MASK(I915_ENGINE_CLASS_RENDER);
+} else if (strcmp(tok, "video") == 0) {
+   group->engine_mask |= 
I915_ENGINE_CLASS_TO_MASK(I915_ENGINE_CLASS_VIDEO);
+} else if (strcmp(tok, "blitter") == 0) {
+   group->engine_mask |= 
I915_ENGINE_CLASS_TO_MASK(I915_ENGINE_CLASS_COPY);
+} else {
+   fprintf(stderr, "unknown engine class defined for instruction 
\"%s\": %s\n", name, atts[i + 1]);
+}
+
+tok = strtok_r(NULL, "|", &save_ptr);
+ }
}
 }
  
diff --git a/src/intel/common/gen_decoder.h b/src/intel/common/gen_decoder.h

index 4beed22d729..4311f58b4eb 100644
--- a/src/intel/common/gen_decoder.h
+++ b/src/intel/common/gen_decoder.h
@@ -30,6 +30,9 @@
  
  #include "dev/gen_device_info.h"

  #include "util/hash_table.h"
+#include "util/bitset.h"
+
+#include "drm-uapi/i915_drm.h"
  
  #ifdef __cplusplus

  extern "C" {
@@ -40,6 +43,8 @@ struct gen_group;
  struct gen_field;
  union gen_field_value;
  
+#define I915_ENGINE_CLASS_TO_MASK(x) BITSET_BIT(x)

+
  static inline uint32_t gen_make_gen(uint32_t major, uint32_t minor)
  {
 return (major << 8) | minor;
@@ -102,6 +107,7 @@ struct gen_group {
 struct gen_field *dword_length_field; /*  specific */
  
 uint32_t dw_length;

+   uint32_t engine_mask; /*  specific */
 uint32_t bias; /*  specific */
 uint32_t group_offset, group_count;
 uint32_t group_size;



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


Re: [Mesa-dev] [PATCH v3] intel/decoder: tools: Use engine for decoding batch instructions

2018-11-08 Thread Lionel Landwerlin

Reviewed-by: Lionel Landwerlin 

On 07/11/2018 14:50, Toni Lönnberg wrote:

The engine to which the batch was sent to is now set to the decoder context when
decoding the batch. This is needed so that we can distinguish between
instructions as the render and video pipe share some of the instruction opcodes.

v2: The engine is now in the decoder context and the batch decoder uses a local
function for finding the instruction for an engine.

v3: Spec uses engine_mask now instead of engine, replaced engine class enums
with the definitions from UAPI.
---
  src/intel/common/gen_batch_decoder.c | 25 +---
  src/intel/common/gen_decoder.c   |  7 ++-
  src/intel/common/gen_decoder.h   |  6 +-
  src/intel/tools/aubinator.c  |  3 +-
  src/intel/tools/aubinator_error_decode.c | 73 
  5 files changed, 63 insertions(+), 51 deletions(-)

diff --git a/src/intel/common/gen_batch_decoder.c 
b/src/intel/common/gen_batch_decoder.c
index 63f04627572..d5482a4d455 100644
--- a/src/intel/common/gen_batch_decoder.c
+++ b/src/intel/common/gen_batch_decoder.c
@@ -45,6 +45,7 @@ gen_batch_decode_ctx_init(struct gen_batch_decode_ctx *ctx,
 ctx->fp = fp;
 ctx->flags = flags;
 ctx->max_vbo_decoded_lines = -1; /* No limit! */
+   ctx->engine = I915_ENGINE_CLASS_RENDER;
  
 if (xml_path == NULL)

ctx->spec = gen_spec_load(devinfo);
@@ -192,10 +193,16 @@ ctx_print_buffer(struct gen_batch_decode_ctx *ctx,
 fprintf(ctx->fp, "\n");
  }
  
+static struct gen_group *

+gen_ctx_find_instruction(struct gen_batch_decode_ctx *ctx, const uint32_t *p)
+{
+   return gen_spec_find_instruction(ctx->spec, ctx->engine, p);
+}
+
  static void
  handle_state_base_address(struct gen_batch_decode_ctx *ctx, const uint32_t *p)
  {
-   struct gen_group *inst = gen_spec_find_instruction(ctx->spec, p);
+   struct gen_group *inst = gen_ctx_find_instruction(ctx, p);
  
 struct gen_field_iterator iter;

 gen_field_iterator_init(&iter, inst, p, 0, false);
@@ -309,7 +316,7 @@ static void
  handle_media_interface_descriptor_load(struct gen_batch_decode_ctx *ctx,
 const uint32_t *p)
  {
-   struct gen_group *inst = gen_spec_find_instruction(ctx->spec, p);
+   struct gen_group *inst = gen_ctx_find_instruction(ctx, p);
 struct gen_group *desc =
gen_spec_find_struct(ctx->spec, "INTERFACE_DESCRIPTOR_DATA");
  
@@ -373,7 +380,7 @@ static void

  handle_3dstate_vertex_buffers(struct gen_batch_decode_ctx *ctx,
const uint32_t *p)
  {
-   struct gen_group *inst = gen_spec_find_instruction(ctx->spec, p);
+   struct gen_group *inst = gen_ctx_find_instruction(ctx, p);
 struct gen_group *vbs = gen_spec_find_struct(ctx->spec, 
"VERTEX_BUFFER_STATE");
  
 struct gen_batch_decode_bo vb = {};

@@ -436,7 +443,7 @@ static void
  handle_3dstate_index_buffer(struct gen_batch_decode_ctx *ctx,
  const uint32_t *p)
  {
-   struct gen_group *inst = gen_spec_find_instruction(ctx->spec, p);
+   struct gen_group *inst = gen_ctx_find_instruction(ctx, p);
  
 struct gen_batch_decode_bo ib = {};

 uint32_t ib_size = 0;
@@ -486,7 +493,7 @@ handle_3dstate_index_buffer(struct gen_batch_decode_ctx 
*ctx,
  static void
  decode_single_ksp(struct gen_batch_decode_ctx *ctx, const uint32_t *p)
  {
-   struct gen_group *inst = gen_spec_find_instruction(ctx->spec, p);
+   struct gen_group *inst = gen_ctx_find_instruction(ctx, p);
  
 uint64_t ksp = 0;

 bool is_simd8 = false; /* vertex shaders on Gen8+ only */
@@ -528,7 +535,7 @@ decode_single_ksp(struct gen_batch_decode_ctx *ctx, const 
uint32_t *p)
  static void
  decode_ps_kernels(struct gen_batch_decode_ctx *ctx, const uint32_t *p)
  {
-   struct gen_group *inst = gen_spec_find_instruction(ctx->spec, p);
+   struct gen_group *inst = gen_ctx_find_instruction(ctx, p);
  
 uint64_t ksp[3] = {0, 0, 0};

 bool enabled[3] = {false, false, false};
@@ -576,7 +583,7 @@ decode_ps_kernels(struct gen_batch_decode_ctx *ctx, const 
uint32_t *p)
  static void
  decode_3dstate_constant(struct gen_batch_decode_ctx *ctx, const uint32_t *p)
  {
-   struct gen_group *inst = gen_spec_find_instruction(ctx->spec, p);
+   struct gen_group *inst = gen_ctx_find_instruction(ctx, p);
 struct gen_group *body =
gen_spec_find_struct(ctx->spec, "3DSTATE_CONSTANT_BODY");
  
@@ -658,7 +665,7 @@ decode_dynamic_state_pointers(struct gen_batch_decode_ctx *ctx,

const char *struct_type, const uint32_t *p,
int count)
  {
-   struct gen_group *inst = gen_spec_find_instruction(ctx->spec, p);
+   struct gen_group *inst = gen_ctx_find_instruction(ctx, p);
  
 uint32_t state_offset = 0;
  
@@ -802,7 +809,7 @@ gen_print_batch(struct gen_batch_decode_ctx *ctx,

 struct gen_group *inst;
  
 for (p = batch; p < end; p += length) {

-  inst = gen_spec_find_instruction(ctx->spec, p)

Re: [Mesa-dev] [PATCH v3] intel/decoder: tools: gen_engine to drm_i915_gem_engine_class

2018-11-08 Thread Lionel Landwerlin
Actually I take that back. Could you update 
src/intel/tools/aubinator_viewer.cpp too?

To compile it with meson just pass the -Dtools=intel-ui option.

Thanks,

-
Lionel

On 06/11/2018 12:17, Lionel Landwerlin wrote:

Looks good, thanks!

Reviewed-by: Lionel Landwerlin 

On 31/10/2018 13:57, Toni Lönnberg wrote:
Removed the gen_engine enum and changed the involved functions to use 
the

drm_i915_gem_engine_class enum from UAPI instead.

v3: Wrong engine was being used for blocks in video ring
---
  src/intel/tools/aub_read.c  | 22 +++---
  src/intel/tools/aub_read.h  | 11 +++
  src/intel/tools/aubinator.c |  5 ++---
  3 files changed, 16 insertions(+), 22 deletions(-)

diff --git a/src/intel/tools/aub_read.c b/src/intel/tools/aub_read.c
index d83e88ddced..1b6787d4a97 100644
--- a/src/intel/tools/aub_read.c
+++ b/src/intel/tools/aub_read.c
@@ -136,7 +136,7 @@ handle_trace_block(struct aub_read *read, const 
uint32_t *p)

 int type = p[1] & AUB_TRACE_TYPE_MASK;
 int address_space = p[1] & AUB_TRACE_ADDRESS_SPACE_MASK;
 int header_length = p[0] & 0x;
-   int engine = GEN_ENGINE_RENDER;
+   enum drm_i915_gem_engine_class engine = I915_ENGINE_CLASS_RENDER;
 const void *data = p + header_length + 2;
 uint64_t address = gen_48b_address((read->devinfo.gen >= 8 ? 
((uint64_t) p[5] << 32) : 0) |

    ((uint64_t) p[3]));
@@ -151,13 +151,13 @@ handle_trace_block(struct aub_read *read, const 
uint32_t *p)

 case AUB_TRACE_OP_COMMAND_WRITE:
    switch (type) {
    case AUB_TRACE_TYPE_RING_PRB0:
- engine = GEN_ENGINE_RENDER;
+ engine = I915_ENGINE_CLASS_RENDER;
   break;
    case AUB_TRACE_TYPE_RING_PRB1:
- engine = GEN_ENGINE_VIDEO;
+ engine = I915_ENGINE_CLASS_VIDEO;
   break;
    case AUB_TRACE_TYPE_RING_PRB2:
- engine = GEN_ENGINE_BLITTER;
+ engine = I915_ENGINE_CLASS_COPY;
   break;
    default:
   parse_error(read, p, "command write to unknown ring %d\n", 
type);
@@ -182,7 +182,7 @@ handle_memtrace_reg_write(struct aub_read *read, 
const uint32_t *p)

 if (read->reg_write)
    read->reg_write(read->user_data, offset, value);
  -   int engine;
+   enum drm_i915_gem_engine_class engine;
 uint64_t context_descriptor;
   switch (offset) {
@@ -192,7 +192,7 @@ handle_memtrace_reg_write(struct aub_read *read, 
const uint32_t *p)

   return;
      read->render_elsp_index = 0;
-  engine = GEN_ENGINE_RENDER;
+  engine = I915_ENGINE_CLASS_RENDER;
    context_descriptor = (uint64_t)read->render_elsp[2] << 32 |
   read->render_elsp[3];
    break;
@@ -202,7 +202,7 @@ handle_memtrace_reg_write(struct aub_read *read, 
const uint32_t *p)

   return;
      read->video_elsp_index = 0;
-  engine = GEN_ENGINE_VIDEO;
+  engine = I915_ENGINE_CLASS_VIDEO;
    context_descriptor = (uint64_t)read->video_elsp[2] << 32 |
   read->video_elsp[3];
    break;
@@ -212,7 +212,7 @@ handle_memtrace_reg_write(struct aub_read *read, 
const uint32_t *p)

   return;
      read->blitter_elsp_index = 0;
-  engine = GEN_ENGINE_BLITTER;
+  engine = I915_ENGINE_CLASS_COPY;
    context_descriptor = (uint64_t)read->blitter_elsp[2] << 32 |
   read->blitter_elsp[3];
    break;
@@ -241,17 +241,17 @@ handle_memtrace_reg_write(struct aub_read 
*read, const uint32_t *p)

    return;
    break;
 case 0x2550: /* render elsc */
-  engine = GEN_ENGINE_RENDER;
+  engine = I915_ENGINE_CLASS_RENDER;
    context_descriptor = (uint64_t)read->render_elsp[2] << 32 |
   read->render_elsp[3];
    break;
 case 0x12550: /* video_elsc */
-  engine = GEN_ENGINE_VIDEO;
+  engine = I915_ENGINE_CLASS_VIDEO;
    context_descriptor = (uint64_t)read->video_elsp[2] << 32 |
   read->video_elsp[3];
    break;
 case 0x22550: /* blitter elsc */
-  engine = GEN_ENGINE_BLITTER;
+  engine = I915_ENGINE_CLASS_COPY;
    context_descriptor = (uint64_t)read->blitter_elsp[2] << 32 |
   read->blitter_elsp[3];
    break;
diff --git a/src/intel/tools/aub_read.h b/src/intel/tools/aub_read.h
index e48ac3164bc..1e788332dcb 100644
--- a/src/intel/tools/aub_read.h
+++ b/src/intel/tools/aub_read.h
@@ -28,17 +28,12 @@
  #include 
    #include "dev/gen_device_info.h"
+#include "drm-uapi/i915_drm.h"
    #ifdef __cplusplus
  extern "C" {
  #endif
  -enum gen_engine {
-   GEN_ENGINE_RENDER = 1,
-   GEN_ENGINE_VIDEO = 2,
-   GEN_ENGINE_BLITTER = 3,
-};
-
  struct aub_read {
 /* Caller's data */
 void *user_data;
@@ -55,9 +50,9 @@ struct aub_read {
   void (*reg_write)(void *user_data, uint32_t reg_offset, 
uint32_t reg_value);

  -   void (*ring_write)(void *user_data, enum gen_engine engine,
+   void (*ring_write)(void *user_data, enum 
drm_i915_gem_engine_class engine,

    const void *

Re: [Mesa-dev] [PATCH v3 01/10] intel/genxml: Add engine definition to render engine instructions (gen4)

2018-11-08 Thread Lionel Landwerlin

It looks like you forgot URB_FENCE here.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [Mesa-stable] [PATCH] radv: disable conditional rendering for vkCmdCopyQueryPoolResults()

2018-11-08 Thread Juan A. Suarez Romero
On Mon, 2018-11-05 at 09:54 +0100, Samuel Pitoiset wrote:
> VK_EXT_conditional_rendering says that copy commands should not be
> affected by conditional rendering.
> 
> Cc: 18.2 18.3 
> Signed-off-by: Samuel Pitoiset 


This patch didn't apply cleanly on 18.2, so I've resolved the trivial conflicts.

Fixed patch is in 
https://gitlab.freedesktop.org/mesa/mesa/commit/cbd9b4a95d8f502ed22e2377f0b6196dfe9a450d


J.A.

> ---
>  src/amd/vulkan/radv_query.c | 10 ++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/src/amd/vulkan/radv_query.c b/src/amd/vulkan/radv_query.c
> index 494dc24016..067c8e062a 100644
> --- a/src/amd/vulkan/radv_query.c
> +++ b/src/amd/vulkan/radv_query.c
> @@ -913,6 +913,7 @@ static void radv_query_shader(struct radv_cmd_buffer 
> *cmd_buffer,
>  {
>   struct radv_device *device = cmd_buffer->device;
>   struct radv_meta_saved_state saved_state;
> + bool old_predicating;
>  
>   if (!*pipeline) {
>   VkResult ret = 
> radv_device_init_meta_query_state_internal(device);
> @@ -927,6 +928,12 @@ static void radv_query_shader(struct radv_cmd_buffer 
> *cmd_buffer,
>  RADV_META_SAVE_CONSTANTS |
>  RADV_META_SAVE_DESCRIPTORS);
>  
> + /* VK_EXT_conditional_rendering says that copy commands should not be
> +  * affected by conditional rendering.
> +  */
> + old_predicating = cmd_buffer->state.predicating;
> + cmd_buffer->state.predicating = false;
> +
>   struct radv_buffer dst_buffer = {
>   .bo = dst_bo,
>   .offset = dst_offset,
> @@ -1005,6 +1012,9 @@ static void radv_query_shader(struct radv_cmd_buffer 
> *cmd_buffer,
>  
>   radv_unaligned_dispatch(cmd_buffer, count, 1, 1);
>  
> + /* Restore conditional rendering. */
> + cmd_buffer->state.predicating = old_predicating;
> +
>   radv_meta_restore(&saved_state, cmd_buffer);
>  }
>  

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


Re: [Mesa-dev] [PATCH v3 02/10] intel/genxml: Add engine definition to render engine instructions (gen45)

2018-11-08 Thread Lionel Landwerlin

Missing tag on :


CS_URB_STATE
CONSTANT_BUFFER
MI_FLUSH
URB_FENCE
XY_COLOR_BLT
XY_SETUP_BLT
XY_SRC_COPY_BLT
XY_TEXT_IMMEDIATE_BLT

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


Re: [Mesa-dev] [PATCH v3 03/10] intel/genxml: Add engine definition to render engine instructions (gen5)

2018-11-08 Thread Lionel Landwerlin

Same missing tags a gen4.5
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH v3 04/10] intel/genxml: Add engine definition to render engine instructions (gen6)

2018-11-08 Thread Lionel Landwerlin

Missing render engine tag :


MEDIA_GATEWAY_STATE

MI_LOAD_SCAN_LINES_EXCL

MI_URB_CLEAR


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


Re: [Mesa-dev] [PATCH mesa] util: use *unsigned* ints for bit operations

2018-11-08 Thread Mathias Fröhlich
Good Morning,

I can confirm that the new build gcc-8.2.1-5 from jakub already
available in *-testing fixes the problem for me.

Thanks!!

Mathias


On Saturday, 3 November 2018 15:31:32 CET Mathias Fröhlich wrote:
> Hi,
> 
> > > Before filing a bug report at gcc I wanted to verify that we are not 
> > > doing anything
> > > wrong like with aliasing for example. Which is the reason the bug is not 
> > > filed yet.
> > 
> > FYI I filed a bug in fedora, and Jakub tracked it down and is working
> > it upstream at:
> > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87859
> 
> Thanks a lot!!!
> 
> Mathias
> 
> 
> 
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
> 




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


Re: [Mesa-dev] [PATCH v3 05/10] intel/genxml: Add engine definition to render engine instructions (gen7)

2018-11-08 Thread Lionel Landwerlin

Just SWTESS_BASE_ADDRESS missing render engine
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH v3 06/10] intel/genxml: Add engine definition to render engine instructions (gen75)

2018-11-08 Thread Lionel Landwerlin

Missing render engine :


SWTESS_BASE_ADDRESS

MI_RS_CONTEXT

MI_RS_CONTROL

MI_RS_STORE_DATA_IMM

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


Re: [Mesa-dev] [PATCH v3] intel/decoder: Engine parameter for instructions

2018-11-08 Thread andrey simiklit
Hello,

Please find my comment below:

On Wed, Nov 7, 2018 at 4:49 PM Toni Lönnberg 
wrote:

> Preliminary work for adding handling of different pipes to gen_decoder.
> Each
> instruction needs to have a definition describing which engine it is meant
> for.
> If left undefined, by default, the instruction is defined for all engines.
>
> v2: Changed to use the engine class definitions from UAPI
>
> v3: Changed I915_ENGINE_CLASS_TO_MASK to use BITSET_BIT, change engine to
> engine_mask, added check for incorrect engine and added the possibility to
> define an instruction to multiple engines using the "|" as a delimiter in
> the
> engine attribute.
> ---
>  src/intel/common/gen_decoder.c | 23 +++
>  src/intel/common/gen_decoder.h |  6 ++
>  2 files changed, 29 insertions(+)
>
> diff --git a/src/intel/common/gen_decoder.c
> b/src/intel/common/gen_decoder.c
> index 8148b2f1489..79404660f56 100644
> --- a/src/intel/common/gen_decoder.c
> +++ b/src/intel/common/gen_decoder.c
> @@ -165,6 +165,9 @@ create_group(struct parser_context *ctx,
> group->fixed_length = fixed_length;
> group->dword_length_field = NULL;
> group->dw_length = 0;
> +   group->engine_mask =
> I915_ENGINE_CLASS_TO_MASK(I915_ENGINE_CLASS_RENDER) |
> +
> I915_ENGINE_CLASS_TO_MASK(I915_ENGINE_CLASS_VIDEO) |
> +I915_ENGINE_CLASS_TO_MASK(I915_ENGINE_CLASS_COPY);
> group->bias = 1;
>
> for (int i = 0; atts[i]; i += 2) {
> @@ -173,6 +176,26 @@ create_group(struct parser_context *ctx,
>   group->dw_length = strtoul(atts[i + 1], &p, 0);
>} else if (strcmp(atts[i], "bias") == 0) {
>   group->bias = strtoul(atts[i + 1], &p, 0);
> +  } else if (strcmp(atts[i], "engine") == 0) {
> + void *mem_ctx = ralloc_context(NULL);
> + char *tmp = ralloc_strdup(mem_ctx, atts[i + 1]);
> + char *save_ptr;
> + char *tok = strtok_r(tmp, "|", &save_ptr);
> +
> + group->engine_mask = 0;
> + while (tok != NULL) {
> +if (strcmp(tok, "render") == 0) {
> +   group->engine_mask |=
> I915_ENGINE_CLASS_TO_MASK(I915_ENGINE_CLASS_RENDER);
> +} else if (strcmp(tok, "video") == 0) {
> +   group->engine_mask |=
> I915_ENGINE_CLASS_TO_MASK(I915_ENGINE_CLASS_VIDEO);
> +} else if (strcmp(tok, "blitter") == 0) {
> +   group->engine_mask |=
> I915_ENGINE_CLASS_TO_MASK(I915_ENGINE_CLASS_COPY);
> +} else {
> +   fprintf(stderr, "unknown engine class defined for
> instruction \"%s\": %s\n", name, atts[i + 1]);
> +}
> +
> +tok = strtok_r(NULL, "|", &save_ptr);
> + }
>

Seems like 'ralloc_free(mem_ctx)' is missing here :-)

Regards,
- Andrii


>}
> }
>
> diff --git a/src/intel/common/gen_decoder.h
> b/src/intel/common/gen_decoder.h
> index 4beed22d729..4311f58b4eb 100644
> --- a/src/intel/common/gen_decoder.h
> +++ b/src/intel/common/gen_decoder.h
> @@ -30,6 +30,9 @@
>
>  #include "dev/gen_device_info.h"
>  #include "util/hash_table.h"
> +#include "util/bitset.h"
> +
> +#include "drm-uapi/i915_drm.h"
>
>  #ifdef __cplusplus
>  extern "C" {
> @@ -40,6 +43,8 @@ struct gen_group;
>  struct gen_field;
>  union gen_field_value;
>
> +#define I915_ENGINE_CLASS_TO_MASK(x) BITSET_BIT(x)
> +
>  static inline uint32_t gen_make_gen(uint32_t major, uint32_t minor)
>  {
> return (major << 8) | minor;
> @@ -102,6 +107,7 @@ struct gen_group {
> struct gen_field *dword_length_field; /*  specific */
>
> uint32_t dw_length;
> +   uint32_t engine_mask; /*  specific */
> uint32_t bias; /*  specific */
> uint32_t group_offset, group_count;
> uint32_t group_size;
> --
> 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


Re: [Mesa-dev] [PATCH v3 07/10] intel/genxml: Add engine definition to render engine instructions (gen8)

2018-11-08 Thread Lionel Landwerlin

Missing render :

MI_TOPOLOGY_FILTER

MI_URB_CLEAR

SWTESS_BASE_ADDRESS

MI_RS_STORE_DATA_IMM

MI_RS_CONTROL

MI_RS_CONTEXT

MI_LOAD_URB_MEM

MI_STORE_URB_MEM


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


Re: [Mesa-dev] [PATCH v3 08/10] intel/genxml: Add engine definition to render engine instructions (gen9)

2018-11-08 Thread Lionel Landwerlin

Missing render :


MI_LOAD_URB_MEM

MI_RS_CONTEXT

MI_RS_CONTROL

MI_RS_STORE_DATA_IMM

MI_URB_ATOMIC_ALLOC

MI_TOPOLOGY_FILTER


Render & blitter :

MI_DISPLAY_FLIP

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


Re: [Mesa-dev] [PATCH v3 09/10] intel/genxml: Add engine definition to render engine instructions (gen10)

2018-11-08 Thread Lionel Landwerlin

Probably same as Gen9 :)
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 00/13] query validation fixes

2018-11-08 Thread Tapani Pälli



On 11/8/18 11:53 AM, Erik Faye-Lund wrote:

On Thu, 2018-11-08 at 10:47 +0200, Tapani Pälli wrote:

On 11/8/18 10:44 AM, Erik Faye-Lund wrote:

On Thu, 2018-11-08 at 08:47 +0200, Tapani Pälli wrote:

FYI there's a whole lot of tests that start to fail when this
series
running on Intel CI. It includes dEQP but also Piglit tests, can
you
do
Intel CI run or do you want me to send you results?


If you mean mesa-ci.01.org, then I have no clue how to do this...
If
you could pass me the results, that'd be great! Or perhaps these
are
the results?
https://mesa-ci.01.org/tpalli/builds/623/group/63a9f0ea7bb98050796b649e85481845


Yep, this is it!



OK, so at least one of those piglit failures (khr_debug-object-
label_gles2) are bugs in the tests, where the test assumes
glBeginQuery(GL_SAMPLES_PASSED, ...) is OK on GLES 2.

The fix for the test is pretty simple, but yeah, it's not going to pass
until this has landed in piglit (I'll send a patch to the list soon):

---8<---
diff --git a/tests/spec/khr_debug/debug-object-label.c
b/tests/spec/khr_debug/debug-object-label.c
index e9617d719..d57315b49 100644
--- a/tests/spec/khr_debug/debug-object-label.c
+++ b/tests/spec/khr_debug/debug-object-label.c
@@ -236,8 +236,13 @@ test_object_label_types()
piglit_get_gl_version() >= 30) {
/* Test QUERY */
glGenQueries(1, &query);
-   glBeginQuery(GL_SAMPLES_PASSED, query);
-   glEndQuery(GL_SAMPLES_PASSED);
+   if
(piglit_is_extension_supported("GL_ARB_occlusion_query")) {
+   glBeginQuery(GL_SAMPLES_PASSED, query);
+   glEndQuery(GL_SAMPLES_PASSED);
+   } else {
+   glBeginQuery(GL_ANY_SAMPLES_PASSED, query);
+   glEndQuery(GL_ANY_SAMPLES_PASSED);
+   }
ObjectLabel(GL_QUERY, query, -1, TestLabel);
GetObjectLabel(GL_QUERY, query, TestLabelLen + 1,
&length[QUERY_IDX], label[QUERY_IDX]);
  
---8<---



I also wouldn't mind being able to trigger test-runs manually if
some
credentials or whatnot could be set up ;)



I'm not sure how this process goes but if you want me to do re-run
that's fine.


Would you mind re-run with this branch?
https://gitlab.freedesktop.org/kusma/mesa/tree/queryobj-fixes

It's what I sent + 4 fixues.



Sure, just started a new build. Will let you know, when it finishes.

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


Re: [Mesa-dev] [PATCH v3 10/10] intel/genxml: Add engine definition to render engine instructions (gen11)

2018-11-08 Thread Lionel Landwerlin

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


Re: [Mesa-dev] [PATCH v3] intel/decoder: Engine parameter for instructions

2018-11-08 Thread Toni Lönnberg
On Thu, Nov 08, 2018 at 12:57:03PM +0200, andrey simiklit wrote:
> Hello,
> 
> Please find my comment below:
> 
> On Wed, Nov 7, 2018 at 4:49 PM Toni Lönnberg 
> wrote:
> 
> > Preliminary work for adding handling of different pipes to gen_decoder.
> > Each
> > instruction needs to have a definition describing which engine it is meant
> > for.
> > If left undefined, by default, the instruction is defined for all engines.
> >
> > v2: Changed to use the engine class definitions from UAPI
> >
> > v3: Changed I915_ENGINE_CLASS_TO_MASK to use BITSET_BIT, change engine to
> > engine_mask, added check for incorrect engine and added the possibility to
> > define an instruction to multiple engines using the "|" as a delimiter in
> > the
> > engine attribute.
> > ---
> >  src/intel/common/gen_decoder.c | 23 +++
> >  src/intel/common/gen_decoder.h |  6 ++
> >  2 files changed, 29 insertions(+)
> >
> > diff --git a/src/intel/common/gen_decoder.c
> > b/src/intel/common/gen_decoder.c
> > index 8148b2f1489..79404660f56 100644
> > --- a/src/intel/common/gen_decoder.c
> > +++ b/src/intel/common/gen_decoder.c
> > @@ -165,6 +165,9 @@ create_group(struct parser_context *ctx,
> > group->fixed_length = fixed_length;
> > group->dword_length_field = NULL;
> > group->dw_length = 0;
> > +   group->engine_mask =
> > I915_ENGINE_CLASS_TO_MASK(I915_ENGINE_CLASS_RENDER) |
> > +
> > I915_ENGINE_CLASS_TO_MASK(I915_ENGINE_CLASS_VIDEO) |
> > +I915_ENGINE_CLASS_TO_MASK(I915_ENGINE_CLASS_COPY);
> > group->bias = 1;
> >
> > for (int i = 0; atts[i]; i += 2) {
> > @@ -173,6 +176,26 @@ create_group(struct parser_context *ctx,
> >   group->dw_length = strtoul(atts[i + 1], &p, 0);
> >} else if (strcmp(atts[i], "bias") == 0) {
> >   group->bias = strtoul(atts[i + 1], &p, 0);
> > +  } else if (strcmp(atts[i], "engine") == 0) {
> > + void *mem_ctx = ralloc_context(NULL);
> > + char *tmp = ralloc_strdup(mem_ctx, atts[i + 1]);
> > + char *save_ptr;
> > + char *tok = strtok_r(tmp, "|", &save_ptr);
> > +
> > + group->engine_mask = 0;
> > + while (tok != NULL) {
> > +if (strcmp(tok, "render") == 0) {
> > +   group->engine_mask |=
> > I915_ENGINE_CLASS_TO_MASK(I915_ENGINE_CLASS_RENDER);
> > +} else if (strcmp(tok, "video") == 0) {
> > +   group->engine_mask |=
> > I915_ENGINE_CLASS_TO_MASK(I915_ENGINE_CLASS_VIDEO);
> > +} else if (strcmp(tok, "blitter") == 0) {
> > +   group->engine_mask |=
> > I915_ENGINE_CLASS_TO_MASK(I915_ENGINE_CLASS_COPY);
> > +} else {
> > +   fprintf(stderr, "unknown engine class defined for
> > instruction \"%s\": %s\n", name, atts[i + 1]);
> > +}
> > +
> > +tok = strtok_r(NULL, "|", &save_ptr);
> > + }
> >
> 
> Seems like 'ralloc_free(mem_ctx)' is missing here :-)

Yes it is :) Thanks for pointing that out.

> Regards,
> - Andrii
> 
> 
> >}
> > }
> >
> > diff --git a/src/intel/common/gen_decoder.h
> > b/src/intel/common/gen_decoder.h
> > index 4beed22d729..4311f58b4eb 100644
> > --- a/src/intel/common/gen_decoder.h
> > +++ b/src/intel/common/gen_decoder.h
> > @@ -30,6 +30,9 @@
> >
> >  #include "dev/gen_device_info.h"
> >  #include "util/hash_table.h"
> > +#include "util/bitset.h"
> > +
> > +#include "drm-uapi/i915_drm.h"
> >
> >  #ifdef __cplusplus
> >  extern "C" {
> > @@ -40,6 +43,8 @@ struct gen_group;
> >  struct gen_field;
> >  union gen_field_value;
> >
> > +#define I915_ENGINE_CLASS_TO_MASK(x) BITSET_BIT(x)
> > +
> >  static inline uint32_t gen_make_gen(uint32_t major, uint32_t minor)
> >  {
> > return (major << 8) | minor;
> > @@ -102,6 +107,7 @@ struct gen_group {
> > struct gen_field *dword_length_field; /*  specific */
> >
> > uint32_t dw_length;
> > +   uint32_t engine_mask; /*  specific */
> > uint32_t bias; /*  specific */
> > uint32_t group_offset, group_count;
> > uint32_t group_size;
> > --
> > 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


Re: [Mesa-dev] [PATCH 01/12] travis: bump required LLVM version to 5.0

2018-11-08 Thread Juan A. Suarez Romero
On Wed, 2018-10-31 at 13:29 +, Emil Velikov wrote:
> From: Emil Velikov 
> 
> We'll bump the number in the build systems shortly. Update the travis
> file, first, to avoid intermittent failures.
> 
> This effectively removes LLVM 3.9 and 4.0 from the build matrix.
> 
> Cc: Juan A. Suarez Romero 
> Cc: Dylan Baker 
> Signed-off-by: Emil Velikov 


Reviewed-by: Juan A. Suarez 

> ---
> Gents any idea how to resolve the llvm-config workaround we have for
> meson? I could not find anything about an override in the meson docs.
> ---
>  .travis.yml | 108 +++-
>  1 file changed, 22 insertions(+), 86 deletions(-)
> 
> diff --git a/.travis.yml b/.travis.yml
> index dde43b2a171..8370e1e95f9 100644
> --- a/.travis.yml
> +++ b/.travis.yml
> @@ -159,99 +159,26 @@ matrix:
>  - BUILD=make
>  - MAKEFLAGS="-j4"
>  - MAKE_CHECK_COMMAND="true"
> -- LLVM_VERSION=3.9
> -- LLVM_CONFIG="llvm-config-${LLVM_VERSION}"
> -# New binutils linker is required for llvm-3.9
> -- OVERRIDE_PATH=/usr/lib/binutils-2.26/bin
> -- DRI_LOADERS="--disable-glx --disable-gbm --disable-egl"
> -- DRI_DRIVERS=""
> -- GALLIUM_ST="--enable-dri --disable-opencl --disable-xa 
> --disable-nine --disable-xvmc --disable-vdpau --disable-va 
> --disable-omx-bellagio --disable-gallium-osmesa"
> -- 
> GALLIUM_DRIVERS="i915,nouveau,pl111,r300,r600,freedreno,svga,swrast,v3d,vc4,virgl,etnaviv,imx"
> -- VULKAN_DRIVERS=""
> -- LIBUNWIND_FLAGS="--enable-libunwind"
> -  addons:
> -apt:
> -  sources:
> -- llvm-toolchain-trusty-3.9
> -  packages:
> -- binutils-2.26
> -# LLVM packaging is broken and misses these dependencies
> -- libedit-dev
> -# From sources above
> -- llvm-3.9-dev
> -# Common
> -- xz-utils
> -- x11proto-xf86vidmode-dev
> -- libexpat1-dev
> -- libx11-xcb-dev
> -- libelf-dev
> -- libunwind8-dev
> -- env:
> -- LABEL="make Gallium ST Clover LLVM-3.9"
> -- BUILD=make
> -- MAKEFLAGS="-j4"
> -- MAKE_CHECK_COMMAND="true"
> -- LLVM_VERSION=3.9
> -- LLVM_CONFIG="llvm-config-${LLVM_VERSION}"
> -- OVERRIDE_CC=gcc-4.7
> -- OVERRIDE_CXX=g++-4.7
> -# New binutils linker is required for llvm-3.9
> -- OVERRIDE_PATH=/usr/lib/binutils-2.26/bin
> -- DRI_LOADERS="--disable-glx --disable-gbm --disable-egl"
> -- DRI_DRIVERS=""
> -- GALLIUM_ST="--disable-dri --enable-opencl --enable-opencl-icd 
> --enable-llvm --disable-xa --disable-nine --disable-xvmc --disable-vdpau 
> --disable-va --disable-omx-bellagio --disable-gallium-osmesa"
> -- GALLIUM_DRIVERS="r600"
> -- VULKAN_DRIVERS=""
> -- LIBUNWIND_FLAGS="--enable-libunwind"
> -  addons:
> -apt:
> -  sources:
> -- llvm-toolchain-trusty-3.9
> -  packages:
> -- binutils-2.26
> -- libclc-dev
> -# LLVM packaging is broken and misses these dependencies
> -- libedit-dev
> -- g++-4.7
> -# From sources above
> -- llvm-3.9-dev
> -- clang-3.9
> -- libclang-3.9-dev
> -# Common
> -- xz-utils
> -- x11proto-xf86vidmode-dev
> -- libexpat1-dev
> -- libx11-xcb-dev
> -- libelf-dev
> -- libunwind8-dev
> -- env:
> -- LABEL="make Gallium ST Clover LLVM-4.0"
> -- BUILD=make
> -- MAKEFLAGS="-j4"
> -- MAKE_CHECK_COMMAND="true"
> -- LLVM_VERSION=4.0
> +- LLVM_VERSION=5.0
>  - LLVM_CONFIG="llvm-config-${LLVM_VERSION}"
>  - OVERRIDE_CC=gcc-4.8
>  - OVERRIDE_CXX=g++-4.8
>  - DRI_LOADERS="--disable-glx --disable-gbm --disable-egl"
>  - DRI_DRIVERS=""
> -- GALLIUM_ST="--disable-dri --enable-opencl --enable-opencl-icd 
> --enable-llvm --disable-xa --disable-nine --disable-xvmc --disable-vdpau 
> --disable-va --disable-omx-bellagio --disable-gallium-osmesa"
> -- GALLIUM_DRIVERS="r600"
> +- GALLIUM_ST="--enable-dri --disable-opencl --disable-xa 
> --disable-nine --disable-xvmc --disable-vdpau --disable-va 
> --disable-omx-bellagio --disable-gallium-osmesa"
> +- 
> GALLIUM_DRIVERS="i915,nouveau,pl111,r300,r600,freedreno,svga,swrast,v3d,vc4,virgl,etnaviv,imx"
>  - VULKAN_DRIVERS=""
>  - LIBUNWIND_FLAGS="--enable-libunwind"
>addons:
>  apt:
>sources:
> -- llvm-toolchain-trusty-4.0
> +- llvm-toolchain-trusty-5.0
>packages:
> -- libclc-dev
>  # LLVM packaging is broken and misses these dependencies
>  - libedit-dev
>  - g++-4.8
>

Re: [Mesa-dev] [PATCH 08/12] configure.ac: deprecate --with-llvm-prefix

2018-11-08 Thread Emil Velikov
On Wed, 7 Nov 2018 at 21:23, Jan Vesely  wrote:

> yes. as long as the setting survives reconfigure+rebuild I'm fine.
The provided option works in the usecase you're interested. I'm not
sure why we're debating this bth.

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


Re: [Mesa-dev] [PATCH 00/13] query validation fixes

2018-11-08 Thread Tapani Pälli



On 11/8/18 1:02 PM, Tapani Pälli wrote:



On 11/8/18 11:53 AM, Erik Faye-Lund wrote:

On Thu, 2018-11-08 at 10:47 +0200, Tapani Pälli wrote:

On 11/8/18 10:44 AM, Erik Faye-Lund wrote:

On Thu, 2018-11-08 at 08:47 +0200, Tapani Pälli wrote:

FYI there's a whole lot of tests that start to fail when this
series
running on Intel CI. It includes dEQP but also Piglit tests, can
you
do
Intel CI run or do you want me to send you results?


If you mean mesa-ci.01.org, then I have no clue how to do this...
If
you could pass me the results, that'd be great! Or perhaps these
are
the results?
https://mesa-ci.01.org/tpalli/builds/623/group/63a9f0ea7bb98050796b649e85481845 



Yep, this is it!



OK, so at least one of those piglit failures (khr_debug-object-
label_gles2) are bugs in the tests, where the test assumes
glBeginQuery(GL_SAMPLES_PASSED, ...) is OK on GLES 2.

The fix for the test is pretty simple, but yeah, it's not going to pass
until this has landed in piglit (I'll send a patch to the list soon):

---8<---
diff --git a/tests/spec/khr_debug/debug-object-label.c
b/tests/spec/khr_debug/debug-object-label.c
index e9617d719..d57315b49 100644
--- a/tests/spec/khr_debug/debug-object-label.c
+++ b/tests/spec/khr_debug/debug-object-label.c
@@ -236,8 +236,13 @@ test_object_label_types()
  piglit_get_gl_version() >= 30) {
  /* Test QUERY */
  glGenQueries(1, &query);
-    glBeginQuery(GL_SAMPLES_PASSED, query);
-    glEndQuery(GL_SAMPLES_PASSED);
+    if
(piglit_is_extension_supported("GL_ARB_occlusion_query")) {
+    glBeginQuery(GL_SAMPLES_PASSED, query);
+    glEndQuery(GL_SAMPLES_PASSED);
+    } else {
+    glBeginQuery(GL_ANY_SAMPLES_PASSED, query);
+    glEndQuery(GL_ANY_SAMPLES_PASSED);
+    }
  ObjectLabel(GL_QUERY, query, -1, TestLabel);
  GetObjectLabel(GL_QUERY, query, TestLabelLen + 1,
&length[QUERY_IDX], label[QUERY_IDX]);
---8<---


I also wouldn't mind being able to trigger test-runs manually if
some
credentials or whatnot could be set up ;)



I'm not sure how this process goes but if you want me to do re-run
that's fine.


Would you mind re-run with this branch?
https://gitlab.freedesktop.org/kusma/mesa/tree/queryobj-fixes

It's what I sent + 4 fixues.



Sure, just started a new build. Will let you know, when it finishes.


Should be this one:

https://mesa-ci.01.org/tpalli/builds/625/group/63a9f0ea7bb98050796b649e85481845



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


Re: [Mesa-dev] [Mesa-stable] [PATCH] radv: disable conditional rendering for vkCmdCopyQueryPoolResults()

2018-11-08 Thread Samuel Pitoiset



On 11/8/18 11:46 AM, Juan A. Suarez Romero wrote:

On Mon, 2018-11-05 at 09:54 +0100, Samuel Pitoiset wrote:

VK_EXT_conditional_rendering says that copy commands should not be
affected by conditional rendering.

Cc: 18.2 18.3 
Signed-off-by: Samuel Pitoiset 



This patch didn't apply cleanly on 18.2, so I've resolved the trivial conflicts.

Fixed patch is in
https://gitlab.freedesktop.org/mesa/mesa/commit/cbd9b4a95d8f502ed22e2377f0b6196dfe9a450d


Looks good to me. Thanks Juan!




J.A.


---
  src/amd/vulkan/radv_query.c | 10 ++
  1 file changed, 10 insertions(+)

diff --git a/src/amd/vulkan/radv_query.c b/src/amd/vulkan/radv_query.c
index 494dc24016..067c8e062a 100644
--- a/src/amd/vulkan/radv_query.c
+++ b/src/amd/vulkan/radv_query.c
@@ -913,6 +913,7 @@ static void radv_query_shader(struct radv_cmd_buffer 
*cmd_buffer,
  {
struct radv_device *device = cmd_buffer->device;
struct radv_meta_saved_state saved_state;
+   bool old_predicating;
  
  	if (!*pipeline) {

VkResult ret = 
radv_device_init_meta_query_state_internal(device);
@@ -927,6 +928,12 @@ static void radv_query_shader(struct radv_cmd_buffer 
*cmd_buffer,
   RADV_META_SAVE_CONSTANTS |
   RADV_META_SAVE_DESCRIPTORS);
  
+	/* VK_EXT_conditional_rendering says that copy commands should not be

+* affected by conditional rendering.
+*/
+   old_predicating = cmd_buffer->state.predicating;
+   cmd_buffer->state.predicating = false;
+
struct radv_buffer dst_buffer = {
.bo = dst_bo,
.offset = dst_offset,
@@ -1005,6 +1012,9 @@ static void radv_query_shader(struct radv_cmd_buffer 
*cmd_buffer,
  
  	radv_unaligned_dispatch(cmd_buffer, count, 1, 1);
  
+	/* Restore conditional rendering. */

+   cmd_buffer->state.predicating = old_predicating;
+
radv_meta_restore(&saved_state, cmd_buffer);
  }
  



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


[Mesa-dev] [PATCH v4] intel/decoder: Engine parameter for instructions

2018-11-08 Thread Toni Lönnberg
Preliminary work for adding handling of different pipes to gen_decoder. Each
instruction needs to have a definition describing which engine it is meant for.
If left undefined, by default, the instruction is defined for all engines.

v2: Changed to use the engine class definitions from UAPI

v3: Changed I915_ENGINE_CLASS_TO_MASK to use BITSET_BIT, change engine to
engine_mask, added check for incorrect engine and added the possibility to
define an instruction to multiple engines using the "|" as a delimiter in the
engine attribute.

v4: Fixed the memory leak.
---
 src/intel/common/gen_decoder.c | 26 ++
 src/intel/common/gen_decoder.h |  6 ++
 2 files changed, 32 insertions(+)

diff --git a/src/intel/common/gen_decoder.c b/src/intel/common/gen_decoder.c
index 8148b2f1489..a7c8a6c4f7e 100644
--- a/src/intel/common/gen_decoder.c
+++ b/src/intel/common/gen_decoder.c
@@ -165,6 +165,9 @@ create_group(struct parser_context *ctx,
group->fixed_length = fixed_length;
group->dword_length_field = NULL;
group->dw_length = 0;
+   group->engine_mask = I915_ENGINE_CLASS_TO_MASK(I915_ENGINE_CLASS_RENDER) |
+I915_ENGINE_CLASS_TO_MASK(I915_ENGINE_CLASS_VIDEO) |
+I915_ENGINE_CLASS_TO_MASK(I915_ENGINE_CLASS_COPY);
group->bias = 1;
 
for (int i = 0; atts[i]; i += 2) {
@@ -173,6 +176,29 @@ create_group(struct parser_context *ctx,
  group->dw_length = strtoul(atts[i + 1], &p, 0);
   } else if (strcmp(atts[i], "bias") == 0) {
  group->bias = strtoul(atts[i + 1], &p, 0);
+  } else if (strcmp(atts[i], "engine") == 0) {
+ void *mem_ctx = ralloc_context(NULL);
+ char *tmp = ralloc_strdup(mem_ctx, atts[i + 1]);
+ char *save_ptr;
+ char *tok = strtok_r(tmp, "|", &save_ptr);
+
+ group->engine_mask = 0;
+ while (tok != NULL) {
+if (strcmp(tok, "render") == 0) {
+   group->engine_mask |= 
I915_ENGINE_CLASS_TO_MASK(I915_ENGINE_CLASS_RENDER);
+} else if (strcmp(tok, "video") == 0) {
+   group->engine_mask |= 
I915_ENGINE_CLASS_TO_MASK(I915_ENGINE_CLASS_VIDEO);
+} else if (strcmp(tok, "blitter") == 0) {
+   group->engine_mask |= 
I915_ENGINE_CLASS_TO_MASK(I915_ENGINE_CLASS_COPY);
+} else {
+   fprintf(stderr, "unknown engine class defined for instruction 
\"%s\": %s\n", name, atts[i + 1]);
+}
+
+tok = strtok_r(NULL, "|", &save_ptr);
+ }
+
+ ralloc_free(tmp);
+ ralloc_free(mem_ctx);
   }
}
 
diff --git a/src/intel/common/gen_decoder.h b/src/intel/common/gen_decoder.h
index 4beed22d729..4311f58b4eb 100644
--- a/src/intel/common/gen_decoder.h
+++ b/src/intel/common/gen_decoder.h
@@ -30,6 +30,9 @@
 
 #include "dev/gen_device_info.h"
 #include "util/hash_table.h"
+#include "util/bitset.h"
+
+#include "drm-uapi/i915_drm.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -40,6 +43,8 @@ struct gen_group;
 struct gen_field;
 union gen_field_value;
 
+#define I915_ENGINE_CLASS_TO_MASK(x) BITSET_BIT(x)
+
 static inline uint32_t gen_make_gen(uint32_t major, uint32_t minor)
 {
return (major << 8) | minor;
@@ -102,6 +107,7 @@ struct gen_group {
struct gen_field *dword_length_field; /*  specific */
 
uint32_t dw_length;
+   uint32_t engine_mask; /*  specific */
uint32_t bias; /*  specific */
uint32_t group_offset, group_count;
uint32_t group_size;
-- 
2.17.1

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


Re: [Mesa-dev] [PATCH 3/3] docs: document the staging branch and add reference to it

2018-11-08 Thread Juan A. Suarez Romero
On Wed, 2018-11-07 at 16:02 +, Emil Velikov wrote:
> From: Emil Velikov 
> 
> A while back we agreed that having a live/staging branch is beneficial.
> Sadly we forgot to document that, so here is my first attempt.
> 
> Document the caveat that the branch history is not stable.
> 
> CC: Andres Gomez 
> CC: Dylan Baker 
> CC: Juan A. Suarez Romero 
> Signed-off-by: Emil Velikov 
> ---
>  docs/releasing.html | 20 
>  docs/submittingpatches.html |  3 +++
>  2 files changed, 23 insertions(+)
> 
> diff --git a/docs/releasing.html b/docs/releasing.html
> index 87590b19301..8ebc2953366 100644
> --- a/docs/releasing.html
> +++ b/docs/releasing.html
> @@ -21,6 +21,7 @@
>  Overview
>  Release schedule
>  Cherry-pick and test
> +Staging branch
>  Making a branchpoint
>  Pre-release announcement
>  Making a new release
> @@ -212,6 +213,25 @@ system and making some every day's use until the release 
> may be a good
>  idea too.
>  
>  
> +Staging branch
> +
> +
> +A live branch, which contains the currently merge/rejected patches is 
> available
> +in the main repository under staging/X.Y. For example:
> +
> +
> + staging/18.1 - WIP branch for the 18.1 series
> + staging/18.2 - WIP branch for the 18.2 series
> +
> +
> +
> +Notes:
> +
> +
> +People are encouraged to test the branch and report regressions.

I'd say "people are encouraged to test the staging branch and report
regressions."

> +The branch history is not stable and it will be 
> rebased,

I'd say it "could be rebased", rather than "will be rebased".


With the above changes, the series is:

Reviewed-by: Juan A. Suarez 

J.A.

> +
> +
>  
>  Making a branchpoint
>  
> diff --git a/docs/submittingpatches.html b/docs/submittingpatches.html
> index b84f01c3b37..3f97c941aa5 100644
> --- a/docs/submittingpatches.html
> +++ b/docs/submittingpatches.html
> @@ -253,6 +253,9 @@ If you are not the author of the original patch, please 
> Cc: them in your
>  nomination request.
>  
>  
> +
> +The current patch status can be observed in the  href="releasing.html#stagingbranch">staging branch.
> +
>  
>  The stable tag
>  

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


Re: [Mesa-dev] [PATCH 00/13] query validation fixes

2018-11-08 Thread Erik Faye-Lund
On Thu, 2018-11-08 at 13:43 +0200, Tapani Pälli wrote:
> 
> On 11/8/18 1:02 PM, Tapani Pälli wrote:
> > 
> > On 11/8/18 11:53 AM, Erik Faye-Lund wrote:
> > > On Thu, 2018-11-08 at 10:47 +0200, Tapani Pälli wrote:
> > > > On 11/8/18 10:44 AM, Erik Faye-Lund wrote:
> > > > > On Thu, 2018-11-08 at 08:47 +0200, Tapani Pälli wrote:
> > > > > > FYI there's a whole lot of tests that start to fail when
> > > > > > this
> > > > > > series
> > > > > > running on Intel CI. It includes dEQP but also Piglit
> > > > > > tests, can
> > > > > > you
> > > > > > do
> > > > > > Intel CI run or do you want me to send you results?
> > > > > 
> > > > > If you mean mesa-ci.01.org, then I have no clue how to do
> > > > > this...
> > > > > If
> > > > > you could pass me the results, that'd be great! Or perhaps
> > > > > these
> > > > > are
> > > > > the results?
> > > > > https://mesa-ci.01.org/tpalli/builds/623/group/63a9f0ea7bb98050796b649e85481845
> > > > >  
> > > > > 
> > > > 
> > > > Yep, this is it!
> > > > 
> > > 
> > > OK, so at least one of those piglit failures (khr_debug-object-
> > > label_gles2) are bugs in the tests, where the test assumes
> > > glBeginQuery(GL_SAMPLES_PASSED, ...) is OK on GLES 2.
> > > 
> > > The fix for the test is pretty simple, but yeah, it's not going
> > > to pass
> > > until this has landed in piglit (I'll send a patch to the list
> > > soon):
> > > 
> > > ---8<---
> > > diff --git a/tests/spec/khr_debug/debug-object-label.c
> > > b/tests/spec/khr_debug/debug-object-label.c
> > > index e9617d719..d57315b49 100644
> > > --- a/tests/spec/khr_debug/debug-object-label.c
> > > +++ b/tests/spec/khr_debug/debug-object-label.c
> > > @@ -236,8 +236,13 @@ test_object_label_types()
> > >   piglit_get_gl_version() >= 30) {
> > >   /* Test QUERY */
> > >   glGenQueries(1, &query);
> > > -glBeginQuery(GL_SAMPLES_PASSED, query);
> > > -glEndQuery(GL_SAMPLES_PASSED);
> > > +if
> > > (piglit_is_extension_supported("GL_ARB_occlusion_query")) {
> > > +glBeginQuery(GL_SAMPLES_PASSED, query);
> > > +glEndQuery(GL_SAMPLES_PASSED);
> > > +} else {
> > > +glBeginQuery(GL_ANY_SAMPLES_PASSED, query);
> > > +glEndQuery(GL_ANY_SAMPLES_PASSED);
> > > +}
> > >   ObjectLabel(GL_QUERY, query, -1, TestLabel);
> > >   GetObjectLabel(GL_QUERY, query, TestLabelLen + 1,
> > > &length[QUERY_IDX], label[QUERY_IDX]);
> > > ---8<---
> > > 
> > > > > I also wouldn't mind being able to trigger test-runs manually
> > > > > if
> > > > > some
> > > > > credentials or whatnot could be set up ;)
> > > > > 
> > > > 
> > > > I'm not sure how this process goes but if you want me to do re-
> > > > run
> > > > that's fine.
> > > 
> > > Would you mind re-run with this branch?
> > > https://gitlab.freedesktop.org/kusma/mesa/tree/queryobj-fixes
> > > 
> > > It's what I sent + 4 fixues.
> > > 
> > 
> > Sure, just started a new build. Will let you know, when it
> > finishes.
> 
> Should be this one:
> 
> https://mesa-ci.01.org/tpalli/builds/625/group/63a9f0ea7bb98050796b649e85481845
> 
> 

Thanks. All failures that are left are due to the same test-issue,
which I've sent a piglit patch for here:

https://patchwork.freedesktop.org/series/52216/

OK, I think I'll squash in the fixes an re-send the series, then :)

Thanks a lot for the help!


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


Re: [Mesa-dev] [PATCH 2/4] bin/get-pick-list.sh: prefix output with "[stable] "

2018-11-08 Thread Juan A. Suarez Romero
On Wed, 2018-11-07 at 12:07 +, Emil Velikov wrote:
> From: Emil Velikov 
> 
> With later commits we'll fold all the different scripts into one.
> Add the explicit prefix, so that we know the origin of the nomination
> 
> Signed-off-by: Emil Velikov 
> ---
>  bin/get-pick-list.sh | 21 -
>  1 file changed, 20 insertions(+), 1 deletion(-)
> 
> diff --git a/bin/get-pick-list.sh b/bin/get-pick-list.sh
> index ba741cc4114..33a8a4cba48 100755
> --- a/bin/get-pick-list.sh
> +++ b/bin/get-pick-list.sh
> @@ -7,6 +7,15 @@
>  # $ bin/get-pick-list.sh
>  # $ bin/get-pick-list.sh > picklist
>  # $ bin/get-pick-list.sh | tee picklist
> +#
> +# The output is as follows:
> +# [nominaiton_type] commit_sha commit summary
> +
> +is_stable_nomination()
> +{
> + stable=`git show --summary $sha | grep -i -o "CC:.*mesa-stable"`
> + return $?
> +}
>  
>  # Use the last branchpoint as our limit for the search
>  latest_branchpoint=`git merge-base origin/master HEAD`
> @@ -32,7 +41,17 @@ do
>   continue
>   fi
>  
> - git --no-pager show --summary --oneline $sha
> + tag=none
> + if is_stable_nomination; then
> + tag=stable
> + fi
> +
> + if test tag = none; then
> + continue
> + fi

This last condition is not working correctly on my system. Anyway, I'd merge it
with the first one:

if is_stable_nomination; then
tag=stable
else
continue
fi



> +
> + printf "[ %8s ] %s\n" \
> + "$tag" "`git --no-pager show --summary --oneline $sha`"
>  done
>  
>  rm -f already_picked

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


Re: [Mesa-dev] [PATCH] intel/l3: update ICL L3 configurations

2018-11-08 Thread Lionel Landwerlin

I forgot to Cc some people :)

On 07/11/2018 13:31, Lionel Landwerlin wrote:

CNL configurations where given in increments of 2Kb, while ICL are
given in increments of 4Kb. We seem to have missed some updates in the
internal documentation.

Signed-off-by: Lionel Landwerlin 
BSpec: 21166
---
  src/intel/common/gen_l3_config.c | 16 ++--
  1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/src/intel/common/gen_l3_config.c b/src/intel/common/gen_l3_config.c
index b977c6ab136..079608198bc 100644
--- a/src/intel/common/gen_l3_config.c
+++ b/src/intel/common/gen_l3_config.c
@@ -137,12 +137,16 @@ static const struct gen_l3_config cnl_l3_configs[] = {
   */
  static const struct gen_l3_config icl_l3_configs[] = {
 /* SLM URB ALL DC  RO  IS   C   T */
-   {{  0, 64, 64,  0,  0,  0,  0,  0 }},
-   {{  0, 64,  0, 16, 48,  0,  0,  0 }},
-   {{  0, 48,  0, 16, 64,  0,  0,  0 }},
-   {{  0, 32,  0,  0, 96,  0,  0,  0 }},
-   {{  0, 32, 96,  0,  0,  0,  0,  0 }},
-   {{  0, 32,  0, 16, 80,  0,  0,  0 }},
+   {{  0, 32, 32,  0,  0,  0,  0,  0 }},
+   {{  0, 32, 28,  0,  0,  0,  0,  0 }},
+   {{  0, 24,  0,  8, 28,  0,  0,  0 }},
+   {{  0, 16,  0,  0, 44,  0,  0,  0 }},
+   {{  0, 16, 12,  0,  0,  0,  0,  0 }},
+   {{  0, 16,  0,  0, 12,  0,  0,  0 }},
+   {{  0, 16, 80,  0,  0,  0,  0,  0 }},
+   {{  0, 16, 48,  0,  0,  0,  0,  0 }},
+   {{  0, 16, 44,  0,  0,  0,  0,  0 }},
+   {{  0, 32, 64,  0,  0,  0,  0,  0 }},
 {{  0 }}
  };
  



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


[Mesa-dev] [PATCH v4] intel/decoder: tools: gen_engine to drm_i915_gem_engine_class

2018-11-08 Thread Toni Lönnberg
Removed the gen_engine enum and changed the involved functions to use the
drm_i915_gem_engine_class enum from UAPI instead.

v3: Wrong engine was being used for blocks in video ring

v4: Fixed aubinator_viewer.cpp
---
 src/intel/tools/aub_read.c   | 22 +++---
 src/intel/tools/aub_read.h   | 11 +++
 src/intel/tools/aubinator.c  |  5 ++---
 src/intel/tools/aubinator_viewer.cpp |  6 +++---
 4 files changed, 19 insertions(+), 25 deletions(-)

diff --git a/src/intel/tools/aub_read.c b/src/intel/tools/aub_read.c
index d83e88ddced..1b6787d4a97 100644
--- a/src/intel/tools/aub_read.c
+++ b/src/intel/tools/aub_read.c
@@ -136,7 +136,7 @@ handle_trace_block(struct aub_read *read, const uint32_t *p)
int type = p[1] & AUB_TRACE_TYPE_MASK;
int address_space = p[1] & AUB_TRACE_ADDRESS_SPACE_MASK;
int header_length = p[0] & 0x;
-   int engine = GEN_ENGINE_RENDER;
+   enum drm_i915_gem_engine_class engine = I915_ENGINE_CLASS_RENDER;
const void *data = p + header_length + 2;
uint64_t address = gen_48b_address((read->devinfo.gen >= 8 ? ((uint64_t) 
p[5] << 32) : 0) |
   ((uint64_t) p[3]));
@@ -151,13 +151,13 @@ handle_trace_block(struct aub_read *read, const uint32_t 
*p)
case AUB_TRACE_OP_COMMAND_WRITE:
   switch (type) {
   case AUB_TRACE_TYPE_RING_PRB0:
- engine = GEN_ENGINE_RENDER;
+ engine = I915_ENGINE_CLASS_RENDER;
  break;
   case AUB_TRACE_TYPE_RING_PRB1:
- engine = GEN_ENGINE_VIDEO;
+ engine = I915_ENGINE_CLASS_VIDEO;
  break;
   case AUB_TRACE_TYPE_RING_PRB2:
- engine = GEN_ENGINE_BLITTER;
+ engine = I915_ENGINE_CLASS_COPY;
  break;
   default:
  parse_error(read, p, "command write to unknown ring %d\n", type);
@@ -182,7 +182,7 @@ handle_memtrace_reg_write(struct aub_read *read, const 
uint32_t *p)
if (read->reg_write)
   read->reg_write(read->user_data, offset, value);
 
-   int engine;
+   enum drm_i915_gem_engine_class engine;
uint64_t context_descriptor;
 
switch (offset) {
@@ -192,7 +192,7 @@ handle_memtrace_reg_write(struct aub_read *read, const 
uint32_t *p)
  return;
 
   read->render_elsp_index = 0;
-  engine = GEN_ENGINE_RENDER;
+  engine = I915_ENGINE_CLASS_RENDER;
   context_descriptor = (uint64_t)read->render_elsp[2] << 32 |
  read->render_elsp[3];
   break;
@@ -202,7 +202,7 @@ handle_memtrace_reg_write(struct aub_read *read, const 
uint32_t *p)
  return;
 
   read->video_elsp_index = 0;
-  engine = GEN_ENGINE_VIDEO;
+  engine = I915_ENGINE_CLASS_VIDEO;
   context_descriptor = (uint64_t)read->video_elsp[2] << 32 |
  read->video_elsp[3];
   break;
@@ -212,7 +212,7 @@ handle_memtrace_reg_write(struct aub_read *read, const 
uint32_t *p)
  return;
 
   read->blitter_elsp_index = 0;
-  engine = GEN_ENGINE_BLITTER;
+  engine = I915_ENGINE_CLASS_COPY;
   context_descriptor = (uint64_t)read->blitter_elsp[2] << 32 |
  read->blitter_elsp[3];
   break;
@@ -241,17 +241,17 @@ handle_memtrace_reg_write(struct aub_read *read, const 
uint32_t *p)
   return;
   break;
case 0x2550: /* render elsc */
-  engine = GEN_ENGINE_RENDER;
+  engine = I915_ENGINE_CLASS_RENDER;
   context_descriptor = (uint64_t)read->render_elsp[2] << 32 |
  read->render_elsp[3];
   break;
case 0x12550: /* video_elsc */
-  engine = GEN_ENGINE_VIDEO;
+  engine = I915_ENGINE_CLASS_VIDEO;
   context_descriptor = (uint64_t)read->video_elsp[2] << 32 |
  read->video_elsp[3];
   break;
case 0x22550: /* blitter elsc */
-  engine = GEN_ENGINE_BLITTER;
+  engine = I915_ENGINE_CLASS_COPY;
   context_descriptor = (uint64_t)read->blitter_elsp[2] << 32 |
  read->blitter_elsp[3];
   break;
diff --git a/src/intel/tools/aub_read.h b/src/intel/tools/aub_read.h
index e48ac3164bc..1e788332dcb 100644
--- a/src/intel/tools/aub_read.h
+++ b/src/intel/tools/aub_read.h
@@ -28,17 +28,12 @@
 #include 
 
 #include "dev/gen_device_info.h"
+#include "drm-uapi/i915_drm.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-enum gen_engine {
-   GEN_ENGINE_RENDER = 1,
-   GEN_ENGINE_VIDEO = 2,
-   GEN_ENGINE_BLITTER = 3,
-};
-
 struct aub_read {
/* Caller's data */
void *user_data;
@@ -55,9 +50,9 @@ struct aub_read {
 
void (*reg_write)(void *user_data, uint32_t reg_offset, uint32_t reg_value);
 
-   void (*ring_write)(void *user_data, enum gen_engine engine,
+   void (*ring_write)(void *user_data, enum drm_i915_gem_engine_class engine,
   const void *data, uint32_t data_len);
-   void (*execlist_write)(void *user_data, enum gen_engine engine,
+   void (*execlist_write)(void *user_data, enum drm_i915_gem_engine_class 
engine,
   uint64_t context_descriptor);
 
/* Reader's data */
diff --git a/src/intel/t

[Mesa-dev] [PATCH v2 02/13] mesa/main: correct year for EXT_occlusion_query_boolean

2018-11-08 Thread Erik Faye-Lund
According to the extension spec, this was initially released in 2011,
so let's set this to the correct value.

The value of 2001 could be a copy-paste mistake, as ARB_occlusion_query
which this is based on was released then.

Signed-off-by: Erik Faye-Lund 
---
 src/mesa/main/extensions_table.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/main/extensions_table.h b/src/mesa/main/extensions_table.h
index 5d55995856c..dd846d7bc5c 100644
--- a/src/mesa/main/extensions_table.h
+++ b/src/mesa/main/extensions_table.h
@@ -241,7 +241,7 @@ EXT(EXT_map_buffer_range, 
ARB_map_buffer_range
 EXT(EXT_memory_object   , EXT_memory_object
  , GLL, GLC,  x , ES2, 2017)
 EXT(EXT_memory_object_fd, EXT_memory_object_fd 
  , GLL, GLC,  x , ES2, 2017)
 EXT(EXT_multi_draw_arrays   , dummy_true   
  , GLL,  x , ES1, ES2, 1999)
-EXT(EXT_occlusion_query_boolean , ARB_occlusion_query2 
  ,  x ,  x ,  x , ES2, 2001)
+EXT(EXT_occlusion_query_boolean , ARB_occlusion_query2 
  ,  x ,  x ,  x , ES2, 2011)
 EXT(EXT_packed_depth_stencil, dummy_true   
  , GLL, GLC,  x ,  x , 2005)
 EXT(EXT_packed_float, EXT_packed_float 
  , GLL, GLC,  x ,  x , 2004)
 EXT(EXT_packed_pixels   , dummy_true   
  , GLL,  x ,  x ,  x , 1997)
-- 
2.19.1

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


[Mesa-dev] [PATCH v2 12/13] mesa/main: fix validation of GL_TIMESTAMP

2018-11-08 Thread Erik Faye-Lund
ctx->Extensions.ARB_timer_query is set based on the driver-
capabilities, not based on the context type. We need to check
against _mesa_has_ARB_timer_query(ctx) instead to figure out
if the extension is really supported. We also need to check for
EXT_disjoint_timer_query for GLES-support.

This shouln't have any functional effect, as this entry-point is only
valid on desktop GL, or on GLES with EXT_disjoint_timer_query in the
first place. But if this gets added to the core of a future version
of ES, this should be a step in the right direction.

Signed-off-by: Erik Faye-Lund 
---
 src/mesa/main/queryobj.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/mesa/main/queryobj.c b/src/mesa/main/queryobj.c
index c86b9ec065b..27086a4b683 100644
--- a/src/mesa/main/queryobj.c
+++ b/src/mesa/main/queryobj.c
@@ -679,7 +679,8 @@ _mesa_GetQueryIndexediv(GLenum target, GLuint index, GLenum 
pname,
}
 
if (target == GL_TIMESTAMP) {
-  if (!ctx->Extensions.ARB_timer_query) {
+  if (!_mesa_has_ARB_timer_query(ctx) &&
+  !_mesa_has_EXT_disjoint_timer_query(ctx)) {
  _mesa_error(ctx, GL_INVALID_ENUM, "glGetQueryARB(target)");
  return;
   }
-- 
2.19.1

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


[Mesa-dev] [PATCH v2 01/13] mesa/main: correct requirement for EXT_occlusion_query_boolean

2018-11-08 Thread Erik Faye-Lund
EXT_occlusion_query_boolean require support for GL_ANY_SAMPLES_PASSED,
which ARB_occlusion_query doesn't supply. We need ARB_occlusion_query2
for this instead.

This is still not 100% accurate, as we also require support for the
GL_SAMPLES_PASSED_CONSERVATIVE target, which isn't guaranteed by either
ARB_occlusion_query nor ARB_occlusion_query2. But it should be trivial
to implement for any driver supporting ARB_occlusion_query2, as it can
simply be implemented as GL_ANY_SAMPLES_PASSED.

Signed-off-by: Erik Faye-Lund 
---
 src/mesa/main/extensions_table.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/main/extensions_table.h b/src/mesa/main/extensions_table.h
index a516a1b17f8..5d55995856c 100644
--- a/src/mesa/main/extensions_table.h
+++ b/src/mesa/main/extensions_table.h
@@ -241,7 +241,7 @@ EXT(EXT_map_buffer_range, 
ARB_map_buffer_range
 EXT(EXT_memory_object   , EXT_memory_object
  , GLL, GLC,  x , ES2, 2017)
 EXT(EXT_memory_object_fd, EXT_memory_object_fd 
  , GLL, GLC,  x , ES2, 2017)
 EXT(EXT_multi_draw_arrays   , dummy_true   
  , GLL,  x , ES1, ES2, 1999)
-EXT(EXT_occlusion_query_boolean , ARB_occlusion_query  
  ,  x ,  x ,  x , ES2, 2001)
+EXT(EXT_occlusion_query_boolean , ARB_occlusion_query2 
  ,  x ,  x ,  x , ES2, 2001)
 EXT(EXT_packed_depth_stencil, dummy_true   
  , GLL, GLC,  x ,  x , 2005)
 EXT(EXT_packed_float, EXT_packed_float 
  , GLL, GLC,  x ,  x , 2004)
 EXT(EXT_packed_pixels   , dummy_true   
  , GLL,  x ,  x ,  x , 1997)
-- 
2.19.1

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


[Mesa-dev] [PATCH v2 10/13] mesa/main: fix validation of transform-feedback overflow queries

2018-11-08 Thread Erik Faye-Lund
ctx->Extensions.ARB_transform_feedback_overflow_query is set based on
the driver-capabilities, not based on the context type. We need to
check against _mesa_has_RB_transform_feedback_overflow_query(ctx)
instead to figure out if the extension is really supported.

This turns usage of GL_TRANSFORM_FEEDBACK_STREAM_OVERFLOW and
GL_TRANSFORM_FEEDBACK_OVERFLOW into errors on ES 3, as required by the
spec.

Signed-off-by: Erik Faye-Lund 
---
 src/mesa/main/queryobj.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/mesa/main/queryobj.c b/src/mesa/main/queryobj.c
index bda94ccc701..45db43139a4 100644
--- a/src/mesa/main/queryobj.c
+++ b/src/mesa/main/queryobj.c
@@ -214,12 +214,12 @@ get_query_binding_point(struct gl_context *ctx, GLenum 
target, GLuint index)
   else
  return NULL;
case GL_TRANSFORM_FEEDBACK_STREAM_OVERFLOW:
-  if (ctx->Extensions.ARB_transform_feedback_overflow_query)
+  if (_mesa_has_ARB_transform_feedback_overflow_query(ctx))
  return &ctx->Query.TransformFeedbackOverflow[index];
   else
  return NULL;
case GL_TRANSFORM_FEEDBACK_OVERFLOW:
-  if (ctx->Extensions.ARB_transform_feedback_overflow_query)
+  if (_mesa_has_ARB_transform_feedback_overflow_query(ctx))
  return &ctx->Query.TransformFeedbackOverflowAny;
   else
  return NULL;
-- 
2.19.1

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


[Mesa-dev] [PATCH v2 00/13] query validation fixes

2018-11-08 Thread Erik Faye-Lund
Here's v2 of this series. Changes are as follows:

- 5/13: also check for ARB_occlusion_query2, for core-contexts
- 8/13: also check for EXT_disjoint_timer_query, for gles-contexts
- 9/13: also check for OES_geometry_shader, for gles-contexts
- 12/13: also check for EXT_disjoint_timer_query, for gles-contexts

In addition, there's regression in a piglit-test, but that test is wrong
and uses invalid queries on GLES. A patch for that test has been sent to
the piglit mailing list, here:

https://patchwork.freedesktop.org/series/52216/

Thanks to Tapani Pälli for testing this on the intel-ci system :)

Erik Faye-Lund (13):
  mesa/main: correct requirement for EXT_occlusion_query_boolean
  mesa/main: correct year for EXT_occlusion_query_boolean
  mesa/main: use non-prefixed enums for consistency
  mesa/main: simplify pipeline-statistics query validation
  mesa/main: fix validation of GL_SAMPLES_PASSED
  mesa/main: fix validation of GL_ANY_SAMPLES_PASSED
  mesa/main: fix validation of GL_ANY_SAMPLES_PASSED_CONSERVATIVE
  mesa/main: fix validation of GL_TIME_ELAPSED
  mesa/main: fix validation of transform-feedback queries
  mesa/main: fix validation of transform-feedback overflow queries
  mesa/main: fix validation of ARB_query_buffer_object
  mesa/main: fix validation of GL_TIMESTAMP
  mesa/main: remove overly strict query-validation

 src/mesa/main/extensions_table.h |   2 +-
 src/mesa/main/queryobj.c | 112 ++-
 2 files changed, 52 insertions(+), 62 deletions(-)

-- 
2.19.1

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


[Mesa-dev] [PATCH v2 05/13] mesa/main: fix validation of GL_SAMPLES_PASSED

2018-11-08 Thread Erik Faye-Lund
ctx->Extensions.ARB_occlusion_query is set based on the driver-
capabilities, not based on the context type. We need to check against
_mesa_has_ARB_occlusion_query(ctx) instead to figure out if the
extension is really supported. We also need to check for
ARB_occlusion_query2, as ARB_occlusion_query isn't available in core
contexts.

This turns usage of GL_SAMPLES_PASSED into an error on ES 3, as is
required by the spec.

Signed-off-by: Erik Faye-Lund 
---
 src/mesa/main/queryobj.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/mesa/main/queryobj.c b/src/mesa/main/queryobj.c
index 96b1c6bb30a..4c8e4df98bb 100644
--- a/src/mesa/main/queryobj.c
+++ b/src/mesa/main/queryobj.c
@@ -179,7 +179,8 @@ get_query_binding_point(struct gl_context *ctx, GLenum 
target, GLuint index)
 
switch (target) {
case GL_SAMPLES_PASSED:
-  if (ctx->Extensions.ARB_occlusion_query)
+  if (_mesa_has_ARB_occlusion_query(ctx) ||
+  _mesa_has_ARB_occlusion_query2(ctx))
  return &ctx->Query.CurrentOcclusionObject;
   else
  return NULL;
-- 
2.19.1

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


[Mesa-dev] [PATCH v2 11/13] mesa/main: fix validation of ARB_query_buffer_object

2018-11-08 Thread Erik Faye-Lund
ctx->Extensions.ARB_query_buffer_object is set based on the driver-
capabilities, not based on the context type. We need to check against
_mesa_has_ARB_query_buffer_object(ctx) instead to figure out if the
extension is really supported.

This turns attempts to read queries into buffer objects on ES 3 into
errors, as required by the spec.

Signed-off-by: Erik Faye-Lund 
---
 src/mesa/main/queryobj.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/mesa/main/queryobj.c b/src/mesa/main/queryobj.c
index 45db43139a4..c86b9ec065b 100644
--- a/src/mesa/main/queryobj.c
+++ b/src/mesa/main/queryobj.c
@@ -825,7 +825,7 @@ get_query_object(struct gl_context *ctx, const char *func,
if (buf && buf != ctx->Shared->NullBufferObj) {
   bool is_64bit = ptype == GL_INT64_ARB ||
  ptype == GL_UNSIGNED_INT64_ARB;
-  if (!ctx->Extensions.ARB_query_buffer_object) {
+  if (!_mesa_has_ARB_query_buffer_object(ctx)) {
  _mesa_error(ctx, GL_INVALID_OPERATION, "%s(not supported)", func);
  return;
   }
@@ -858,7 +858,7 @@ get_query_object(struct gl_context *ctx, const char *func,
   value = q->Result;
   break;
case GL_QUERY_RESULT_NO_WAIT:
-  if (!ctx->Extensions.ARB_query_buffer_object)
+  if (!_mesa_has_ARB_query_buffer_object(ctx))
  goto invalid_enum;
   ctx->Driver.CheckQuery(ctx, q);
   if (!q->Ready)
-- 
2.19.1

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


[Mesa-dev] [PATCH v2 09/13] mesa/main: fix validation of transform-feedback queries

2018-11-08 Thread Erik Faye-Lund
ctx->Extensions.EXT_transform_feedback is set based on the driver-
capabilities, not based on the context type. We need to check against
_mesa_has_EXT_transform_feedback(ctx) instead to figure out if the
extension is really supported. We also need to check for
OES_geometry_shader.

This turns usage of GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN into an
error on ES 2, as well as usage of GL_PRIMITIVES_GENERATED on ES 3, both
as required by the spec.

Signed-off-by: Erik Faye-Lund 
---
 src/mesa/main/queryobj.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/mesa/main/queryobj.c b/src/mesa/main/queryobj.c
index 9b3671f90a0..bda94ccc701 100644
--- a/src/mesa/main/queryobj.c
+++ b/src/mesa/main/queryobj.c
@@ -203,12 +203,13 @@ get_query_binding_point(struct gl_context *ctx, GLenum 
target, GLuint index)
   else
  return NULL;
case GL_PRIMITIVES_GENERATED:
-  if (ctx->Extensions.EXT_transform_feedback)
+  if (_mesa_has_EXT_transform_feedback(ctx) ||
+  _mesa_has_OES_geometry_shader(ctx))
  return &ctx->Query.PrimitivesGenerated[index];
   else
  return NULL;
case GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:
-  if (ctx->Extensions.EXT_transform_feedback)
+  if (_mesa_has_EXT_transform_feedback(ctx) || _mesa_is_gles3(ctx))
  return &ctx->Query.PrimitivesWritten[index];
   else
  return NULL;
-- 
2.19.1

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


[Mesa-dev] [PATCH v2 13/13] mesa/main: remove overly strict query-validation

2018-11-08 Thread Erik Faye-Lund
The rules encoded in this code also applies to OpenGL ES 3.0 and up,
but the per-enum validation has already been taught about these rules.
So let's get rid of this duplicate, narrow version of the validation.

Signed-off-by: Erik Faye-Lund 
---
 src/mesa/main/queryobj.c | 14 --
 1 file changed, 14 deletions(-)

diff --git a/src/mesa/main/queryobj.c b/src/mesa/main/queryobj.c
index 27086a4b683..af558f0e227 100644
--- a/src/mesa/main/queryobj.c
+++ b/src/mesa/main/queryobj.c
@@ -163,20 +163,6 @@ get_pipe_stats_binding_point(struct gl_context *ctx,
 static struct gl_query_object **
 get_query_binding_point(struct gl_context *ctx, GLenum target, GLuint index)
 {
-
-   /* From GL_EXT_occlusion_query_boolean spec:
-*
-*"Accepted by the  parameter of BeginQueryEXT, EndQueryEXT,
-*and GetQueryivEXT:
-*
-*   ANY_SAMPLES_PASSED_EXT 0x8C2F
-*   ANY_SAMPLES_PASSED_CONSERVATIVE_EXT0x8D6A"
-*/
-   if ((_mesa_is_gles(ctx) && ctx->Version == 20) &&
-   (target != GL_ANY_SAMPLES_PASSED &&
-target != GL_ANY_SAMPLES_PASSED_CONSERVATIVE))
-  return NULL;
-
switch (target) {
case GL_SAMPLES_PASSED:
   if (_mesa_has_ARB_occlusion_query(ctx) ||
-- 
2.19.1

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


[Mesa-dev] [PATCH v2 04/13] mesa/main: simplify pipeline-statistics query validation

2018-11-08 Thread Erik Faye-Lund
The _mesa_has_ARB_pipeline_statistics_query(ctx)-helper will already
check the GLES-version according to the extension-table, so if this
extension would ever be back-ported to ES, we only need to update the
table to support this.

This shouln't have any functional effect.

Signed-off-by: Erik Faye-Lund 
---
 src/mesa/main/queryobj.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/mesa/main/queryobj.c b/src/mesa/main/queryobj.c
index 2a143191c62..96b1c6bb30a 100644
--- a/src/mesa/main/queryobj.c
+++ b/src/mesa/main/queryobj.c
@@ -149,8 +149,7 @@ get_pipe_stats_binding_point(struct gl_context *ctx,
const int which = target - GL_VERTICES_SUBMITTED;
assert(which < MAX_PIPELINE_STATISTICS);
 
-   if (!_mesa_is_desktop_gl(ctx) ||
-   !ctx->Extensions.ARB_pipeline_statistics_query)
+   if (!_mesa_has_ARB_pipeline_statistics_query(ctx))
   return NULL;
 
return &ctx->Query.pipeline_stats[which];
-- 
2.19.1

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


[Mesa-dev] [PATCH v2 06/13] mesa/main: fix validation of GL_ANY_SAMPLES_PASSED

2018-11-08 Thread Erik Faye-Lund
ctx->Extensions.ARB_occlusion_query2 is set based on the driver-
capabilities, not based on the context type. We need to check against
_mesa_has_ARB_occlusion_query2(ctx) instead to figure out if the
extension is really supported.

In addition, EXT_occlusion_query_boolean should also allow this
behavior.

This shouldn't cause any functional change, as all drivers that support
ARB_occlusion_query2 should in practice enable either
ARB_occlusion_query2 or EXT_occlusion_query_boolean under all APIs that
export this symbol.

Signed-off-by: Erik Faye-Lund 
---
 src/mesa/main/queryobj.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/mesa/main/queryobj.c b/src/mesa/main/queryobj.c
index 4c8e4df98bb..25d76a48648 100644
--- a/src/mesa/main/queryobj.c
+++ b/src/mesa/main/queryobj.c
@@ -185,7 +185,8 @@ get_query_binding_point(struct gl_context *ctx, GLenum 
target, GLuint index)
   else
  return NULL;
case GL_ANY_SAMPLES_PASSED:
-  if (ctx->Extensions.ARB_occlusion_query2)
+  if (_mesa_has_ARB_occlusion_query2(ctx) ||
+  _mesa_has_EXT_occlusion_query_boolean(ctx))
  return &ctx->Query.CurrentOcclusionObject;
   else
  return NULL;
-- 
2.19.1

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


[Mesa-dev] [PATCH v2 03/13] mesa/main: use non-prefixed enums for consistency

2018-11-08 Thread Erik Faye-Lund
These enums all have the same values as their non-prefixed versions, and
there's several aliases for some of them. So let's switch to the
non-prefixed versions for simplicity.

Signed-off-by: Erik Faye-Lund 
---
 src/mesa/main/queryobj.c | 66 
 1 file changed, 33 insertions(+), 33 deletions(-)

diff --git a/src/mesa/main/queryobj.c b/src/mesa/main/queryobj.c
index e97a0138e96..2a143191c62 100644
--- a/src/mesa/main/queryobj.c
+++ b/src/mesa/main/queryobj.c
@@ -146,7 +146,7 @@ static struct gl_query_object **
 get_pipe_stats_binding_point(struct gl_context *ctx,
  GLenum target)
 {
-   const int which = target - GL_VERTICES_SUBMITTED_ARB;
+   const int which = target - GL_VERTICES_SUBMITTED;
assert(which < MAX_PIPELINE_STATISTICS);
 
if (!_mesa_is_desktop_gl(ctx) ||
@@ -179,7 +179,7 @@ get_query_binding_point(struct gl_context *ctx, GLenum 
target, GLuint index)
   return NULL;
 
switch (target) {
-   case GL_SAMPLES_PASSED_ARB:
+   case GL_SAMPLES_PASSED:
   if (ctx->Extensions.ARB_occlusion_query)
  return &ctx->Query.CurrentOcclusionObject;
   else
@@ -195,7 +195,7 @@ get_query_binding_point(struct gl_context *ctx, GLenum 
target, GLuint index)
  return &ctx->Query.CurrentOcclusionObject;
   else
  return NULL;
-   case GL_TIME_ELAPSED_EXT:
+   case GL_TIME_ELAPSED:
   if (ctx->Extensions.EXT_timer_query)
  return &ctx->Query.CurrentTimerObject;
   else
@@ -210,43 +210,43 @@ get_query_binding_point(struct gl_context *ctx, GLenum 
target, GLuint index)
  return &ctx->Query.PrimitivesWritten[index];
   else
  return NULL;
-   case GL_TRANSFORM_FEEDBACK_STREAM_OVERFLOW_ARB:
+   case GL_TRANSFORM_FEEDBACK_STREAM_OVERFLOW:
   if (ctx->Extensions.ARB_transform_feedback_overflow_query)
  return &ctx->Query.TransformFeedbackOverflow[index];
   else
  return NULL;
-   case GL_TRANSFORM_FEEDBACK_OVERFLOW_ARB:
+   case GL_TRANSFORM_FEEDBACK_OVERFLOW:
   if (ctx->Extensions.ARB_transform_feedback_overflow_query)
  return &ctx->Query.TransformFeedbackOverflowAny;
   else
  return NULL;
 
-   case GL_VERTICES_SUBMITTED_ARB:
-   case GL_PRIMITIVES_SUBMITTED_ARB:
-   case GL_VERTEX_SHADER_INVOCATIONS_ARB:
-   case GL_FRAGMENT_SHADER_INVOCATIONS_ARB:
-   case GL_CLIPPING_INPUT_PRIMITIVES_ARB:
-   case GL_CLIPPING_OUTPUT_PRIMITIVES_ARB:
+   case GL_VERTICES_SUBMITTED:
+   case GL_PRIMITIVES_SUBMITTED:
+   case GL_VERTEX_SHADER_INVOCATIONS:
+   case GL_FRAGMENT_SHADER_INVOCATIONS:
+   case GL_CLIPPING_INPUT_PRIMITIVES:
+   case GL_CLIPPING_OUTPUT_PRIMITIVES:
  return get_pipe_stats_binding_point(ctx, target);
 
case GL_GEOMETRY_SHADER_INVOCATIONS:
   /* GL_GEOMETRY_SHADER_INVOCATIONS is defined in a non-sequential order */
-  target = GL_VERTICES_SUBMITTED_ARB + MAX_PIPELINE_STATISTICS - 1;
+  target = GL_VERTICES_SUBMITTED + MAX_PIPELINE_STATISTICS - 1;
   /* fallthrough */
-   case GL_GEOMETRY_SHADER_PRIMITIVES_EMITTED_ARB:
+   case GL_GEOMETRY_SHADER_PRIMITIVES_EMITTED:
   if (_mesa_has_geometry_shaders(ctx))
  return get_pipe_stats_binding_point(ctx, target);
   else
  return NULL;
 
-   case GL_TESS_CONTROL_SHADER_PATCHES_ARB:
-   case GL_TESS_EVALUATION_SHADER_INVOCATIONS_ARB:
+   case GL_TESS_CONTROL_SHADER_PATCHES:
+   case GL_TESS_EVALUATION_SHADER_INVOCATIONS:
   if (_mesa_has_tessellation(ctx))
  return get_pipe_stats_binding_point(ctx, target);
   else
  return NULL;
 
-   case GL_COMPUTE_SHADER_INVOCATIONS_ARB:
+   case GL_COMPUTE_SHADER_INVOCATIONS:
   if (_mesa_has_compute_shaders(ctx))
  return get_pipe_stats_binding_point(ctx, target);
   else
@@ -316,8 +316,8 @@ _mesa_CreateQueries(GLenum target, GLsizei n, GLuint *ids)
case GL_TIMESTAMP:
case GL_PRIMITIVES_GENERATED:
case GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:
-   case GL_TRANSFORM_FEEDBACK_STREAM_OVERFLOW_ARB:
-   case GL_TRANSFORM_FEEDBACK_OVERFLOW_ARB:
+   case GL_TRANSFORM_FEEDBACK_STREAM_OVERFLOW:
+   case GL_TRANSFORM_FEEDBACK_OVERFLOW:
   break;
default:
   _mesa_error(ctx, GL_INVALID_ENUM, "glCreateQueries(invalid target = %s)",
@@ -393,7 +393,7 @@ query_error_check_index(struct gl_context *ctx, GLenum 
target, GLuint index)
switch (target) {
case GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:
case GL_PRIMITIVES_GENERATED:
-   case GL_TRANSFORM_FEEDBACK_STREAM_OVERFLOW_ARB:
+   case GL_TRANSFORM_FEEDBACK_STREAM_OVERFLOW:
   if (index >= ctx->Const.MaxVertexStreams) {
  _mesa_error(ctx, GL_INVALID_VALUE,
  "glBeginQueryIndexed(index>=MaxVertexStreams)");
@@ -692,7 +692,7 @@ _mesa_GetQueryIndexediv(GLenum target, GLuint index, GLenum 
pname,
}
 
switch (pname) {
-  case GL_QUERY_COUNTER_BITS_ARB:
+  case GL_QUERY_COUNTER_BITS:
  switch (target) {
  case GL_SAMPL

[Mesa-dev] [PATCH v2 08/13] mesa/main: fix validation of GL_TIME_ELAPSED

2018-11-08 Thread Erik Faye-Lund
ctx->Extensions.EXT_timer_query is set based on the driver-
capabilities, not based on the context type. We need to check against
_mesa_has_EXT_timer_query(ctx) instead to figure out if the extension
is really supported. We also need to check for
EXT_disjoint_timer_query, which enables the same functionality for ES.

This turns usage of GL_TIME_ELAPSED into an error on ES 3, as is
required by the spec.

Signed-off-by: Erik Faye-Lund 
---
 src/mesa/main/queryobj.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/mesa/main/queryobj.c b/src/mesa/main/queryobj.c
index e9bc1a7de40..9b3671f90a0 100644
--- a/src/mesa/main/queryobj.c
+++ b/src/mesa/main/queryobj.c
@@ -197,7 +197,8 @@ get_query_binding_point(struct gl_context *ctx, GLenum 
target, GLuint index)
   else
  return NULL;
case GL_TIME_ELAPSED:
-  if (ctx->Extensions.EXT_timer_query)
+  if (_mesa_has_EXT_timer_query(ctx) ||
+  _mesa_has_EXT_disjoint_timer_query(ctx))
  return &ctx->Query.CurrentTimerObject;
   else
  return NULL;
-- 
2.19.1

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


[Mesa-dev] [PATCH v2 07/13] mesa/main: fix validation of GL_ANY_SAMPLES_PASSED_CONSERVATIVE

2018-11-08 Thread Erik Faye-Lund
ctx->Extensions.ARB_ES3_compatibility is set based on the driver-
capabilities, not based on the context type. We need to check against
_mesa_has_ARB_ES3_compatibility(ctx) instead to figure out if the
extension is really supported.

In addition, EXT_occlusion_query_boolean should also allow this
behavior.

This shouldn't cause any functional change, as all drivers that support
ES3_compatibility should in practice enable either ES3_compatibility or
EXT_occlusion_query_boolean under all APIs that export this symbol.

Signed-off-by: Erik Faye-Lund 
---
 src/mesa/main/queryobj.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/mesa/main/queryobj.c b/src/mesa/main/queryobj.c
index 25d76a48648..e9bc1a7de40 100644
--- a/src/mesa/main/queryobj.c
+++ b/src/mesa/main/queryobj.c
@@ -191,8 +191,8 @@ get_query_binding_point(struct gl_context *ctx, GLenum 
target, GLuint index)
   else
  return NULL;
case GL_ANY_SAMPLES_PASSED_CONSERVATIVE:
-  if (ctx->Extensions.ARB_ES3_compatibility
-  || (ctx->API == API_OPENGLES2 && ctx->Version >= 30))
+  if (_mesa_has_ARB_ES3_compatibility(ctx) ||
+  _mesa_has_EXT_occlusion_query_boolean(ctx))
  return &ctx->Query.CurrentOcclusionObject;
   else
  return NULL;
-- 
2.19.1

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


[Mesa-dev] [PATCH v5] intel/decoder: Engine parameter for instructions

2018-11-08 Thread Toni Lönnberg
Preliminary work for adding handling of different pipes to gen_decoder. Each
instruction needs to have a definition describing which engine it is meant for.
If left undefined, by default, the instruction is defined for all engines.

v2: Changed to use the engine class definitions from UAPI

v3: Changed I915_ENGINE_CLASS_TO_MASK to use BITSET_BIT, change engine to
engine_mask, added check for incorrect engine and added the possibility to
define an instruction to multiple engines using the "|" as a delimiter in the
engine attribute.

v4: Fixed the memory leak.

v5: Removed an unnecessary ralloc_free().
---
 src/intel/common/gen_decoder.c | 25 +
 src/intel/common/gen_decoder.h |  6 ++
 2 files changed, 31 insertions(+)

diff --git a/src/intel/common/gen_decoder.c b/src/intel/common/gen_decoder.c
index 8148b2f1489..326768fd721 100644
--- a/src/intel/common/gen_decoder.c
+++ b/src/intel/common/gen_decoder.c
@@ -165,6 +165,9 @@ create_group(struct parser_context *ctx,
group->fixed_length = fixed_length;
group->dword_length_field = NULL;
group->dw_length = 0;
+   group->engine_mask = I915_ENGINE_CLASS_TO_MASK(I915_ENGINE_CLASS_RENDER) |
+I915_ENGINE_CLASS_TO_MASK(I915_ENGINE_CLASS_VIDEO) |
+I915_ENGINE_CLASS_TO_MASK(I915_ENGINE_CLASS_COPY);
group->bias = 1;
 
for (int i = 0; atts[i]; i += 2) {
@@ -173,6 +176,28 @@ create_group(struct parser_context *ctx,
  group->dw_length = strtoul(atts[i + 1], &p, 0);
   } else if (strcmp(atts[i], "bias") == 0) {
  group->bias = strtoul(atts[i + 1], &p, 0);
+  } else if (strcmp(atts[i], "engine") == 0) {
+ void *mem_ctx = ralloc_context(NULL);
+ char *tmp = ralloc_strdup(mem_ctx, atts[i + 1]);
+ char *save_ptr;
+ char *tok = strtok_r(tmp, "|", &save_ptr);
+
+ group->engine_mask = 0;
+ while (tok != NULL) {
+if (strcmp(tok, "render") == 0) {
+   group->engine_mask |= 
I915_ENGINE_CLASS_TO_MASK(I915_ENGINE_CLASS_RENDER);
+} else if (strcmp(tok, "video") == 0) {
+   group->engine_mask |= 
I915_ENGINE_CLASS_TO_MASK(I915_ENGINE_CLASS_VIDEO);
+} else if (strcmp(tok, "blitter") == 0) {
+   group->engine_mask |= 
I915_ENGINE_CLASS_TO_MASK(I915_ENGINE_CLASS_COPY);
+} else {
+   fprintf(stderr, "unknown engine class defined for instruction 
\"%s\": %s\n", name, atts[i + 1]);
+}
+
+tok = strtok_r(NULL, "|", &save_ptr);
+ }
+
+ ralloc_free(mem_ctx);
   }
}
 
diff --git a/src/intel/common/gen_decoder.h b/src/intel/common/gen_decoder.h
index 4beed22d729..4311f58b4eb 100644
--- a/src/intel/common/gen_decoder.h
+++ b/src/intel/common/gen_decoder.h
@@ -30,6 +30,9 @@
 
 #include "dev/gen_device_info.h"
 #include "util/hash_table.h"
+#include "util/bitset.h"
+
+#include "drm-uapi/i915_drm.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -40,6 +43,8 @@ struct gen_group;
 struct gen_field;
 union gen_field_value;
 
+#define I915_ENGINE_CLASS_TO_MASK(x) BITSET_BIT(x)
+
 static inline uint32_t gen_make_gen(uint32_t major, uint32_t minor)
 {
return (major << 8) | minor;
@@ -102,6 +107,7 @@ struct gen_group {
struct gen_field *dword_length_field; /*  specific */
 
uint32_t dw_length;
+   uint32_t engine_mask; /*  specific */
uint32_t bias; /*  specific */
uint32_t group_offset, group_count;
uint32_t group_size;
-- 
2.17.1

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


Re: [Mesa-dev] [PATCH v4] intel/decoder: tools: gen_engine to drm_i915_gem_engine_class

2018-11-08 Thread Lionel Landwerlin

Thanks a lot,

Reviewed-by: Lionel Landwerlin 

On 08/11/2018 12:41, Toni Lönnberg wrote:

Removed the gen_engine enum and changed the involved functions to use the
drm_i915_gem_engine_class enum from UAPI instead.

v3: Wrong engine was being used for blocks in video ring

v4: Fixed aubinator_viewer.cpp
---
  src/intel/tools/aub_read.c   | 22 +++---
  src/intel/tools/aub_read.h   | 11 +++
  src/intel/tools/aubinator.c  |  5 ++---
  src/intel/tools/aubinator_viewer.cpp |  6 +++---
  4 files changed, 19 insertions(+), 25 deletions(-)

diff --git a/src/intel/tools/aub_read.c b/src/intel/tools/aub_read.c
index d83e88ddced..1b6787d4a97 100644
--- a/src/intel/tools/aub_read.c
+++ b/src/intel/tools/aub_read.c
@@ -136,7 +136,7 @@ handle_trace_block(struct aub_read *read, const uint32_t *p)
 int type = p[1] & AUB_TRACE_TYPE_MASK;
 int address_space = p[1] & AUB_TRACE_ADDRESS_SPACE_MASK;
 int header_length = p[0] & 0x;
-   int engine = GEN_ENGINE_RENDER;
+   enum drm_i915_gem_engine_class engine = I915_ENGINE_CLASS_RENDER;
 const void *data = p + header_length + 2;
 uint64_t address = gen_48b_address((read->devinfo.gen >= 8 ? ((uint64_t) p[5] 
<< 32) : 0) |
((uint64_t) p[3]));
@@ -151,13 +151,13 @@ handle_trace_block(struct aub_read *read, const uint32_t 
*p)
 case AUB_TRACE_OP_COMMAND_WRITE:
switch (type) {
case AUB_TRACE_TYPE_RING_PRB0:
- engine = GEN_ENGINE_RENDER;
+ engine = I915_ENGINE_CLASS_RENDER;
   break;
case AUB_TRACE_TYPE_RING_PRB1:
- engine = GEN_ENGINE_VIDEO;
+ engine = I915_ENGINE_CLASS_VIDEO;
   break;
case AUB_TRACE_TYPE_RING_PRB2:
- engine = GEN_ENGINE_BLITTER;
+ engine = I915_ENGINE_CLASS_COPY;
   break;
default:
   parse_error(read, p, "command write to unknown ring %d\n", type);
@@ -182,7 +182,7 @@ handle_memtrace_reg_write(struct aub_read *read, const 
uint32_t *p)
 if (read->reg_write)
read->reg_write(read->user_data, offset, value);
  
-   int engine;

+   enum drm_i915_gem_engine_class engine;
 uint64_t context_descriptor;
  
 switch (offset) {

@@ -192,7 +192,7 @@ handle_memtrace_reg_write(struct aub_read *read, const 
uint32_t *p)
   return;
  
read->render_elsp_index = 0;

-  engine = GEN_ENGINE_RENDER;
+  engine = I915_ENGINE_CLASS_RENDER;
context_descriptor = (uint64_t)read->render_elsp[2] << 32 |
   read->render_elsp[3];
break;
@@ -202,7 +202,7 @@ handle_memtrace_reg_write(struct aub_read *read, const 
uint32_t *p)
   return;
  
read->video_elsp_index = 0;

-  engine = GEN_ENGINE_VIDEO;
+  engine = I915_ENGINE_CLASS_VIDEO;
context_descriptor = (uint64_t)read->video_elsp[2] << 32 |
   read->video_elsp[3];
break;
@@ -212,7 +212,7 @@ handle_memtrace_reg_write(struct aub_read *read, const 
uint32_t *p)
   return;
  
read->blitter_elsp_index = 0;

-  engine = GEN_ENGINE_BLITTER;
+  engine = I915_ENGINE_CLASS_COPY;
context_descriptor = (uint64_t)read->blitter_elsp[2] << 32 |
   read->blitter_elsp[3];
break;
@@ -241,17 +241,17 @@ handle_memtrace_reg_write(struct aub_read *read, const 
uint32_t *p)
return;
break;
 case 0x2550: /* render elsc */
-  engine = GEN_ENGINE_RENDER;
+  engine = I915_ENGINE_CLASS_RENDER;
context_descriptor = (uint64_t)read->render_elsp[2] << 32 |
   read->render_elsp[3];
break;
 case 0x12550: /* video_elsc */
-  engine = GEN_ENGINE_VIDEO;
+  engine = I915_ENGINE_CLASS_VIDEO;
context_descriptor = (uint64_t)read->video_elsp[2] << 32 |
   read->video_elsp[3];
break;
 case 0x22550: /* blitter elsc */
-  engine = GEN_ENGINE_BLITTER;
+  engine = I915_ENGINE_CLASS_COPY;
context_descriptor = (uint64_t)read->blitter_elsp[2] << 32 |
   read->blitter_elsp[3];
break;
diff --git a/src/intel/tools/aub_read.h b/src/intel/tools/aub_read.h
index e48ac3164bc..1e788332dcb 100644
--- a/src/intel/tools/aub_read.h
+++ b/src/intel/tools/aub_read.h
@@ -28,17 +28,12 @@
  #include 
  
  #include "dev/gen_device_info.h"

+#include "drm-uapi/i915_drm.h"
  
  #ifdef __cplusplus

  extern "C" {
  #endif
  
-enum gen_engine {

-   GEN_ENGINE_RENDER = 1,
-   GEN_ENGINE_VIDEO = 2,
-   GEN_ENGINE_BLITTER = 3,
-};
-
  struct aub_read {
 /* Caller's data */
 void *user_data;
@@ -55,9 +50,9 @@ struct aub_read {
  
 void (*reg_write)(void *user_data, uint32_t reg_offset, uint32_t reg_value);
  
-   void (*ring_write)(void *user_data, enum gen_engine engine,

+   void (*ring_write)(void *user_data, enum drm_i915_gem_engine_class engine,
const void *data, uint32_t data_len);
-   void (*execlist_write)(void *user_data, enum gen_engine engine,
+   void (*execl

[Mesa-dev] [PATCH 2/2] radv: clean up setting partial_es_wave for distributed tess on VI

2018-11-08 Thread Samuel Pitoiset
Only needed when the pipeline actually uses tessellation. I don't
think that changes anything, except improving readability.

Signed-off-by: Samuel Pitoiset 
---
 src/amd/vulkan/radv_pipeline.c | 11 ---
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c
index bced19573c..f999383018 100644
--- a/src/amd/vulkan/radv_pipeline.c
+++ b/src/amd/vulkan/radv_pipeline.c
@@ -3371,14 +3371,8 @@ radv_compute_ia_multi_vgt_param_helpers(struct 
radv_pipeline *pipeline,
else
ia_multi_vgt_param.primgroup_size = 128; /* recommended without 
a GS */
 
-   ia_multi_vgt_param.partial_es_wave = false;
-   if (pipeline->device->has_distributed_tess) {
-   if (radv_pipeline_has_gs(pipeline)) {
-   if (device->physical_device->rad_info.chip_class <= VI)
-   ia_multi_vgt_param.partial_es_wave = true;
-   }
-   }
/* GS requirement. */
+   ia_multi_vgt_param.partial_es_wave = false;
if (radv_pipeline_has_gs(pipeline) && 
device->physical_device->rad_info.chip_class <= VI)
if (SI_GS_PER_ES / ia_multi_vgt_param.primgroup_size >= 
pipeline->device->gs_table_depth - 3)
ia_multi_vgt_param.partial_es_wave = true;
@@ -3425,6 +3419,9 @@ radv_compute_ia_multi_vgt_param_helpers(struct 
radv_pipeline *pipeline,
/* Needed for 028B6C_DISTRIBUTION_MODE != 0 */
if (device->has_distributed_tess) {
if (radv_pipeline_has_gs(pipeline)) {
+   if 
(device->physical_device->rad_info.chip_class <= VI)
+   ia_multi_vgt_param.partial_es_wave = 
true;
+
if (device->physical_device->rad_info.family == 
CHIP_TONGA ||
device->physical_device->rad_info.family == 
CHIP_FIJI ||
device->physical_device->rad_info.family == 
CHIP_POLARIS10 ||
-- 
2.19.1

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


[Mesa-dev] [PATCH 1/2] radv: cleanup and document a Hawaii bug with offchip buffers

2018-11-08 Thread Samuel Pitoiset
Signed-off-by: Samuel Pitoiset 
---
 src/amd/vulkan/radv_device.c | 17 -
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
index 92254bed2e..145be67c85 100644
--- a/src/amd/vulkan/radv_device.c
+++ b/src/amd/vulkan/radv_device.c
@@ -2046,16 +2046,15 @@ radv_get_hs_offchip_param(struct radv_device *device, 
uint32_t *max_offchip_buff
max_offchip_buffers = max_offchip_buffers_per_se *
device->physical_device->rad_info.max_se;
 
-   switch (device->tess_offchip_block_dw_size) {
-   default:
-   assert(0);
-   /* fall through */
-   case 8192:
-   offchip_granularity = V_03093C_X_8K_DWORDS;
-   break;
-   case 4096:
+   /* Hawaii has a bug with offchip buffers > 256 that can be worked
+* around by setting 4K granularity.
+*/
+   if (device->tess_offchip_block_dw_size == 4096) {
+   assert(device->physical_device->rad_info.family == CHIP_HAWAII);
offchip_granularity = V_03093C_X_4K_DWORDS;
-   break;
+   } else {
+   assert(device->tess_offchip_block_dw_size == 8192);
+   offchip_granularity = V_03093C_X_8K_DWORDS;
}
 
switch (device->physical_device->rad_info.chip_class) {
-- 
2.19.1

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


Re: [Mesa-dev] [PATCH v3 02/10] intel/genxml: Add engine definition to render engine instructions (gen45)

2018-11-08 Thread Toni Lönnberg
On Thu, Nov 08, 2018 at 10:47:20AM +, Lionel Landwerlin wrote:
> Missing tag on :
> 
> 
> CS_URB_STATE
> CONSTANT_BUFFER
> MI_FLUSH
> URB_FENCE
> XY_COLOR_BLT
> XY_SETUP_BLT
> XY_SRC_COPY_BLT
> XY_TEXT_IMMEDIATE_BLT

?!

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


Re: [Mesa-dev] [PATCH v3 03/10] intel/genxml: Add engine definition to render engine instructions (gen5)

2018-11-08 Thread Toni Lönnberg
On Thu, Nov 08, 2018 at 10:47:55AM +, Lionel Landwerlin wrote:
> Same missing tags a gen4.5

?!

+  
+  
+  
+  
+  
+  
+  
+  

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


Re: [Mesa-dev] [PATCH v3 02/10] intel/genxml: Add engine definition to render engine instructions (gen45)

2018-11-08 Thread Lionel Landwerlin

On 08/11/2018 13:06, Toni Lönnberg wrote:

On Thu, Nov 08, 2018 at 10:47:20AM +, Lionel Landwerlin wrote:

Missing tag on :


CS_URB_STATE
CONSTANT_BUFFER
MI_FLUSH
URB_FENCE
XY_COLOR_BLT
XY_SETUP_BLT
XY_SRC_COPY_BLT
XY_TEXT_IMMEDIATE_BLT

?!

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


Oops Looks like git pw didn't download the right version of the 
series :(


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


Re: [Mesa-dev] [PATCH v3 05/10] intel/genxml: Add engine definition to render engine instructions (gen7)

2018-11-08 Thread Toni Lönnberg
On Thu, Nov 08, 2018 at 10:54:17AM +, Lionel Landwerlin wrote:
> Just SWTESS_BASE_ADDRESS missing render engine

?!

+  

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


Re: [Mesa-dev] [PATCH v3 06/10] intel/genxml: Add engine definition to render engine instructions (gen75)

2018-11-08 Thread Toni Lönnberg
On Thu, Nov 08, 2018 at 10:55:06AM +, Lionel Landwerlin wrote:
> Missing render engine :
> 
> 
> SWTESS_BASE_ADDRESS
> 
> MI_RS_CONTEXT
> 
> MI_RS_CONTROL
> 
> MI_RS_STORE_DATA_IMM

?!

+  
+  
+  
+  

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


[Mesa-dev] [PATCH 0/7] RFC: adapt nir_gather_xfb_info to be used by ARB_gl_spirv

2018-11-08 Thread Alejandro Piñeiro
ARB_gl_spirv has its own NIR-based xfb gathering info. Since
nir_gather_xfb_info landed on master, I have been trying to get to use
it, in order to reuse code.

Although I consider this series a WIP, I prefer to share what I have
right now, just in case the idea of adapt nir_gather_xfb_info is
discarded. Having said so, this series also includes a fix ("nir: fix
output offset compute for dvec3/4"). That patch can be used even if we
discard the rest of the series.

The main difference between the custom ARB_gl_spirv code and the NIR
general pass are varyings, as the new pass is focused on outputs. As
far as I understand, varyings is just needed for OpenGL.

So although I was able to modify the new pass to be reused, and all
tests we have are passing, I'm not really happy with the current
patches. The original idea is that it would be ok to reuse, as far as
we didn't need to add too much info, or needed to change too much that
pass. So I focused on modifying the code as less as possible. But that
lead to some debatable decisions. It is more detailed on the patches
with RFC. 

BR


Alejandro Piñeiro (7):
  spirv/nir: update Xfb decoration comment
  nir: don't assert when xfb_buffer/stride is present but not xfb_offset
  nir: fix output offset compute for dvec3/4
  nir: add component_offset at nir_xfb_info
  RFC: nir: adding varyings on nir_xfb_info and gather_info
  RFC: nir/xfb_info: arrays of basic types adds just one varying
  nir/linker: use nir_gather_xfb_info

 src/compiler/glsl/gl_nir_link_xfb.c| 252 ++---
 src/compiler/nir/nir_gather_xfb_info.c | 101 +++--
 src/compiler/nir/nir_xfb_info.h|  25 ++--
 src/compiler/spirv/spirv_to_nir.c  |   2 +-
 4 files changed, 180 insertions(+), 200 deletions(-)

-- 
2.14.1

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


[Mesa-dev] [PATCH 2/7] nir: don't assert when xfb_buffer/stride is present but not xfb_offset

2018-11-08 Thread Alejandro Piñeiro
In order to allow nir_gather_xfb_info to be used on OpenGL,
specifically ARB_gl_spirv.

So, from OpenGL 4.6 spec, section 11.1.2.1, "Output Variables":

"outputs specifying both an *XfbBuffer* and an *Offset* are
 captured, while outputs not specifying both of these are not
 captured. Values are captured each time the shader writes to such
 a decorated object."

This implies that are captured if both are present, and not if one of
those are lacking. Technically, it doesn't explicitly point that
having just one or the other is a mistake. In some cases, glslang is
adding some extra XfbBuffer without XfbOffset around, and mentioning
that technically that is not a bug (see issue#1526)

And for the case of Vulkan, as the same glslang issue mentions, it is
not clear if that should be a mistake or not. But even if it is a
mistake, it is not really needed to be checked on the driver, and we
can let the validation layers to check that.
---
 src/compiler/nir/nir_gather_xfb_info.c | 23 ---
 1 file changed, 20 insertions(+), 3 deletions(-)

diff --git a/src/compiler/nir/nir_gather_xfb_info.c 
b/src/compiler/nir/nir_gather_xfb_info.c
index e282bba0081..f5d831c6567 100644
--- a/src/compiler/nir/nir_gather_xfb_info.c
+++ b/src/compiler/nir/nir_gather_xfb_info.c
@@ -109,9 +109,16 @@ nir_gather_xfb_info(const nir_shader *shader, void 
*mem_ctx)
nir_foreach_variable(var, &shader->outputs) {
   if (var->data.explicit_xfb_buffer ||
   var->data.explicit_xfb_stride) {
- assert(var->data.explicit_xfb_buffer &&
-var->data.explicit_xfb_stride &&
-var->data.explicit_offset);
+
+ /* OpenGL points that both are needed to capture the output, but
+  * doesn't direcly imply that it is a mistake having one but not the
+  * other.
+  */
+ if (!var->data.explicit_xfb_buffer ||
+ !var->data.explicit_offset) {
+continue;
+ }
+
  num_outputs += glsl_count_attribute_slots(var->type, false);
   }
}
@@ -124,6 +131,16 @@ nir_gather_xfb_info(const nir_shader *shader, void 
*mem_ctx)
nir_foreach_variable(var, &shader->outputs) {
   if (var->data.explicit_xfb_buffer ||
   var->data.explicit_xfb_stride) {
+
+ /* OpenGL points that both are needed to capture the output, but
+  * doesn't direcly imply that it is a mistake having one but not the
+  * other.
+  */
+ if (!var->data.explicit_xfb_buffer ||
+ !var->data.explicit_offset) {
+continue;
+ }
+
  unsigned location = var->data.location;
  unsigned offset = var->data.offset;
  add_var_xfb_outputs(xfb, var, &location, &offset, var->type);
-- 
2.14.1

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


[Mesa-dev] [PATCH 6/7] RFC: nir/xfb_info: arrays of basic types adds just one varying

2018-11-08 Thread Alejandro Piñeiro
On OpenGL, a array of a simple type adds just one varying. So
gl_transform_feedback_varying_info struct defined at mtypes.h includes
the parameters Type (base_type) and Size (number of elements).

This commit checks this when the recursive add_var_xfb_outputs call
handles arrays, to ensure that just one is addded.

RFC: Until this point, all changes were reasonable, but this change is
(imho) ugly. My idea was introducing as less as possible changes on
the code, specially on its logic/flow. But this commit is almost a
hack. The ideal solution would be to change the focus of the recursive
function, focusing on varyings, and at each varying, recursively add
outputs. But that seems like an overkill for a pass that was
originally intended for consumers only caring about the outputs. So
perhaps ARB_gl_spirv should keep their own gathering pass, with
vayings and outputs, and let this one untouched for those that only
care on outputs.
---
 src/compiler/nir/nir_gather_xfb_info.c | 52 --
 1 file changed, 43 insertions(+), 9 deletions(-)

diff --git a/src/compiler/nir/nir_gather_xfb_info.c 
b/src/compiler/nir/nir_gather_xfb_info.c
index 948b802a815..cb0e2724cab 100644
--- a/src/compiler/nir/nir_gather_xfb_info.c
+++ b/src/compiler/nir/nir_gather_xfb_info.c
@@ -36,23 +36,59 @@ nir_gather_xfb_info_create(void *mem_ctx, uint16_t 
output_count, uint16_t varyin
return xfb;
 }
 
+static bool
+glsl_type_is_leaf(const struct glsl_type *type)
+{
+   if (glsl_type_is_struct(type) ||
+   (glsl_type_is_array(type) &&
+(glsl_type_is_array(glsl_get_array_element(type)) ||
+ glsl_type_is_struct(glsl_get_array_element(type) {
+  return false;
+   } else {
+  return true;
+   }
+}
+
+static void
+add_var_xfb_varying(nir_xfb_info *xfb,
+nir_variable *var,
+unsigned offset,
+const struct glsl_type *type)
+{
+   nir_xfb_varying_info *varying = &xfb->varyings[xfb->varying_count++];
+
+   varying->type = type;
+   varying->buffer = var->data.xfb_buffer;
+   varying->offset = offset;
+   xfb->buffers[var->data.xfb_buffer].varying_count++;
+}
+
 static void
 add_var_xfb_outputs(nir_xfb_info *xfb,
 nir_variable *var,
 unsigned *location,
 unsigned *offset,
-const struct glsl_type *type)
+const struct glsl_type *type,
+bool varying_added)
 {
if (glsl_type_is_array(type) || glsl_type_is_matrix(type)) {
   unsigned length = glsl_get_length(type);
+  bool local_varying_added = varying_added;
+
   const struct glsl_type *child_type = glsl_get_array_element(type);
+  if (glsl_type_is_leaf(child_type)) {
+
+ add_var_xfb_varying(xfb, var, *offset, type);
+ local_varying_added = true;
+  }
+
   for (unsigned i = 0; i < length; i++)
- add_var_xfb_outputs(xfb, var, location, offset, child_type);
+ add_var_xfb_outputs(xfb, var, location, offset, child_type, 
local_varying_added);
} else if (glsl_type_is_struct(type)) {
   unsigned length = glsl_get_length(type);
   for (unsigned i = 0; i < length; i++) {
  const struct glsl_type *child_type = glsl_get_struct_field(type, i);
- add_var_xfb_outputs(xfb, var, location, offset, child_type);
+ add_var_xfb_outputs(xfb, var, location, offset, child_type, 
varying_added);
   }
} else {
   assert(var->data.xfb_buffer < NIR_MAX_XFB_BUFFERS);
@@ -83,11 +119,9 @@ add_var_xfb_outputs(nir_xfb_info *xfb,
   uint8_t comp_mask = ((1 << comp_slots) - 1) << var->data.location_frac;
   unsigned location_frac = var->data.location_frac;
 
-  nir_xfb_varying_info *varying = &xfb->varyings[xfb->varying_count++];
-  varying->type = type;
-  varying->buffer = var->data.xfb_buffer;
-  varying->offset = *offset;
-  xfb->buffers[var->data.xfb_buffer].varying_count++;
+  if (!varying_added) {
+ add_var_xfb_varying(xfb, var, *offset, type);
+  }
 
   assert(attrib_slots <= 2);
   for (unsigned s = 0; s < attrib_slots; s++) {
@@ -171,7 +205,7 @@ nir_gather_xfb_info(const nir_shader *shader, void *mem_ctx)
 
  unsigned location = var->data.location;
  unsigned offset = var->data.offset;
- add_var_xfb_outputs(xfb, var, &location, &offset, var->type);
+ add_var_xfb_outputs(xfb, var, &location, &offset, var->type, false);
   }
}
assert(xfb->output_count == num_outputs);
-- 
2.14.1

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


[Mesa-dev] [PATCH 1/7] spirv/nir: update Xfb decoration comment

2018-11-08 Thread Alejandro Piñeiro
Although it is true that Vulkan doesn't support transform feedback
yet, spirv to nir is handling it due ARB_gl_spirv support. Having said
so, those decorations are handled elsewhere.
---
 src/compiler/spirv/spirv_to_nir.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/compiler/spirv/spirv_to_nir.c 
b/src/compiler/spirv/spirv_to_nir.c
index 96ff09c3659..140e98eba27 100644
--- a/src/compiler/spirv/spirv_to_nir.c
+++ b/src/compiler/spirv/spirv_to_nir.c
@@ -774,7 +774,7 @@ struct_member_decoration_cb(struct vtn_builder *b,
 
case SpvDecorationXfbBuffer:
case SpvDecorationXfbStride:
-  vtn_warn("Vulkan does not have transform feedback");
+  /* Handled at vtn_variables.c, apply_var_decoration */
   break;
 
case SpvDecorationCPacked:
-- 
2.14.1

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


[Mesa-dev] [PATCH 5/7] RFC: nir: adding varyings on nir_xfb_info and gather_info

2018-11-08 Thread Alejandro Piñeiro
In order to be used for OpenGL (right now for ARB_gl_spirv).

This commit adds two new structures:
  * nir_xfb_varying_info: that identifies each individual varying. For
each one, we need to know the type, buffer and xfb_offset
  * nir_xfb_buffer_info: as now for each buffer, in addition to the
stride, we need to know how many varyings are assigned to it.

At this point, the only case where num_outputs!=num_varyings is with
the case of doubles, that for dvec3/4 could require more than one
output. There are more cases though, that will be handled on following
patches.

RFC: Also, as it is somewhat more complex to know the number of
varyings needed that the number of outputs, and num_varyings will be
always less that num_outputs, we are using num_outputs as an
approximation when allocating memory. This is debatable though.
---
 src/compiler/nir/nir_gather_xfb_info.c | 27 ---
 src/compiler/nir/nir_xfb_info.h| 24 
 2 files changed, 40 insertions(+), 11 deletions(-)

diff --git a/src/compiler/nir/nir_gather_xfb_info.c 
b/src/compiler/nir/nir_gather_xfb_info.c
index cd3afa32661..948b802a815 100644
--- a/src/compiler/nir/nir_gather_xfb_info.c
+++ b/src/compiler/nir/nir_gather_xfb_info.c
@@ -25,6 +25,17 @@
 
 #include 
 
+static nir_xfb_info *
+nir_gather_xfb_info_create(void *mem_ctx, uint16_t output_count, uint16_t 
varying_count)
+{
+   nir_xfb_info *xfb = rzalloc_size(mem_ctx, sizeof(nir_xfb_info));
+
+   xfb->varyings = rzalloc_size(mem_ctx, sizeof(nir_xfb_varying_info) * 
varying_count);
+   xfb->outputs = rzalloc_size(mem_ctx, sizeof(nir_xfb_output_info) * 
output_count);
+
+   return xfb;
+}
+
 static void
 add_var_xfb_outputs(nir_xfb_info *xfb,
 nir_variable *var,
@@ -46,11 +57,11 @@ add_var_xfb_outputs(nir_xfb_info *xfb,
} else {
   assert(var->data.xfb_buffer < NIR_MAX_XFB_BUFFERS);
   if (xfb->buffers_written & (1 << var->data.xfb_buffer)) {
- assert(xfb->strides[var->data.xfb_buffer] == var->data.xfb_stride);
+ assert(xfb->buffers[var->data.xfb_buffer].stride == 
var->data.xfb_stride);
  assert(xfb->buffer_to_stream[var->data.xfb_buffer] == 
var->data.stream);
   } else {
  xfb->buffers_written |= (1 << var->data.xfb_buffer);
- xfb->strides[var->data.xfb_buffer] = var->data.xfb_stride;
+ xfb->buffers[var->data.xfb_buffer].stride = var->data.xfb_stride;
  xfb->buffer_to_stream[var->data.xfb_buffer] = var->data.stream;
   }
 
@@ -72,6 +83,12 @@ add_var_xfb_outputs(nir_xfb_info *xfb,
   uint8_t comp_mask = ((1 << comp_slots) - 1) << var->data.location_frac;
   unsigned location_frac = var->data.location_frac;
 
+  nir_xfb_varying_info *varying = &xfb->varyings[xfb->varying_count++];
+  varying->type = type;
+  varying->buffer = var->data.xfb_buffer;
+  varying->offset = *offset;
+  xfb->buffers[var->data.xfb_buffer].varying_count++;
+
   assert(attrib_slots <= 2);
   for (unsigned s = 0; s < attrib_slots; s++) {
  nir_xfb_output_info *output = &xfb->outputs[xfb->output_count++];
@@ -132,7 +149,11 @@ nir_gather_xfb_info(const nir_shader *shader, void 
*mem_ctx)
if (num_outputs == 0)
   return NULL;
 
-   nir_xfb_info *xfb = rzalloc_size(mem_ctx, nir_xfb_info_size(num_outputs));
+   /* It is complex to know how many varyings do we have beforehand. We use
+* num_outputs as an approximation, as num_outputs should be bigger that
+* num_varyings.
+*/
+   nir_xfb_info *xfb = nir_gather_xfb_info_create(mem_ctx, num_outputs, 
num_outputs);
 
/* Walk the list of outputs and add them to the array */
nir_foreach_variable(var, &shader->outputs) {
diff --git a/src/compiler/nir/nir_xfb_info.h b/src/compiler/nir/nir_xfb_info.h
index fef52ba96d8..71f4e87018c 100644
--- a/src/compiler/nir/nir_xfb_info.h
+++ b/src/compiler/nir/nir_xfb_info.h
@@ -29,6 +29,11 @@
 #define NIR_MAX_XFB_BUFFERS 4
 #define NIR_MAX_XFB_STREAMS 4
 
+typedef struct {
+   uint16_t stride;
+   uint16_t varying_count;
+} nir_xfb_buffer_info;
+
 typedef struct {
uint8_t buffer;
uint16_t offset;
@@ -37,23 +42,26 @@ typedef struct {
uint8_t component_offset;
 } nir_xfb_output_info;
 
+typedef struct {
+   const struct glsl_type *type;
+   uint8_t buffer;
+   uint16_t offset;
+} nir_xfb_varying_info;
+
 typedef struct {
uint8_t buffers_written;
uint8_t streams_written;
 
-   uint16_t strides[NIR_MAX_XFB_BUFFERS];
+   nir_xfb_buffer_info buffers[NIR_MAX_XFB_BUFFERS];
uint8_t buffer_to_stream[NIR_MAX_XFB_STREAMS];
 
+   uint16_t varying_count;
+   nir_xfb_varying_info *varyings;
+
uint16_t output_count;
-   nir_xfb_output_info outputs[0];
+   nir_xfb_output_info *outputs;
 } nir_xfb_info;
 
-static inline size_t
-nir_xfb_info_size(uint16_t output_count)
-{
-   return sizeof(nir_xfb_info) + sizeof(nir_xfb_output_info) * output_count;
-}
-
 nir_xfb_info *
 nir_gather_xfb_info(const nir_shader *shader, voi

[Mesa-dev] [PATCH 3/7] nir: fix output offset compute for dvec3/4

2018-11-08 Thread Alejandro Piñeiro
The offset compute was working fine for the case of attrib_slots=1,
and updating the offset for the following varying.

But in the case of attrib_slots=2 (so dvec3/4), we are basically
splitting the comp_slots needed in two outputs. In that case we can't
add to the offset the full size of the type.
---
 src/compiler/nir/nir_gather_xfb_info.c | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/compiler/nir/nir_gather_xfb_info.c 
b/src/compiler/nir/nir_gather_xfb_info.c
index f5d831c6567..01fc2b26624 100644
--- a/src/compiler/nir/nir_gather_xfb_info.c
+++ b/src/compiler/nir/nir_gather_xfb_info.c
@@ -81,7 +81,11 @@ add_var_xfb_outputs(nir_xfb_info *xfb,
  output->component_mask = (comp_mask >> (s * 4)) & 0xf;
 
  (*location)++;
- *offset += comp_slots * 4;
+ /* attrib_slots would be only > 1 for doubles. On that case
+  * comp_slots will be a multiple of 2, so the following doesn't need
+  * to use DIV_ROUND_UP or similar
+  */
+ *offset += comp_slots / attrib_slots * 4;
   }
}
 }
-- 
2.14.1

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


[Mesa-dev] [PATCH 7/7] nir/linker: use nir_gather_xfb_info

2018-11-08 Thread Alejandro Piñeiro
Instead of a custom ARB_gl_spirv xfb gather info pass.

In fact, this is not only about reusing code, but the current custom
code was not handling properly how many varyings are enumerated from
some complex types. So this change is also about fixing some corner
cases.
---
 src/compiler/glsl/gl_nir_link_xfb.c | 252 +++-
 1 file changed, 72 insertions(+), 180 deletions(-)

diff --git a/src/compiler/glsl/gl_nir_link_xfb.c 
b/src/compiler/glsl/gl_nir_link_xfb.c
index bcef1e1863d..b294a4885b0 100644
--- a/src/compiler/glsl/gl_nir_link_xfb.c
+++ b/src/compiler/glsl/gl_nir_link_xfb.c
@@ -22,8 +22,8 @@
  */
 
 #include "nir.h"
+#include "nir_xfb_info.h"
 #include "gl_nir_linker.h"
-#include "ir_uniform.h" /* for gl_uniform_storage */
 #include "linker_util.h"
 #include "main/context.h"
 
@@ -34,158 +34,13 @@
  * particularities.
  */
 
-struct active_xfb_buffer {
-   GLuint stride;
-   GLuint num_varyings;
-};
-
-struct active_xfb_varyings {
-   unsigned num_varyings;
-   unsigned num_outputs;
-   unsigned buffer_size;
-   struct nir_variable **varyings;
-   struct active_xfb_buffer buffers[MAX_FEEDBACK_BUFFERS];
-};
-
-static unsigned
-get_num_outputs(nir_variable *var)
-{
-   return glsl_count_attribute_slots(var->type,
- false /* is_vertex_input */);
-}
-
-static void
-add_xfb_varying(struct active_xfb_varyings *active_varyings,
-nir_variable *var)
-{
-   if (active_varyings->num_varyings >= active_varyings->buffer_size) {
-  if (active_varyings->buffer_size == 0)
- active_varyings->buffer_size = 1;
-  else
- active_varyings->buffer_size *= 2;
-
-  active_varyings->varyings = realloc(active_varyings->varyings,
-  sizeof(nir_variable*) *
-  active_varyings->buffer_size);
-   }
-
-   active_varyings->varyings[active_varyings->num_varyings++] = var;
-
-   active_varyings->num_outputs += get_num_outputs(var);
-}
-
 static int
-cmp_xfb_offset(const void *x_generic, const void *y_generic)
-{
-   const nir_variable *const *x = x_generic;
-   const nir_variable *const *y = y_generic;
-
-   if ((*x)->data.xfb_buffer != (*y)->data.xfb_buffer)
-  return (*x)->data.xfb_buffer - (*y)->data.xfb_buffer;
-   return (*x)->data.offset - (*y)->data.offset;
-}
-
-static void
-get_active_xfb_varyings(struct gl_shader_program *prog,
-struct active_xfb_varyings *active_varyings)
-{
-   for (unsigned i = 0; i < MESA_SHADER_STAGES; ++i) {
-  struct gl_linked_shader *sh = prog->_LinkedShaders[i];
-  if (sh == NULL)
- continue;
-
-  nir_shader *nir = sh->Program->nir;
-
-  nir_foreach_variable(var, &nir->outputs) {
- if (var->data.explicit_xfb_buffer &&
- var->data.explicit_xfb_stride) {
-assert(var->data.xfb_buffer < MAX_FEEDBACK_BUFFERS);
-active_varyings->buffers[var->data.xfb_buffer].stride =
-   var->data.xfb_stride;
- }
-
- if (!var->data.explicit_xfb_buffer ||
- !var->data.explicit_offset)
-continue;
-
- active_varyings->buffers[var->data.xfb_buffer].num_varyings++;
-
- add_xfb_varying(active_varyings, var);
-  }
-   }
-
-   /* The xfb_offset qualifier does not have to be used in increasing order
-* however some drivers expect to receive the list of transform feedback
-* declarations in order so sort it now for convenience.
-*/
-   qsort(active_varyings->varyings,
- active_varyings->num_varyings,
- sizeof(*active_varyings->varyings),
- cmp_xfb_offset);
-}
-
-static unsigned
-add_varying_outputs(nir_variable *var,
-const struct glsl_type *type,
-unsigned location_offset,
-unsigned dest_offset,
-struct gl_transform_feedback_output *output)
+count_bits(uint8_t mask)
 {
-   unsigned num_outputs = 0;
-
-   if (glsl_type_is_array(type) || glsl_type_is_matrix(type)) {
-  unsigned length = glsl_get_length(type);
-  const struct glsl_type *child_type = glsl_get_array_element(type);
-  unsigned component_slots = glsl_get_component_slots(child_type);
-
-  for (unsigned i = 0; i < length; i++) {
- unsigned child_outputs = add_varying_outputs(var,
-  child_type,
-  location_offset,
-  dest_offset,
-  output + num_outputs);
- num_outputs += child_outputs;
- location_offset += child_outputs;
- dest_offset += component_slots;
-  }
-   } else if (glsl_type_is_struct(type)) {
-  unsigned length = glsl_get_length(type);
-  for (unsigned i = 0; i < length; i++) {
- const struct glsl_type *child_type = glsl_get_st

[Mesa-dev] [PATCH 4/7] nir: add component_offset at nir_xfb_info

2018-11-08 Thread Alejandro Piñeiro
Where component_offset here is the offset when accessing components of
a packed variable. Or in other words, location_frac on
nir.h. Different places of mesa use different names for it.

Technically nir_xfb_info consumer can get the same from the
component_mask, it seems somewhat forced to make it to compute it,
instead of providing it.
---
 src/compiler/nir/nir_gather_xfb_info.c | 3 +++
 src/compiler/nir/nir_xfb_info.h| 1 +
 2 files changed, 4 insertions(+)

diff --git a/src/compiler/nir/nir_gather_xfb_info.c 
b/src/compiler/nir/nir_gather_xfb_info.c
index 01fc2b26624..cd3afa32661 100644
--- a/src/compiler/nir/nir_gather_xfb_info.c
+++ b/src/compiler/nir/nir_gather_xfb_info.c
@@ -70,6 +70,7 @@ add_var_xfb_outputs(nir_xfb_info *xfb,
 
   assert(var->data.location_frac + comp_slots <= 8);
   uint8_t comp_mask = ((1 << comp_slots) - 1) << var->data.location_frac;
+  unsigned location_frac = var->data.location_frac;
 
   assert(attrib_slots <= 2);
   for (unsigned s = 0; s < attrib_slots; s++) {
@@ -79,6 +80,7 @@ add_var_xfb_outputs(nir_xfb_info *xfb,
  output->offset = *offset;
  output->location = *location;
  output->component_mask = (comp_mask >> (s * 4)) & 0xf;
+ output->component_offset = location_frac;
 
  (*location)++;
  /* attrib_slots would be only > 1 for doubles. On that case
@@ -86,6 +88,7 @@ add_var_xfb_outputs(nir_xfb_info *xfb,
   * to use DIV_ROUND_UP or similar
   */
  *offset += comp_slots / attrib_slots * 4;
+ location_frac = 0;
   }
}
 }
diff --git a/src/compiler/nir/nir_xfb_info.h b/src/compiler/nir/nir_xfb_info.h
index 9b543df5f47..fef52ba96d8 100644
--- a/src/compiler/nir/nir_xfb_info.h
+++ b/src/compiler/nir/nir_xfb_info.h
@@ -34,6 +34,7 @@ typedef struct {
uint16_t offset;
uint8_t location;
uint8_t component_mask;
+   uint8_t component_offset;
 } nir_xfb_output_info;
 
 typedef struct {
-- 
2.14.1

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


Re: [Mesa-dev] [PATCH v3 02/10] intel/genxml: Add engine definition to render engine instructions (gen45)

2018-11-08 Thread Toni Lönnberg
On Thu, Nov 08, 2018 at 01:10:54PM +, Lionel Landwerlin wrote:
> On 08/11/2018 13:06, Toni Lönnberg wrote:
> > On Thu, Nov 08, 2018 at 10:47:20AM +, Lionel Landwerlin wrote:
> > > Missing tag on :
> > > 
> > > 
> > > CS_URB_STATE
> > > CONSTANT_BUFFER
> > > MI_FLUSH
> > > URB_FENCE
> > > XY_COLOR_BLT
> > > XY_SETUP_BLT
> > > XY_SRC_COPY_BLT
> > > XY_TEXT_IMMEDIATE_BLT
> > ?!
> > 
> > +  
> > +  
> > +  
> > +  
> > +  
> > +  
> > +  
> > +   > engine="blitter">
> > ___
> > mesa-dev mailing list
> > mesa-dev@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/mesa-dev
> 
> Oops Looks like git pw didn't download the right version of the series
> :(

There were still a couple of missing tags that I fixed for v4 but I didn't add 
new instructions to any of the xmls that are missing, i.e. MI_RS_* from gen8 
for 
example. That'll need to be another patch.

Will post v4 as a series instead of replying to these ones if that's ok with 
you.

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


Re: [Mesa-dev] [PATCH v3 02/10] intel/genxml: Add engine definition to render engine instructions (gen45)

2018-11-08 Thread Lionel Landwerlin

On 08/11/2018 13:38, Toni Lönnberg wrote:

Will post v4 as a series instead of replying to these ones if that's ok with
you.


That would great, thank you.

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


[Mesa-dev] [PATCH] radv: make use of num_good_cu_per_sh in si_emit_graphics() too

2018-11-08 Thread Samuel Pitoiset
Signed-off-by: Samuel Pitoiset 
---
 src/amd/vulkan/si_cmd_buffer.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/amd/vulkan/si_cmd_buffer.c b/src/amd/vulkan/si_cmd_buffer.c
index 7a0f4e914d..a9f2572541 100644
--- a/src/amd/vulkan/si_cmd_buffer.c
+++ b/src/amd/vulkan/si_cmd_buffer.c
@@ -278,8 +278,7 @@ si_emit_graphics(struct radv_physical_device 
*physical_device,
radeon_set_sh_reg(cs, R_00B21C_SPI_SHADER_PGM_RSRC3_GS,
  S_00B21C_CU_EN(0x) | 
S_00B21C_WAVE_LIMIT(0x3F));
 
-   if (physical_device->rad_info.num_good_compute_units /
-   (physical_device->rad_info.max_se * 
physical_device->rad_info.max_sh_per_se) <= 4) {
+   if (physical_device->rad_info.num_good_cu_per_sh <= 4) {
/* Too few available compute units per SH. Disallowing
 * VS to run on CU0 could hurt us more than late VS
 * allocation would help.
-- 
2.19.1

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


[Mesa-dev] [PATCH] radv: set optimal OVERWRITE_COMBINER_WATERMARK on GFX9

2018-11-08 Thread Samuel Pitoiset
Ported from RadeonSI.

Signed-off-by: Samuel Pitoiset 
---
 src/amd/vulkan/radv_cmd_buffer.c |  7 +++
 src/amd/vulkan/radv_device.c | 12 
 src/amd/vulkan/radv_private.h|  2 ++
 src/amd/vulkan/si_cmd_buffer.c   |  3 ---
 4 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c
index ee5373950f..a5788d6ad3 100644
--- a/src/amd/vulkan/radv_cmd_buffer.c
+++ b/src/amd/vulkan/radv_cmd_buffer.c
@@ -1541,6 +1541,13 @@ radv_emit_framebuffer_state(struct radv_cmd_buffer 
*cmd_buffer)
   S_028208_BR_X(framebuffer->width) |
   S_028208_BR_Y(framebuffer->height));
 
+   if (cmd_buffer->device->physical_device->rad_info.chip_class >= VI) {
+   uint8_t watermark = 
framebuffer->dcc_overwrite_combiner_watermark;
+   radeon_set_context_reg(cmd_buffer->cs, R_028424_CB_DCC_CONTROL,
+  
S_028424_OVERWRITE_COMBINER_MRT_SHARING_DISABLE(1) |
+  
S_028424_OVERWRITE_COMBINER_WATERMARK(watermark));
+   }
+
if (cmd_buffer->device->dfsm_allowed) {
radeon_emit(cmd_buffer->cs, PKT3(PKT3_EVENT_WRITE, 0, 0));
radeon_emit(cmd_buffer->cs, EVENT_TYPE(V_028A90_BREAK_BATCH) | 
EVENT_INDEX(0));
diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
index 92254bed2e..2b88970986 100644
--- a/src/amd/vulkan/radv_device.c
+++ b/src/amd/vulkan/radv_device.c
@@ -4373,6 +4373,7 @@ VkResult radv_CreateFramebuffer(
 {
RADV_FROM_HANDLE(radv_device, device, _device);
struct radv_framebuffer *framebuffer;
+   unsigned num_bpp64_colorbufs = 0;
 
assert(pCreateInfo->sType == VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO);
 
@@ -4393,6 +4394,9 @@ VkResult radv_CreateFramebuffer(
framebuffer->attachments[i].attachment = iview;
if (iview->aspect_mask & VK_IMAGE_ASPECT_COLOR_BIT) {
radv_initialise_color_surface(device, 
&framebuffer->attachments[i].cb, iview);
+
+   if (iview->image->surface.bpe >= 8)
+   num_bpp64_colorbufs++;
} else if (iview->aspect_mask & (VK_IMAGE_ASPECT_DEPTH_BIT | 
VK_IMAGE_ASPECT_STENCIL_BIT)) {
radv_initialise_ds_surface(device, 
&framebuffer->attachments[i].ds, iview);
}
@@ -4401,6 +4405,14 @@ VkResult radv_CreateFramebuffer(
framebuffer->layers = MIN2(framebuffer->layers, 
radv_surface_max_layer_count(iview));
}
 
+   /* For optimal DCC performance. */
+   if (device->physical_device->rad_info.chip_class == VI)
+   framebuffer->dcc_overwrite_combiner_watermark = 4;
+   else if (num_bpp64_colorbufs >= 5)
+   framebuffer->dcc_overwrite_combiner_watermark = 8;
+   else
+   framebuffer->dcc_overwrite_combiner_watermark = 6;
+
*pFramebuffer = radv_framebuffer_to_handle(framebuffer);
return VK_SUCCESS;
 }
diff --git a/src/amd/vulkan/radv_private.h b/src/amd/vulkan/radv_private.h
index 1628be1002..dc7372df76 100644
--- a/src/amd/vulkan/radv_private.h
+++ b/src/amd/vulkan/radv_private.h
@@ -1772,6 +1772,8 @@ struct radv_framebuffer {
uint32_t height;
uint32_t layers;
 
+   uint8_t dcc_overwrite_combiner_watermark;
+
uint32_t attachment_count;
struct radv_attachment_info  attachments[0];
 };
diff --git a/src/amd/vulkan/si_cmd_buffer.c b/src/amd/vulkan/si_cmd_buffer.c
index be37191306..7a0f4e914d 100644
--- a/src/amd/vulkan/si_cmd_buffer.c
+++ b/src/amd/vulkan/si_cmd_buffer.c
@@ -306,9 +306,6 @@ si_emit_graphics(struct radv_physical_device 
*physical_device,
 
if (physical_device->rad_info.chip_class >= VI) {
uint32_t vgt_tess_distribution;
-   radeon_set_context_reg(cs, R_028424_CB_DCC_CONTROL,
-  
S_028424_OVERWRITE_COMBINER_MRT_SHARING_DISABLE(1) |
-  
S_028424_OVERWRITE_COMBINER_WATERMARK(4));
 
vgt_tess_distribution = S_028B50_ACCUM_ISOLINE(32) |
S_028B50_ACCUM_TRI(11) |
-- 
2.19.1

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


Re: [Mesa-dev] [PATCH] gallivm: fix improper clamping of vertex index when fetching gs inputs

2018-11-08 Thread Jose Fonseca

Good find.

On 08/11/2018 01:54, srol...@vmware.com wrote:

From: Roland Scheidegger 

Because we only have one file_max for the (2d) gs input file, the value
actually represents the max of attrib and vertex index (although I'm
not entirely sure if we really want the max, since the max valid value
of the vertex dimension can be easily deduced from the input primitive).


Yes, perhaps we should have a 2nd file_max array for the 2nd axis.   But 
it would be a more invasive change.



Thus in cases where the number of inputs is higher than the number of
vertices per prim, we did not properly clamp the vertex index, which
would result in out-of-bound fetches, potentially causing segfaults
(the segfaults seemed actually difficult to trigger, but valgrind
certainly wasn't happy). This might have happened even if the shader
did not actually try to fetch bogus vertices, if the fetching happened
in non-active conditional clauses.

To fix simply use the correct max vertex index value (derived from
the input prim type) instead when clamping for this case.
---
  .../auxiliary/gallivm/lp_bld_tgsi_soa.c   | 38 ++-
  1 file changed, 28 insertions(+), 10 deletions(-)

diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c 
b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
index 83d7dbea9a..0db81b31ad 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
@@ -41,6 +41,7 @@
  #include "util/u_debug.h"
  #include "util/u_math.h"
  #include "util/u_memory.h"
+#include "util/u_prim.h"
  #include "tgsi/tgsi_dump.h"
  #include "tgsi/tgsi_exec.h"
  #include "tgsi/tgsi_info.h"
@@ -1059,7 +1060,8 @@ emit_mask_scatter(struct lp_build_tgsi_soa_context *bld,
  static LLVMValueRef
  get_indirect_index(struct lp_build_tgsi_soa_context *bld,
 unsigned reg_file, unsigned reg_index,
-   const struct tgsi_ind_register *indirect_reg)
+   const struct tgsi_ind_register *indirect_reg,
+   unsigned index_limit)


file_max array is signed, so let's make index_limit also signed, and 
assert here in this function that it is positive.  This would trap if 
some caller gets the limit for the wrong file.


Which reminds me -- SM4 allows to declare constant buffers with 
undeclared size.  What exactly would we get passed here in those 
circunstances?  In practice constant buffers can't be larger than 64KB, 
which means we could presume filemax is 4K registers.



  {
 LLVMBuilderRef builder = bld->bld_base.base.gallivm->builder;
 struct lp_build_context *uint_bld = &bld->bld_base.uint_bld;
@@ -1107,8 +1109,7 @@ get_indirect_index(struct lp_build_tgsi_soa_context *bld,
  */
 if (reg_file != TGSI_FILE_CONSTANT) {
max_index = lp_build_const_int_vec(bld->bld_base.base.gallivm,
- uint_bld->type,
- 
bld->bld_base.info->file_max[reg_file]);
+ uint_bld->type, index_limit);
  
assert(!uint_bld->type.sign);

index = lp_build_min(uint_bld, index, max_index);
@@ -1224,7 +1225,8 @@ emit_fetch_constant(
indirect_index = get_indirect_index(bld,
reg->Register.File,
reg->Register.Index,
-  ®->Indirect);
+  ®->Indirect,
+  
bld->bld_base.info->file_max[reg->Register.File]);
  
/* All fetches are from the same constant buffer, so

 * we need to propagate the size to a vector to do a
@@ -1341,7 +1343,8 @@ emit_fetch_immediate(
   indirect_index = get_indirect_index(bld,
   reg->Register.File,
   reg->Register.Index,
- ®->Indirect);
+ ®->Indirect,
+ 
bld->bld_base.info->file_max[reg->Register.File]);
   /*
* Unlike for other reg classes, adding pixel offsets is unnecessary 
-
* immediates are stored as full vectors (FIXME??? - might be better
@@ -1414,7 +1417,8 @@ emit_fetch_input(
indirect_index = get_indirect_index(bld,
reg->Register.File,
reg->Register.Index,
-  ®->Indirect);
+  ®->Indirect,
+  
bld->bld_base.info->file_max[reg->Register.File]);
  
index_vec = get_soa_array_offsets(&bld_base->uint_bld,

  indirect_index,
@@ -1502,7 +1506,15 @@ emit_fetch_gs_input(
attrib_index = get_indirect_index(bld,
 

Re: [Mesa-dev] [PATCH 3/3] docs: document the staging branch and add reference to it

2018-11-08 Thread Emil Velikov
On Thu, 8 Nov 2018 at 11:54, Juan A. Suarez Romero  wrote:
>
> On Wed, 2018-11-07 at 16:02 +, Emil Velikov wrote:
> > From: Emil Velikov 
> >
> > A while back we agreed that having a live/staging branch is beneficial.
> > Sadly we forgot to document that, so here is my first attempt.
> >
> > Document the caveat that the branch history is not stable.
> >
> > CC: Andres Gomez 
> > CC: Dylan Baker 
> > CC: Juan A. Suarez Romero 
> > Signed-off-by: Emil Velikov 
> > ---
> >  docs/releasing.html | 20 
> >  docs/submittingpatches.html |  3 +++
> >  2 files changed, 23 insertions(+)
> >
> > diff --git a/docs/releasing.html b/docs/releasing.html
> > index 87590b19301..8ebc2953366 100644
> > --- a/docs/releasing.html
> > +++ b/docs/releasing.html
> > @@ -21,6 +21,7 @@
> >  Overview
> >  Release schedule
> >  Cherry-pick and test
> > +Staging branch
> >  Making a branchpoint
> >  Pre-release announcement
> >  Making a new release
> > @@ -212,6 +213,25 @@ system and making some every day's use until the 
> > release may be a good
> >  idea too.
> >  
> >
> > +Staging branch
> > +
> > +
> > +A live branch, which contains the currently merge/rejected patches is 
> > available
> > +in the main repository under staging/X.Y. For example:
> > +
> > +
> > + staging/18.1 - WIP branch for the 18.1 series
> > + staging/18.2 - WIP branch for the 18.2 series
> > +
> > +
> > +
> > +Notes:
> > +
> > +
> > +People are encouraged to test the branch and report regressions.
>
> I'd say "people are encouraged to test the staging branch and report
> regressions."
>
Ack.

> > +The branch history is not stable and it will be 
> > rebased,
>
> I'd say it "could be rebased", rather than "will be rebased".
>
I'd rather keep the explicit and bold will. It makes it clear and
obvious that basing work on top of the branch is a bad idea.
Even if it doesn't get rebased that often.

>
> With the above changes, the series is:
>
> Reviewed-by: Juan A. Suarez 
>
Thanks. Let me know if you're OK with my reply on the latter suggestion.

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


Re: [Mesa-dev] [PATCH 2/4] bin/get-pick-list.sh: prefix output with "[stable] "

2018-11-08 Thread Emil Velikov
On Thu, 8 Nov 2018 at 12:20, Juan A. Suarez Romero  wrote:
>
> On Wed, 2018-11-07 at 12:07 +, Emil Velikov wrote:
> > From: Emil Velikov 
> >
> > With later commits we'll fold all the different scripts into one.
> > Add the explicit prefix, so that we know the origin of the nomination
> >
> > Signed-off-by: Emil Velikov 
> > ---
> >  bin/get-pick-list.sh | 21 -
> >  1 file changed, 20 insertions(+), 1 deletion(-)
> >
> > diff --git a/bin/get-pick-list.sh b/bin/get-pick-list.sh
> > index ba741cc4114..33a8a4cba48 100755
> > --- a/bin/get-pick-list.sh
> > +++ b/bin/get-pick-list.sh
> > @@ -7,6 +7,15 @@
> >  # $ bin/get-pick-list.sh
> >  # $ bin/get-pick-list.sh > picklist
> >  # $ bin/get-pick-list.sh | tee picklist
> > +#
> > +# The output is as follows:
> > +# [nominaiton_type] commit_sha commit summary
> > +
> > +is_stable_nomination()
> > +{
> > + stable=`git show --summary $sha | grep -i -o "CC:.*mesa-stable"`
> > + return $?
> > +}
> >
> >  # Use the last branchpoint as our limit for the search
> >  latest_branchpoint=`git merge-base origin/master HEAD`
> > @@ -32,7 +41,17 @@ do
> >   continue
> >   fi
> >
> > - git --no-pager show --summary --oneline $sha
> > + tag=none
> > + if is_stable_nomination; then
> > + tag=stable
> > + fi
> > +
> > + if test tag = none; then
> > + continue
> > + fi
>
> This last condition is not working correctly on my system. Anyway, I'd merge 
> it
> with the first one:
>
> if is_stable_nomination; then
> tag=stable
> else
> continue
> fi
>
That's due to the missing $ in tag = none. That aside, explicit else
works for me.

v2 - with a handful of extra patches coming in a moment.

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


Re: [Mesa-dev] [PATCH 3/3] docs: document the staging branch and add reference to it

2018-11-08 Thread Juan A. Suarez Romero
On Thu, 2018-11-08 at 14:48 +, Emil Velikov wrote:
> On Thu, 8 Nov 2018 at 11:54, Juan A. Suarez Romero  
> wrote:
> > On Wed, 2018-11-07 at 16:02 +, Emil Velikov wrote:
> > > From: Emil Velikov 
> > > 
> > > A while back we agreed that having a live/staging branch is beneficial.
> > > Sadly we forgot to document that, so here is my first attempt.
> > > 
> > > Document the caveat that the branch history is not stable.
> > > 
> > > CC: Andres Gomez 
> > > CC: Dylan Baker 
> > > CC: Juan A. Suarez Romero 
> > > Signed-off-by: Emil Velikov 
> > > ---
> > >  docs/releasing.html | 20 
> > >  docs/submittingpatches.html |  3 +++
> > >  2 files changed, 23 insertions(+)
> > > 
> > > diff --git a/docs/releasing.html b/docs/releasing.html
> > > index 87590b19301..8ebc2953366 100644
> > > --- a/docs/releasing.html
> > > +++ b/docs/releasing.html
> > > @@ -21,6 +21,7 @@
> > >  Overview
> > >  Release schedule
> > >  Cherry-pick and test
> > > +Staging branch
> > >  Making a branchpoint
> > >  Pre-release announcement
> > >  Making a new release
> > > @@ -212,6 +213,25 @@ system and making some every day's use until the 
> > > release may be a good
> > >  idea too.
> > >  
> > > 
> > > +Staging branch
> > > +
> > > +
> > > +A live branch, which contains the currently merge/rejected patches is 
> > > available
> > > +in the main repository under staging/X.Y. For example:
> > > +
> > > +
> > > + staging/18.1 - WIP branch for the 18.1 series
> > > + staging/18.2 - WIP branch for the 18.2 series
> > > +
> > > +
> > > +
> > > +Notes:
> > > +
> > > +
> > > +People are encouraged to test the branch and report regressions.
> > 
> > I'd say "people are encouraged to test the staging branch and report
> > regressions."
> > 
> Ack.
> 
> > > +The branch history is not stable and it will be 
> > > rebased,
> > 
> > I'd say it "could be rebased", rather than "will be rebased".
> > 
> I'd rather keep the explicit and bold will. It makes it clear and
> obvious that basing work on top of the branch is a bad idea.
> Even if it doesn't get rebased that often.
> 

That's why I suggest to change "will" by "could". In both cases means that
basing work on top is not a good idea. But "could" explicitly states that it is
up to us to rebase or not; sometimes we will rebase, other times we won't.

> > With the above changes, the series is:
> > 
> > Reviewed-by: Juan A. Suarez 
> > 
> Thanks. Let me know if you're OK with my reply on the latter suggestion.

As it is a minor issue, I'm OK if you still want to go ahead with your
suggestion. 


> 
> -Emil
> 

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


[Mesa-dev] [PATCH 2/9] bin/get-pick-list.sh: prefix output with "[stable] "

2018-11-08 Thread Emil Velikov
From: Emil Velikov 

With later commits we'll fold all the different scripts into one.
Add the explicit prefix, so that we know the origin of the nomination

v2:
 - pass the sha as argument to the function
 - drop $tag = none an else statment (Juan)
 - grep -q instead of using a variable (Eric)
 - print the tag and commit oneline separately (Eric)

Signed-off-by: Emil Velikov 
Reviewed-by: Eric Engestrom 
---
 bin/get-pick-list.sh | 16 
 1 file changed, 16 insertions(+)

diff --git a/bin/get-pick-list.sh b/bin/get-pick-list.sh
index ba741cc4114..6ab2a54dd4c 100755
--- a/bin/get-pick-list.sh
+++ b/bin/get-pick-list.sh
@@ -7,6 +7,14 @@
 # $ bin/get-pick-list.sh
 # $ bin/get-pick-list.sh > picklist
 # $ bin/get-pick-list.sh | tee picklist
+#
+# The output is as follows:
+# [nominaiton_type] commit_sha commit summary
+
+is_stable_nomination()
+{
+   git show --summary "$1" | grep -q -i -o "CC:.*mesa-stable"
+}
 
 # Use the last branchpoint as our limit for the search
 latest_branchpoint=`git merge-base origin/master HEAD`
@@ -32,6 +40,14 @@ do
continue
fi
 
+   tag=none
+   if is_stable_nomination "$sha"; then
+   tag=stable
+   else
+   continue
+   fi
+
+   printf "[ %8s ] " "$tag"
git --no-pager show --summary --oneline $sha
 done
 
-- 
2.19.1

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


[Mesa-dev] [PATCH 6/9] bin/get-pick-list.sh: flesh out is_sha_nomination

2018-11-08 Thread Emil Velikov
From: Emil Velikov 

Refactor is_fixes_nomination into a is_sha_nomination helper. This way
we can reuse it for more than the usual "Fixes:" tag.

Signed-off-by: Emil Velikov 
---
 bin/get-pick-list.sh | 11 +--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/bin/get-pick-list.sh b/bin/get-pick-list.sh
index 8f32b284128..1aeb64fe889 100755
--- a/bin/get-pick-list.sh
+++ b/bin/get-pick-list.sh
@@ -21,10 +21,12 @@ is_typod_nomination()
git show --summary "$1" | grep -q -i -o "CC:.*mesa-dev"
 }
 
-is_fixes_nomination()
+# Helper to handle various mistypos of the fixes tag.
+# The tag string itself is passed as argument and normalised within.
+is_sha_nomination()
 {
fixes=`git show --pretty=medium -s $1 | tr -d "\n" | \
-   sed -e 's/fixes:[[:space:]]*/\nfixes:/Ig' | \
+   sed -e 's/'"$2"'/\nfixes:/Ig' | \
grep -Eo 'fixes:[a-f0-9]{8,40}'`
 
fixes_count=`echo "$fixes" | wc -l`
@@ -55,6 +57,11 @@ is_fixes_nomination()
return 1
 }
 
+is_fixes_nomination()
+{
+   is_sha_nomination "$1" "fixes:[[:space:]]*"
+}
+
 # Use the last branchpoint as our limit for the search
 latest_branchpoint=`git merge-base origin/master HEAD`
 
-- 
2.19.1

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


[Mesa-dev] [PATCH 7/9] bin/get-pick-list.sh: handle fixes tag with missing colon

2018-11-08 Thread Emil Velikov
From: Emil Velikov 

Every so often, we forget to add the colon after "fixes". Trivially
tweak the script to catch it.

Signed-off-by: Emil Velikov 
---
 bin/get-pick-list.sh | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/bin/get-pick-list.sh b/bin/get-pick-list.sh
index 1aeb64fe889..65f35506d5b 100755
--- a/bin/get-pick-list.sh
+++ b/bin/get-pick-list.sh
@@ -60,6 +60,10 @@ is_sha_nomination()
 is_fixes_nomination()
 {
is_sha_nomination "$1" "fixes:[[:space:]]*"
+   if test $? -eq 0; then
+   return 0
+   fi
+   is_sha_nomination "$1" "fixes[[:space:]]\+"
 }
 
 # Use the last branchpoint as our limit for the search
@@ -74,7 +78,7 @@ git log --reverse --pretty=medium --grep="cherry picked from 
commit" $latest_bra
sed -e 's/^[[:space:]]*(cherry picked from commit[[:space:]]*//' -e 
's/)//' > already_picked
 
 # Grep for potential candidates
-git log --reverse --pretty=%H -i 
--grep='^CC:.*mesa-stable\|^CC:.*mesa-dev\|fixes:' 
$latest_branchpoint..origin/master |\
+git log --reverse --pretty=%H -i 
--grep='^CC:.*mesa-stable\|^CC:.*mesa-dev\|\' 
$latest_branchpoint..origin/master |\
 while read sha
 do
# Check to see whether the patch is on the ignore list.
-- 
2.19.1

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


[Mesa-dev] [PATCH 5/9] bin/get-pick-list.sh: tweak the commit sha matching pattern

2018-11-08 Thread Emil Velikov
From: Emil Velikov 

Currently we match on:
 - any arbitrary length of,
 - any a-z A-Z and 0-9 characters

At the same time, a commit sha consists of lowercase hexadecimal
numbers. Any sha shorter than 8 characters is ambiguous - in some cases
even 11+ are required.

So change the pattern to a-f0-9 and adjust the length to 8-40.

As we're here we could use a single grep, instead of the grep/sed combo.

Signed-off-by: Emil Velikov 
---
 bin/get-pick-list.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/get-pick-list.sh b/bin/get-pick-list.sh
index 851147801c4..8f32b284128 100755
--- a/bin/get-pick-list.sh
+++ b/bin/get-pick-list.sh
@@ -25,7 +25,7 @@ is_fixes_nomination()
 {
fixes=`git show --pretty=medium -s $1 | tr -d "\n" | \
sed -e 's/fixes:[[:space:]]*/\nfixes:/Ig' | \
-   grep "fixes:" | sed -e 's/\(fixes:[a-zA-Z0-9]*\).*$/\1/'`
+   grep -Eo 'fixes:[a-f0-9]{8,40}'`
 
fixes_count=`echo "$fixes" | wc -l`
if [ $fixes_count -eq 0 ] ; then
-- 
2.19.1

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


[Mesa-dev] [PATCH 9/9] bin/get-pick-list.sh: use test instead of [ ]

2018-11-08 Thread Emil Velikov
From: Emil Velikov 

Latter is rather picky wrt surrounding white space. The explicit `test`
doesn't have that problem, plus the statements read a bit easier.

Signed-off-by: Emil Velikov 
---
 bin/get-pick-list.sh | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/bin/get-pick-list.sh b/bin/get-pick-list.sh
index 5a6707e64dd..354e6d4003d 100755
--- a/bin/get-pick-list.sh
+++ b/bin/get-pick-list.sh
@@ -30,10 +30,10 @@ is_sha_nomination()
grep -Eo 'fixes:[a-f0-9]{8,40}'`
 
fixes_count=`echo "$fixes" | wc -l`
-   if [ $fixes_count -eq 0 ] ; then
+   if test $fixes_count -eq 0; then
return 0
fi
-   while [ $fixes_count -gt 0 ] ; do
+   while test $fixes_count -gt 0; do
# Treat only the current line
id=`echo "$fixes" | tail -n $fixes_count | head -n 1 | cut -d : 
-f 2`
fixes_count=$(($fixes_count-1))
@@ -41,7 +41,7 @@ is_sha_nomination()
# Bail out if we cannot find suitable id.
# Any specific validation the $id is valid and not some junk, is
# implied with the follow up code
-   if [ "x$id" = x ] ; then
+   if test "x$id" = x; then
continue
fi
 
@@ -87,7 +87,7 @@ git log --reverse --pretty=%H -i 
--grep='^CC:.*mesa-stable\|^CC:.*mesa-dev\|\https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 4/9] bin/get-pick-list.sh: handle the fixes tag

2018-11-08 Thread Emil Velikov
From: Emil Velikov 

Having a separate script to handle the fixes tag, brings a number of
issues, so let's fold it in get-pick-list.sh.

v2:
 - pass the sha as argument to the function
 - Keep original sed pattern

Signed-off-by: Emil Velikov 
---
 bin/get-fixes-pick-list.sh | 81 --
 bin/get-pick-list.sh   | 46 --
 2 files changed, 43 insertions(+), 84 deletions(-)
 delete mode 100755 bin/get-fixes-pick-list.sh

diff --git a/bin/get-fixes-pick-list.sh b/bin/get-fixes-pick-list.sh
deleted file mode 100755
index 047ea3bec10..000
--- a/bin/get-fixes-pick-list.sh
+++ /dev/null
@@ -1,81 +0,0 @@
-#!/bin/sh
-
-# Script for generating a list of candidates [referenced by a Fixes tag] for
-# cherry-picking to a stable branch
-#
-# Usage examples:
-#
-# $ bin/get-fixes-pick-list.sh
-# $ bin/get-fixes-pick-list.sh > picklist
-# $ bin/get-fixes-pick-list.sh | tee picklist
-
-# Use the last branchpoint as our limit for the search
-latest_branchpoint=`git merge-base origin/master HEAD`
-
-# List all the commits between day 1 and the branch point...
-git log --reverse --pretty=%H $latest_branchpoint > already_landed
-
-# ... and the ones cherry-picked.
-git log --reverse --pretty=medium --grep="cherry picked from commit" 
$latest_branchpoint..HEAD |\
-   grep "cherry picked from commit" |\
-   sed -e 's/^[[:space:]]*(cherry picked from commit[[:space:]]*//' -e 
's/)//'  > already_picked
-
-# Grep for commits with Fixes tag
-git log --reverse --pretty=%H -i --grep="fixes:" 
$latest_branchpoint..origin/master |\
-while read sha
-do
-   # Check to see whether the patch is on the ignore list ...
-   if [ -f bin/.cherry-ignore ] ; then
-   if grep -q ^$sha bin/.cherry-ignore ; then
-   continue
-   fi
-   fi
-
-   # Skip if it has been already cherry-picked.
-   if grep -q ^$sha already_picked ; then
-   continue
-   fi
-
-   # Place every "fixes:" tag on its own line and join with the next word
-   # on its line or a later one.
-   fixes=`git show --pretty=medium -s $sha | tr -d "\n" | sed -e 
's/fixes:[[:space:]]*/\nfixes:/Ig' | grep "fixes:" | sed -e 
's/\(fixes:[a-zA-Z0-9]*\).*$/\1/'`
-
-   # For each one try to extract the tag
-   fixes_count=`echo "$fixes" | wc -l`
-   warn=`(test $fixes_count -gt 1 && echo $fixes_count) || echo 0`
-   while [ $fixes_count -gt 0 ] ; do
-   # Treat only the current line
-   id=`echo "$fixes" | tail -n $fixes_count | head -n 1 | cut -d : 
-f 2`
-   fixes_count=$(($fixes_count-1))
-
-   # Bail out if we cannot find suitable id.
-   # Any specific validation the $id is valid and not some junk, is
-   # implied with the follow up code
-   if [ "x$id" = x ] ; then
-   continue
-   fi
-
-   # Check if the offending commit is in branch.
-
-   # Be that cherry-picked ...
-   # ... or landed before the branchpoint.
-   if grep -q ^$id already_picked ||
-  grep -q ^$id already_landed ; then
-
-   printf "Commit \"%s\" fixes %s\n" \
-  "`git log -n1 --pretty=oneline $sha`" \
-  "$id"
-   warn=$(($warn-1))
-   fi
-
-   done
-
-   if [ $warn -gt 0 ] ; then
-   printf "WARNING: Commit \"%s\" has more than one Fixes tag\n" \
-  "`git log -n1 --pretty=oneline $sha`"
-   fi
-
-done
-
-rm -f already_picked
-rm -f already_landed
diff --git a/bin/get-pick-list.sh b/bin/get-pick-list.sh
index 93eefdfc3d8..851147801c4 100755
--- a/bin/get-pick-list.sh
+++ b/bin/get-pick-list.sh
@@ -21,16 +21,53 @@ is_typod_nomination()
git show --summary "$1" | grep -q -i -o "CC:.*mesa-dev"
 }
 
+is_fixes_nomination()
+{
+   fixes=`git show --pretty=medium -s $1 | tr -d "\n" | \
+   sed -e 's/fixes:[[:space:]]*/\nfixes:/Ig' | \
+   grep "fixes:" | sed -e 's/\(fixes:[a-zA-Z0-9]*\).*$/\1/'`
+
+   fixes_count=`echo "$fixes" | wc -l`
+   if [ $fixes_count -eq 0 ] ; then
+   return 0
+   fi
+   while [ $fixes_count -gt 0 ] ; do
+   # Treat only the current line
+   id=`echo "$fixes" | tail -n $fixes_count | head -n 1 | cut -d : 
-f 2`
+   fixes_count=$(($fixes_count-1))
+
+   # Bail out if we cannot find suitable id.
+   # Any specific validation the $id is valid and not some junk, is
+   # implied with the follow up code
+   if [ "x$id" = x ] ; then
+   continue
+   fi
+
+   #Check if the offending commit is in branch.
+
+   # Be that cherry-picked ...
+   # ... or landed before the branchpoint.
+   i

[Mesa-dev] [PATCH 3/9] bin/get-pick-list.sh: handle "typod" usecase.

2018-11-08 Thread Emil Velikov
From: Emil Velikov 

As the comment in get-typod-pick-list.sh says, there's little point in
having a duplicate file.

Add the new pattern + tag to get-pick-list.sh and nuke this file.

v2:
 - pass the sha as argument to the function
 - grep -q instead of using a variable (Eric)

Signed-off-by: Emil Velikov 
Reviewed-by: Eric Engestrom 
---
 bin/get-pick-list.sh   |  9 +++-
 bin/get-typod-pick-list.sh | 42 --
 2 files changed, 8 insertions(+), 43 deletions(-)
 delete mode 100755 bin/get-typod-pick-list.sh

diff --git a/bin/get-pick-list.sh b/bin/get-pick-list.sh
index 6ab2a54dd4c..93eefdfc3d8 100755
--- a/bin/get-pick-list.sh
+++ b/bin/get-pick-list.sh
@@ -16,6 +16,11 @@ is_stable_nomination()
git show --summary "$1" | grep -q -i -o "CC:.*mesa-stable"
 }
 
+is_typod_nomination()
+{
+   git show --summary "$1" | grep -q -i -o "CC:.*mesa-dev"
+}
+
 # Use the last branchpoint as our limit for the search
 latest_branchpoint=`git merge-base origin/master HEAD`
 
@@ -25,7 +30,7 @@ git log --reverse --pretty=medium --grep="cherry picked from 
commit" $latest_bra
sed -e 's/^[[:space:]]*(cherry picked from commit[[:space:]]*//' -e 
's/)//' > already_picked
 
 # Grep for commits that were marked as a candidate for the stable tree.
-git log --reverse --pretty=%H -i --grep='^CC:.*mesa-stable' 
$latest_branchpoint..origin/master |\
+git log --reverse --pretty=%H -i --grep='^CC:.*mesa-stable\|^CC:.*mesa-dev' 
$latest_branchpoint..origin/master |\
 while read sha
 do
# Check to see whether the patch is on the ignore list.
@@ -43,6 +48,8 @@ do
tag=none
if is_stable_nomination "$sha"; then
tag=stable
+   elif is_typod_nomination "$sha"; then
+   tag=typod
else
continue
fi
diff --git a/bin/get-typod-pick-list.sh b/bin/get-typod-pick-list.sh
deleted file mode 100755
index eb4181d66b8..000
--- a/bin/get-typod-pick-list.sh
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/bin/sh
-
-# Script for generating a list of candidates which have typos in the 
nomination line
-#
-# Usage examples:
-#
-# $ bin/get-typod-pick-list.sh
-# $ bin/get-typod-pick-list.sh > picklist
-# $ bin/get-typod-pick-list.sh | tee picklist
-
-# NB:
-# This script intentionally _never_ checks for specific version tag
-# Should we consider folding it with the original get-pick-list.sh
-
-# Use the last branchpoint as our limit for the search
-latest_branchpoint=`git merge-base origin/master HEAD`
-
-# Grep for commits with "cherry picked from commit" in the commit message.
-git log --reverse --grep="cherry picked from commit" $latest_branchpoint..HEAD 
|\
-   grep "cherry picked from commit" |\
-   sed -e 's/^[[:space:]]*(cherry picked from commit[[:space:]]*//' -e 
's/)//' > already_picked
-
-# Grep for commits that were marked as a candidate for the stable tree.
-git log --reverse --pretty=%H -i --grep='^CC:.*mesa-dev' 
$latest_branchpoint..origin/master |\
-while read sha
-do
-   # Check to see whether the patch is on the ignore list.
-   if [ -f bin/.cherry-ignore ] ; then
-   if grep -q ^$sha bin/.cherry-ignore ; then
-   continue
-   fi
-   fi
-
-   # Check to see if it has already been picked over.
-   if grep -q ^$sha already_picked ; then
-   continue
-   fi
-
-   git log -n1 --pretty=oneline $sha | cat
-done
-
-rm -f already_picked
-- 
2.19.1

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


[Mesa-dev] [PATCH 0/9] Enhance the get-pick-list.sh script

2018-11-08 Thread Emil Velikov
Hi all,

This is a v2 of the earlier series "Fold typod/fixes scripts within
get-pick-list.sh" with updates, few tweaks and extra typos/mistakes
that we've been doing.


Patches 1-4: original (with comments addressed) and $sha passed as
argument to the functions
Patch 5: fixups the sed pattern to catch only what we want
Patches 6-8: handles fixes (w/o colon) and "broken by"
Patch 9: swaps [ ] with explicit test


Note: We'd want the whole series in stable as well, even if I haven't
explicitly annotated it. Patches 6-8 catch a few extra bits we'd want.

Input and testing is appreciated.
-Emil

CC: Andres Gomez 
CC: Dylan Baker 
CC: Juan A. Suarez Romero 


Emil Velikov (9):
  bin/get-pick-list.sh: simplify git oneline printing
  bin/get-pick-list.sh: prefix output with "[stable] "
  bin/get-pick-list.sh: handle "typod" usecase.
  bin/get-pick-list.sh: handle the fixes tag
  bin/get-pick-list.sh: tweak the commit sha matching pattern
  bin/get-pick-list.sh: flesh out is_sha_nomination
  bin/get-pick-list.sh: handle fixes tag with missing colon
  bin/get-pick-list.sh: handle unofficial "broken by" tag
  bin/get-pick-list.sh: use test instead of [ ]

 bin/get-fixes-pick-list.sh | 81 -
 bin/get-pick-list.sh   | 91 +++---
 bin/get-typod-pick-list.sh | 42 --
 3 files changed, 86 insertions(+), 128 deletions(-)
 delete mode 100755 bin/get-fixes-pick-list.sh
 delete mode 100755 bin/get-typod-pick-list.sh

-- 
2.19.1

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


[Mesa-dev] [PATCH 8/9] bin/get-pick-list.sh: handle unofficial "broken by" tag

2018-11-08 Thread Emil Velikov
From: Emil Velikov 

We have a number of cases were devs will use a tag "broken by".
While it's not something officially documented or recommended, checking
for it is trivial enough.

Signed-off-by: Emil Velikov 
---
 bin/get-pick-list.sh | 9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/bin/get-pick-list.sh b/bin/get-pick-list.sh
index 65f35506d5b..5a6707e64dd 100755
--- a/bin/get-pick-list.sh
+++ b/bin/get-pick-list.sh
@@ -66,6 +66,11 @@ is_fixes_nomination()
is_sha_nomination "$1" "fixes[[:space:]]\+"
 }
 
+is_brokenby_nomination()
+{
+   is_sha_nomination "$1" "broken by"
+}
+
 # Use the last branchpoint as our limit for the search
 latest_branchpoint=`git merge-base origin/master HEAD`
 
@@ -78,7 +83,7 @@ git log --reverse --pretty=medium --grep="cherry picked from 
commit" $latest_bra
sed -e 's/^[[:space:]]*(cherry picked from commit[[:space:]]*//' -e 
's/)//' > already_picked
 
 # Grep for potential candidates
-git log --reverse --pretty=%H -i 
--grep='^CC:.*mesa-stable\|^CC:.*mesa-dev\|\' 
$latest_branchpoint..origin/master |\
+git log --reverse --pretty=%H -i 
--grep='^CC:.*mesa-stable\|^CC:.*mesa-dev\|\\|\' 
$latest_branchpoint..origin/master |\
 while read sha
 do
# Check to see whether the patch is on the ignore list.
@@ -100,6 +105,8 @@ do
tag=typod
elif is_fixes_nomination "$sha"; then
tag=fixes
+   elif is_brokenby_nomination "$sha"; then
+   tag=brokenby
else
continue
fi
-- 
2.19.1

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


[Mesa-dev] [PATCH 1/9] bin/get-pick-list.sh: simplify git oneline printing

2018-11-08 Thread Emil Velikov
From: Emil Velikov 

Currently we force disable the pager via "|cat" where --no-pager
exists. Additionally we could use git show instead of git log -n1.

Use those for a slightly more understandable code.

Signed-off-by: Emil Velikov 
Reviewed-by: Eric Engestrom 
---
 bin/get-pick-list.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/get-pick-list.sh b/bin/get-pick-list.sh
index 9e9a39e494b..ba741cc4114 100755
--- a/bin/get-pick-list.sh
+++ b/bin/get-pick-list.sh
@@ -32,7 +32,7 @@ do
continue
fi
 
-   git log -n1 --pretty=oneline $sha | cat
+   git --no-pager show --summary --oneline $sha
 done
 
 rm -f already_picked
-- 
2.19.1

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


[Mesa-dev] [PATCH] radv: include LLVM IR in the VK_AMD_shader_info "disassembly"

2018-11-08 Thread Nicolai Hähnle
From: Nicolai Hähnle 

Helpful for debugging compiler backend problems: this allows us to
easily retrieve the LLVM IR from RenderDoc.
--
For the peanut gallery: AMD's official stance on radv hasn't changed.
But we take regressions for radv caused by our changes in LLVM seriously.
After all, they might just as well affect anything else using the same
compiler backend...
---
 src/amd/vulkan/radv_shader.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c
index f98ca6b4edd..1c51297d202 100644
--- a/src/amd/vulkan/radv_shader.c
+++ b/src/amd/vulkan/radv_shader.c
@@ -855,20 +855,21 @@ radv_GetShaderInfoAMD(VkDevice _device,
result = VK_INCOMPLETE;
}
 
break;
case VK_SHADER_INFO_TYPE_DISASSEMBLY_AMD:
buf = _mesa_string_buffer_create(NULL, 1024);
 
_mesa_string_buffer_printf(buf, "%s:\n", 
radv_get_shader_name(variant, stage));
_mesa_string_buffer_printf(buf, "%s\n\n", 
variant->disasm_string);
generate_shader_stats(device, variant, stage, buf);
+   _mesa_string_buffer_printf(buf, "\n\n%s\n\n", 
variant->llvm_ir_string);
 
/* Need to include the null terminator. */
size_t length = buf->length + 1;
 
if (!pInfo) {
*pInfoSize = length;
} else {
size_t size = *pInfoSize;
*pInfoSize = length;
 
-- 
2.19.1

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


[Mesa-dev] [PATCH v4 01/10] intel/genxml: Add engine definition to render engine instructions (gen4)

2018-11-08 Thread Toni Lönnberg
Instructions meant for the render engine now have a definition specifying that
so that can differentiate instructions meant for different engines due to shared
opcodes.

v2: Divided into individual patches for each gen

v3: Added additional engine definitions.
---
 src/intel/genxml/gen4.xml | 50 +++
 1 file changed, 25 insertions(+), 25 deletions(-)

diff --git a/src/intel/genxml/gen4.xml b/src/intel/genxml/gen4.xml
index cd50a1012bc..ed45ca6744e 100644
--- a/src/intel/genxml/gen4.xml
+++ b/src/intel/genxml/gen4.xml
@@ -602,7 +602,7 @@
 
   
 
-  
+  
 
 
 
@@ -622,7 +622,7 @@
 
   
 
-  
+  
 
 
 
@@ -635,7 +635,7 @@
 
   
 
-  
+  
 
 
 
@@ -647,7 +647,7 @@
 
   
 
-  
+  
 
 
 
@@ -695,7 +695,7 @@
 
   
 
-  
+  
 
 
 
@@ -709,7 +709,7 @@
 
   
 
-  
+  
 
 
 
@@ -718,7 +718,7 @@
 
   
 
-  
+  
 
 
 
@@ -734,7 +734,7 @@
 
   
 
-  
+  
 
 
 
@@ -748,7 +748,7 @@
 
   
 
-  
+  
 
 
 
@@ -764,7 +764,7 @@
 
   
 
-  
+  
 
 
 
@@ -774,7 +774,7 @@
 
   
 
-  
+  
 
 
 
@@ -785,7 +785,7 @@
 
   
 
-  
+  
 
 
 
@@ -796,7 +796,7 @@
 
   
 
-  
+  
 
 
 
@@ -807,7 +807,7 @@
 
   
 
-  
+  
 
 
 
@@ -815,7 +815,7 @@
 
   
 
-  
+  
 
 
 
@@ -825,7 +825,7 @@
 
   
 
-  
+  
 
 
 
@@ -836,7 +836,7 @@
 
   
 
-  
+  
 
 
 
@@ -888,7 +888,7 @@
 
   
 
-  
+  
 
 
 
@@ -911,7 +911,7 @@
 
   
 
-  
+  
 
 
 
@@ -922,7 +922,7 @@
 
   
 
-  
+  
 
 
 
@@ -940,7 +940,7 @@
 
   
 
-  
+  
 
 
 
@@ -969,7 +969,7 @@
 
   
 
-  
+  
 
 
 
@@ -992,7 +992,7 @@
 
   
 
-  
+  
 
 
 
@@ -1018,7 +1018,7 @@
 
   
 
-  
+  
 
 
 
@@ -1045,7 +1045,7 @@
 
   
 
-  
+  
 
 
 
-- 
2.17.1

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


  1   2   >