Re: [Mesa-dev] [PATCH 12/12] anv: implement pipeline statistics queries

2017-03-16 Thread Iago Toral
On Wed, 2017-03-15 at 17:03 -0700, Jason Ekstrand wrote: > From: Ilia Mirkin > > In the end, pipeline statistics queries look a lot like occlusion > queries only with between 1 and 11 begin/end pairs being generated > instead of just the one. > --- >  

Re: [Mesa-dev] [PATCH v3] anv: handle failures when growing reloc lists

2017-03-16 Thread Iago Toral
On Wed, 2017-03-15 at 16:56 +0200, Pohjolainen, Topi wrote: > On Wed, Mar 15, 2017 at 01:03:37PM +0100, Iago Toral Quiroga wrote: > > > > Growing the reloc list happens through calling anv_reloc_list_add() > > or > > anv_reloc_list_append(). Make sure that we cal

Re: [Mesa-dev] [PATCH v2 00/24] anv: Handle out of memory situations better

2017-03-15 Thread Iago Toral
Hi Emil, On Wed, 2017-03-15 at 12:11 +, Emil Velikov wrote: > Hi Iago, > > On 10 March 2017 at 12:38, Iago Toral Quiroga <ito...@igalia.com> > wrote: > > > > > Iago Toral Quiroga (24): > >   anv: remove unnecessary function prototype. > >

Re: [Mesa-dev] [PATCH v2 00/24] anv: Handle out of memory situations better

2017-03-15 Thread Iago Toral
On Wed, 2017-03-15 at 10:47 +0200, Pohjolainen, Topi wrote: > On Tue, Mar 14, 2017 at 02:15:51PM +0100, Iago Toral wrote: > > > > BTW, in case it is useful, I have the series available here, > > including > > fixes to review feedback obtained so far: > > > &

[Mesa-dev] [PATCH v3] anv: handle failures when growing reloc lists

2017-03-15 Thread Iago Toral Quiroga
Growing the reloc list happens through calling anv_reloc_list_add() or anv_reloc_list_append(). Make sure that we call these through helpers that check the result and set the batch error status if needed. v2: - Handling the crashes is not good enough, we need to keep track of the error, for

Re: [Mesa-dev] [PATCH v2 22/24] anv: handle errors while allocating new binding table blocks

2017-03-15 Thread Iago Toral
On Wed, 2017-03-15 at 10:39 +0200, Pohjolainen, Topi wrote: > On Fri, Mar 10, 2017 at 01:38:35PM +0100, Iago Toral Quiroga wrote: > > > > Also, we had a couple of instances in flush_descriptor_sets() were > > we were returning a VkResult directly upon error, but

Re: [Mesa-dev] [PATCH v2 05/24] anv/cmd_buffer: add a status field to anv_batch

2017-03-15 Thread Iago Toral
On Wed, 2017-03-15 at 10:33 +0200, Pohjolainen, Topi wrote: > On Fri, Mar 10, 2017 at 01:38:18PM +0100, Iago Toral Quiroga wrote: > > > > The vkCmd*() functions do not report errors, instead, any errors > > should be > > reported by the time we call vkEndCommandBuffe

Re: [Mesa-dev] [PATCH v2 10/24] anv: handle failures when growing reloc lists

2017-03-15 Thread Iago Toral
On Wed, 2017-03-15 at 09:35 +0200, Pohjolainen, Topi wrote: > On Wed, Mar 15, 2017 at 08:23:35AM +0100, Iago Toral wrote: > > > > On Tue, 2017-03-14 at 16:14 +0200, Pohjolainen, Topi wrote: > > > > > > On Tue, Mar 14, 2017 at 04:02:17PM +02

Re: [Mesa-dev] [PATCH v2 10/24] anv: handle failures when growing reloc lists

2017-03-15 Thread Iago Toral
On Tue, 2017-03-14 at 16:14 +0200, Pohjolainen, Topi wrote: > On Tue, Mar 14, 2017 at 04:02:17PM +0200, Pohjolainen, Topi wrote: > > > > On Tue, Mar 14, 2017 at 02:08:10PM +0100, Iago Toral wrote: > > > > > > On Tue, 2017-03-14 at 14:04 +0200, Pohjolainen, To

Re: [Mesa-dev] [PATCH v2 00/24] anv: Handle out of memory situations better

2017-03-14 Thread Iago Toral
BTW, in case it is useful, I have the series available here, including fixes to review feedback obtained so far: https://github.com/Igalia/mesa/tree/vk-oom Iago On Fri, 2017-03-10 at 13:38 +0100, Iago Toral Quiroga wrote: > I think this series addresses all the issues raised for v1, exc

Re: [Mesa-dev] [PATCH v2 10/24] anv: handle failures when growing reloc lists

2017-03-14 Thread Iago Toral
On Tue, 2017-03-14 at 14:04 +0200, Pohjolainen, Topi wrote: > On Tue, Mar 14, 2017 at 12:06:16PM +0100, Iago Toral wrote: > > > > On Tue, 2017-03-14 at 12:01 +0100, Iago Toral wrote: > > > > > > On Tue, 2017-03-14 at 11:25 +0200, Pohjolainen, Topi wrote: > &g

Re: [Mesa-dev] [PATCH v2 03/24] anv/blorp: return early if we failed to create the shader binary

2017-03-14 Thread Iago Toral
On Tue, 2017-03-14 at 11:53 +0200, Pohjolainen, Topi wrote: > On Tue, Mar 14, 2017 at 10:35:43AM +0100, Iago Toral wrote: > > > > On Tue, 2017-03-14 at 10:12 +0200, Pohjolainen, Topi wrote: > > > > > > On Fri, Mar 10, 2017 at 01:38:16PM +010

Re: [Mesa-dev] [PATCH v2 21/24] anv/blorp: make anv_cmd_buffer_alloc_blorp_binding_table() return a VkResult

2017-03-14 Thread Iago Toral
On Tue, 2017-03-14 at 11:39 +0200, Pohjolainen, Topi wrote: > On Fri, Mar 10, 2017 at 01:38:34PM +0100, Iago Toral Quiroga wrote: > > > > Instead of asserting inside the function, and then use use that > > information > > to return early from its callers upon fail

Re: [Mesa-dev] [PATCH v2 10/24] anv: handle failures when growing reloc lists

2017-03-14 Thread Iago Toral
On Tue, 2017-03-14 at 12:01 +0100, Iago Toral wrote: > On Tue, 2017-03-14 at 11:25 +0200, Pohjolainen, Topi wrote: > > > > On Fri, Mar 10, 2017 at 01:38:23PM +0100, Iago Toral Quiroga wrote: > > > > > > > > > Growing the reloc list happen

Re: [Mesa-dev] [PATCH v2 10/24] anv: handle failures when growing reloc lists

2017-03-14 Thread Iago Toral
On Tue, 2017-03-14 at 11:25 +0200, Pohjolainen, Topi wrote: > On Fri, Mar 10, 2017 at 01:38:23PM +0100, Iago Toral Quiroga wrote: > > > > Growing the reloc list happens through calling anv_reloc_list_add() > > or > > anv_reloc_list_append(). Make sure that we cal

Re: [Mesa-dev] [PATCH v2 02/24] anv: do not try to ref/unref NULL shaders

2017-03-14 Thread Iago Toral
On Tue, 2017-03-14 at 10:22 +0200, Pohjolainen, Topi wrote: > On Fri, Mar 10, 2017 at 01:38:15PM +0100, Iago Toral Quiroga wrote: > > > > This situation can happen if we failed to allocate memory for the > > shader. > > > > v2: > >  - We shouldn't see N

Re: [Mesa-dev] [PATCH v2 03/24] anv/blorp: return early if we failed to create the shader binary

2017-03-14 Thread Iago Toral
On Tue, 2017-03-14 at 10:12 +0200, Pohjolainen, Topi wrote: > On Fri, Mar 10, 2017 at 01:38:16PM +0100, Iago Toral Quiroga wrote: > > > > --- > >  src/intel/vulkan/anv_blorp.c | 3 +++ > >  1 file changed, 3 insertions(+) > > > > diff --git a/src/intel/vu

Re: [Mesa-dev] [PATCH v2 07/24] anv: handle allocation failure in anv_batch_emit_batch()

2017-03-13 Thread Iago Toral
On Mon, 2017-03-13 at 12:07 +0200, Pohjolainen, Topi wrote: > On Fri, Mar 10, 2017 at 01:38:20PM +0100, Iago Toral Quiroga wrote: > > > > Fixes: > > dEQP-VK.api.out_of_host_memory.cmd_execute_commands > > --- > >  src/intel/vulkan/anv_batch_chain.c | 7 +--

Re: [Mesa-dev] [PATCH v2 09/24] anv: avoid crashes when failing to allocate batches

2017-03-13 Thread Iago Toral
On Mon, 2017-03-13 at 11:30 +0200, Pohjolainen, Topi wrote: > On Fri, Mar 10, 2017 at 01:38:22PM +0100, Iago Toral Quiroga wrote: > > > > Most of the time we use macros that handle this situation > > transparently, > > but there are some cases were we nee

Re: [Mesa-dev] [PATCH v2 04/24] anv/cmd_buffer: report errors in vkBeginCommandBuffer()

2017-03-13 Thread Iago Toral
On Mon, 2017-03-13 at 15:16 +0200, Pohjolainen, Topi wrote: > On Mon, Mar 13, 2017 at 11:02:30AM +0100, Iago Toral wrote: > > > > On Mon, 2017-03-13 at 11:59 +0200, Pohjolainen, Topi wrote: > > > > > > On Fri, Mar 10, 2017 at 01:38:17PM +010

[Mesa-dev] [PATCH] intel: fix compiler build

2017-03-13 Thread Iago Toral Quiroga
compiler/brw_vec4_gs_visitor.cpp:744:39: error: ‘GEN7_MAX_GS_OUTPUT_VERTEX_SIZE_BYTES’ was not declared in this scope output_vertex_size_bytes <= GEN7_MAX_GS_OUTPUT_VERTEX_SIZE_BYTES); --- src/intel/compiler/brw_eu_defines.h | 7 +++ src/mesa/drivers/dri/i965/brw_defines.h | 8

Re: [Mesa-dev] [PATCH v2 04/24] anv/cmd_buffer: report errors in vkBeginCommandBuffer()

2017-03-13 Thread Iago Toral
On Mon, 2017-03-13 at 11:59 +0200, Pohjolainen, Topi wrote: > On Fri, Mar 10, 2017 at 01:38:17PM +0100, Iago Toral Quiroga wrote: > > > > --- > >  src/intel/vulkan/genX_cmd_buffer.c | 15 +-- > >  1 file changed, 9 insertions(+), 6 deletions(-) > >

[Mesa-dev] [PATCH v2 21/24] anv/blorp: make anv_cmd_buffer_alloc_blorp_binding_table() return a VkResult

2017-03-10 Thread Iago Toral Quiroga
Instead of asserting inside the function, and then use use that information to return early from its callers upon failure. --- src/intel/vulkan/anv_blorp.c | 35 --- src/intel/vulkan/anv_private.h | 5 +++-- src/intel/vulkan/genX_blorp_exec.c | 8

[Mesa-dev] [PATCH v2 14/24] anv/cmd_buffer: handle allocation errors during vkCmdBeginRenderPass()

2017-03-10 Thread Iago Toral Quiroga
Fixes: dEQP-VK.api.out_of_host_memory.cmd_begin_render_pass --- src/intel/vulkan/genX_cmd_buffer.c | 14 +++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c index efb271e..539e9ea 100644 ---

[Mesa-dev] [PATCH v2 17/24] anv/cmd_buffer: skip vkCmdDraw*() on broken command buffers

2017-03-10 Thread Iago Toral Quiroga
--- src/intel/vulkan/genX_cmd_buffer.c | 12 1 file changed, 12 insertions(+) diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c index 539e9ea..112239c 100644 --- a/src/intel/vulkan/genX_cmd_buffer.c +++ b/src/intel/vulkan/genX_cmd_buffer.c @@

[Mesa-dev] [PATCH v2 23/24] anv: handle errors in emit_binding_table() and emit_samplers()

2017-03-10 Thread Iago Toral Quiroga
These can fail to allocate device memory, however, the driver can recover from this error by allocating a new binding table block and trying again. v2: - Instead of tracking the errors in these functions and making callers reset the batch's status before attempting to allocate a new block

[Mesa-dev] [PATCH v2 11/24] anv/cmd_buffer: report tracked errors in vkEndCommandBuffer()

2017-03-10 Thread Iago Toral Quiroga
--- src/intel/vulkan/genX_cmd_buffer.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c index 61066b8..9ae9de1 100644 --- a/src/intel/vulkan/genX_cmd_buffer.c +++ b/src/intel/vulkan/genX_cmd_buffer.c @@ -618,6 +618,9

[Mesa-dev] [PATCH v2 19/24] anv/cmd_buffer: skip vkCmdExecuteCommands() on broken command buffers

2017-03-10 Thread Iago Toral Quiroga
v2: Assert on secondary commands, applications should've called vkEndCommandBuffer() and received an error for them before. --- src/intel/vulkan/genX_cmd_buffer.c | 4 1 file changed, 4 insertions(+) diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c

[Mesa-dev] [PATCH v2 15/24] anv/cmd_buffer: handle out of memory during vkCmdPushConstants

2017-03-10 Thread Iago Toral Quiroga
Fixes: dEQP-VK.api.out_of_host_memory.cmd_push_constants --- src/intel/vulkan/anv_cmd_buffer.c | 14 +++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/intel/vulkan/anv_cmd_buffer.c b/src/intel/vulkan/anv_cmd_buffer.c index 003a28c..3c9efac 100644 ---

[Mesa-dev] [PATCH v2 20/24] anv/device: assert that commands submitted to a queue are not bogus

2017-03-10 Thread Iago Toral Quiroga
Any errors that may have happened during the command buffer recording are reported by vkEndCommandBuffer() and it is the application's reponsibility to not submit broken commands to a queue. --- src/intel/vulkan/anv_device.c | 1 + 1 file changed, 1 insertion(+) diff --git

[Mesa-dev] [PATCH v2 09/24] anv: avoid crashes when failing to allocate batches

2017-03-10 Thread Iago Toral Quiroga
Most of the time we use macros that handle this situation transparently, but there are some cases were we need to handle this explicitly. This patch makes sure we don't crash, notice that error handling takes place in the function that actually failed the allocation, anv_batch_emit_dwords(),

[Mesa-dev] [PATCH v2 04/24] anv/cmd_buffer: report errors in vkBeginCommandBuffer()

2017-03-10 Thread Iago Toral Quiroga
--- src/intel/vulkan/genX_cmd_buffer.c | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c index 9fdc08b..f74109e 100644 --- a/src/intel/vulkan/genX_cmd_buffer.c +++

[Mesa-dev] [PATCH v2 03/24] anv/blorp: return early if we failed to create the shader binary

2017-03-10 Thread Iago Toral Quiroga
--- src/intel/vulkan/anv_blorp.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/intel/vulkan/anv_blorp.c b/src/intel/vulkan/anv_blorp.c index d79c5e0..c871f03 100644 --- a/src/intel/vulkan/anv_blorp.c +++ b/src/intel/vulkan/anv_blorp.c @@ -72,6 +72,9 @@ upload_blorp_shader(struct

[Mesa-dev] [PATCH v2 16/24] anv: handle memory allocation errors during queue submissions

2017-03-10 Thread Iago Toral Quiroga
--- src/intel/vulkan/anv_batch_chain.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/intel/vulkan/anv_batch_chain.c b/src/intel/vulkan/anv_batch_chain.c index 2add5bd..0dc781c 100644 --- a/src/intel/vulkan/anv_batch_chain.c +++

[Mesa-dev] [PATCH v2 12/24] anv/cmd_buffer: skip vkCmdNextSubpass() for broken command buffers

2017-03-10 Thread Iago Toral Quiroga
--- src/intel/vulkan/genX_cmd_buffer.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c index 9ae9de1..557893b 100644 --- a/src/intel/vulkan/genX_cmd_buffer.c +++ b/src/intel/vulkan/genX_cmd_buffer.c @@ -2489,6 +2489,9

[Mesa-dev] [PATCH v2 22/24] anv: handle errors while allocating new binding table blocks

2017-03-10 Thread Iago Toral Quiroga
Also, we had a couple of instances in flush_descriptor_sets() were we were returning a VkResult directly upon error, but the return value of this function is not a VkResult but a uint32_t dirty mask, so simply return 0 in these cases which reduces the amount of work the driver will do after the

[Mesa-dev] [PATCH v2 24/24] anv: improve error reporting when creating pipelines

2017-03-10 Thread Iago Toral Quiroga
Specifically, report 'out of memory' errors that might have happened while emitting the pipeline's batch. --- src/intel/vulkan/anv_pipeline.c | 1 + src/intel/vulkan/genX_pipeline.c | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/intel/vulkan/anv_pipeline.c

[Mesa-dev] [PATCH v2 10/24] anv: handle failures when growing reloc lists

2017-03-10 Thread Iago Toral Quiroga
Growing the reloc list happens through calling anv_reloc_list_add() or anv_reloc_list_append(). Make sure that we call these through helpers that check the result and set the batch error status if needed. v2: - Handling the crashes is not good enough, we need to keep track of the error, for

[Mesa-dev] [PATCH v2 13/24] anv/cmd_buffer: skip vkCmdEndRenderPass() for broken command buffers

2017-03-10 Thread Iago Toral Quiroga
--- src/intel/vulkan/genX_cmd_buffer.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c index 557893b..efb271e 100644 --- a/src/intel/vulkan/genX_cmd_buffer.c +++ b/src/intel/vulkan/genX_cmd_buffer.c @@ -2508,6 +2508,9

[Mesa-dev] [PATCH v2 06/24] anv: add anv_batch_set_error() and anv_batch_has_error() helpers

2017-03-10 Thread Iago Toral Quiroga
The anv_batch_set_error() helper will track the first error that happened while recording a command buffer. The helper returns the currently tracked error to help the job of internal functions that may generate errors that need to be tracked and return a VkResult to the caller. We will use the

[Mesa-dev] [PATCH v2 18/24] anv/cmd_buffer: skip vkCmdDispatch() on broken command buffers

2017-03-10 Thread Iago Toral Quiroga
--- src/intel/vulkan/genX_cmd_buffer.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c index 112239c..b3f1009 100644 --- a/src/intel/vulkan/genX_cmd_buffer.c +++ b/src/intel/vulkan/genX_cmd_buffer.c @@ -1933,6 +1933,9

[Mesa-dev] [PATCH v2 02/24] anv: do not try to ref/unref NULL shaders

2017-03-10 Thread Iago Toral Quiroga
This situation can happen if we failed to allocate memory for the shader. v2: - We shouldn't see NULL shaders in anv_shader_bin_ref so we should not check for that (Jason). Make sure that callers don't attempt to call this function with a NULL shader and assert that this never happens

[Mesa-dev] [PATCH v2 07/24] anv: handle allocation failure in anv_batch_emit_batch()

2017-03-10 Thread Iago Toral Quiroga
Fixes: dEQP-VK.api.out_of_host_memory.cmd_execute_commands --- src/intel/vulkan/anv_batch_chain.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/intel/vulkan/anv_batch_chain.c b/src/intel/vulkan/anv_batch_chain.c index 3f6039e..1236001 100644 ---

[Mesa-dev] [PATCH v2 05/24] anv/cmd_buffer: add a status field to anv_batch

2017-03-10 Thread Iago Toral Quiroga
The vkCmd*() functions do not report errors, instead, any errors should be reported by the time we call vkEndCommandBuffer(). This means that we need to make the driver robust against incosistent and/or imcomplete command buffer states through the command recording process, particularly, avoid

[Mesa-dev] [PATCH v2 00/24] anv: Handle out of memory situations better

2017-03-10 Thread Iago Toral Quiroga
are closer to each other. Iago Toral Quiroga (24): anv: remove unnecessary function prototype. anv: do not try to ref/unref NULL shaders anv/blorp: return early if we failed to create the shader binary anv/cmd_buffer: report errors in vkBeginCommandBuffer() anv/cmd_buffer: add a st

[Mesa-dev] [PATCH v2 08/24] anv: handle allocation failure in anv_batch_emit_dwords()

2017-03-10 Thread Iago Toral Quiroga
--- src/intel/vulkan/anv_batch_chain.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/intel/vulkan/anv_batch_chain.c b/src/intel/vulkan/anv_batch_chain.c index 1236001..3774172 100644 --- a/src/intel/vulkan/anv_batch_chain.c +++

[Mesa-dev] [PATCH v2 01/24] anv: remove unnecessary function prototype.

2017-03-10 Thread Iago Toral Quiroga
The function is defined right after the prototype declaration. Also, the protoype for it is included in anv_genX.h which is included via anv_private.h. --- src/intel/vulkan/genX_blorp_exec.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/intel/vulkan/genX_blorp_exec.c

Re: [Mesa-dev] [PATCH 2/2] nir: Add support for 8 and 16-bit types

2017-03-10 Thread Iago Toral
On Thu, 2017-03-09 at 14:05 -0800, Jason Ekstrand wrote: > --- >  src/compiler/nir/nir.h   |  4 >  src/compiler/nir/nir_constant_expressions.py | 16 +++- >  src/compiler/nir/nir_opcodes.py  |  6 +- >  3 files changed, 24 insertions(+), 2

Re: [Mesa-dev] [PATCH 1/2] nir/constant_expressions: Refactor helper functions

2017-03-10 Thread Iago Toral
(size) >   > +def op_bit_sizes(op): > +sizes = set([8, 16, 32, 64]) > +if not type_has_size(op.output_type): > +sizes = sizes.intersection(set(type_sizes(op.output_type))) > +for input_type in op.input_types: > +  if not type_has_size(input_type): >

Re: [Mesa-dev] [PATCH 00/16] anv: Handle out of memory situations better

2017-03-08 Thread Iago Toral
On Wed, 2017-03-08 at 15:00 -0800, Jason Ekstrand wrote: > On Wed, Mar 8, 2017 at 12:24 AM, Iago Toral <ito...@igalia.com> > wrote: > > On Tue, 2017-03-07 at 10:31 +0200, Pohjolainen, Topi wrote: > > > On Tue, Mar 07, 2017 at 08:15:45AM +0100, I

Re: [Mesa-dev] [PATCH 03/16] anv: don't crash if we fail to grow the reloc list

2017-03-08 Thread Iago Toral
On Tue, 2017-03-07 at 08:44 -0800, Jason Ekstrand wrote: > On Mon, Mar 6, 2017 at 11:15 PM, Iago Toral Quiroga <ito...@igalia.co > m> wrote: > > --- > >  src/intel/vulkan/anv_batch_chain.c | 10 ++ > >  1 file changed, 6 insertions(+), 4 deletions(-) > >

Re: [Mesa-dev] [PATCH 16/16] anv/cmd_buffer: handle out of device memory during binding table emission

2017-03-08 Thread Iago Toral
On Tue, 2017-03-07 at 13:25 -0800, Jason Ekstrand wrote: > On Mon, Mar 6, 2017 at 11:16 PM, Iago Toral Quiroga <ito...@igalia.co > m> wrote: > > --- > >  src/intel/vulkan/genX_cmd_buffer.c | 7 +-- > >  1 file changed, 5 insertions(+), 2 deletions(-) > >

Re: [Mesa-dev] [PATCH 15/16] anv/cmd_buffer: skip vkCmdExecuteCommands() on broken command buffers

2017-03-08 Thread Iago Toral
On Tue, 2017-03-07 at 13:24 -0800, Jason Ekstrand wrote: > On Mon, Mar 6, 2017 at 11:16 PM, Iago Toral Quiroga <ito...@igalia.co > m> wrote: > > --- > >  src/intel/vulkan/genX_cmd_buffer.c | 6 ++ > >  1 file changed, 6 insertions(+) > > > > diff

Re: [Mesa-dev] [PATCH 12/16] anv: ensure that we don't ever try to adjust relocations more than once

2017-03-08 Thread Iago Toral
On Tue, 2017-03-07 at 13:22 -0800, Jason Ekstrand wrote: > On Mon, Mar 6, 2017 at 11:15 PM, Iago Toral Quiroga <ito...@igalia.co > m> wrote: > > There is a CTS tests that creates that situation by forcing OOM > > during a queue > > submision and then trying aga

Re: [Mesa-dev] [PATCH 08/16] anv/cmd_buffer: track error scenarios during command buffer recording

2017-03-08 Thread Iago Toral
On Tue, 2017-03-07 at 09:32 -0800, Jason Ekstrand wrote: > On Mon, Mar 6, 2017 at 11:15 PM, Iago Toral Quiroga <ito...@igalia.co > m> wrote: > > The vkCmd*() functions do not report errors, instead, any errors > > should be > > reported by the time we call vk

Re: [Mesa-dev] [PATCH 05/16] anv: do not try to ref/unref NULL shaders

2017-03-08 Thread Iago Toral
On Tue, 2017-03-07 at 08:47 -0800, Jason Ekstrand wrote: > On Mon, Mar 6, 2017 at 11:15 PM, Iago Toral Quiroga <ito...@igalia.co > m> wrote: > > This situation can happen if we failed to allocate memory for the > > shader. > > --- > >  src/intel/vulkan/anv_priv

Re: [Mesa-dev] [PATCH 00/16] anv: Handle out of memory situations better

2017-03-08 Thread Iago Toral
On Tue, 2017-03-07 at 10:31 +0200, Pohjolainen, Topi wrote: > On Tue, Mar 07, 2017 at 08:15:45AM +0100, Iago Toral Quiroga wrote: > > > > There are a number of work-in-progress CTS tests that check OOM > > handling > > and raised a number of issues

[Mesa-dev] [PATCH 07/16] anv/cmd_buffer: return a VkResult in cmd_buffer_setup_attachments

2017-03-06 Thread Iago Toral Quiroga
--- src/intel/vulkan/genX_cmd_buffer.c | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c index ae153d2..b46a922 100644 --- a/src/intel/vulkan/genX_cmd_buffer.c +++

[Mesa-dev] [PATCH 13/16] anv/cmd_buffer: skip vkCmdDraw*() on broken command buffers

2017-03-06 Thread Iago Toral Quiroga
--- src/intel/vulkan/genX_cmd_buffer.c | 12 1 file changed, 12 insertions(+) diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c index cbad144..c78855b 100644 --- a/src/intel/vulkan/genX_cmd_buffer.c +++ b/src/intel/vulkan/genX_cmd_buffer.c @@

[Mesa-dev] [PATCH 02/16] blorp: handle out of memory without crashing in various batch emissions

2017-03-06 Thread Iago Toral Quiroga
--- src/intel/blorp/blorp_genX_exec.h | 7 +++ 1 file changed, 7 insertions(+) diff --git a/src/intel/blorp/blorp_genX_exec.h b/src/intel/blorp/blorp_genX_exec.h index 8f322b0..dc1b773 100644 --- a/src/intel/blorp/blorp_genX_exec.h +++ b/src/intel/blorp/blorp_genX_exec.h @@ -276,6 +276,8 @@

[Mesa-dev] [PATCH 15/16] anv/cmd_buffer: skip vkCmdExecuteCommands() on broken command buffers

2017-03-06 Thread Iago Toral Quiroga
--- src/intel/vulkan/genX_cmd_buffer.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c index 2c9aec8..8b752c4 100644 --- a/src/intel/vulkan/genX_cmd_buffer.c +++ b/src/intel/vulkan/genX_cmd_buffer.c @@ -640,6

[Mesa-dev] [PATCH 08/16] anv/cmd_buffer: track error scenarios during command buffer recording

2017-03-06 Thread Iago Toral Quiroga
The vkCmd*() functions do not report errors, instead, any errors should be reported by the time we call vkEndCommandBuffer(). This means that we need to track things such as "out of host memory" and use that information to avoid executing code that could lead to crashes (due to the fact that the

[Mesa-dev] [PATCH 11/16] anv: handle out of memory situations during queue submissions

2017-03-06 Thread Iago Toral Quiroga
--- src/intel/vulkan/anv_batch_chain.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/intel/vulkan/anv_batch_chain.c b/src/intel/vulkan/anv_batch_chain.c index d0a1b03..aae5f78 100644 --- a/src/intel/vulkan/anv_batch_chain.c +++

[Mesa-dev] [PATCH 16/16] anv/cmd_buffer: handle out of device memory during binding table emission

2017-03-06 Thread Iago Toral Quiroga
--- src/intel/vulkan/genX_cmd_buffer.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c index 8b752c4..23d7493 100644 --- a/src/intel/vulkan/genX_cmd_buffer.c +++

[Mesa-dev] [PATCH 03/16] anv: don't crash if we fail to grow the reloc list

2017-03-06 Thread Iago Toral Quiroga
--- src/intel/vulkan/anv_batch_chain.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/intel/vulkan/anv_batch_chain.c b/src/intel/vulkan/anv_batch_chain.c index 3f6039e..4cbfb4d 100644 --- a/src/intel/vulkan/anv_batch_chain.c +++

[Mesa-dev] [PATCH 14/16] anv/cmd_buffer: skip vkCmdDispatch() on broken command buffers

2017-03-06 Thread Iago Toral Quiroga
--- src/intel/vulkan/genX_cmd_buffer.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c index c78855b..2c9aec8 100644 --- a/src/intel/vulkan/genX_cmd_buffer.c +++ b/src/intel/vulkan/genX_cmd_buffer.c @@ -1929,6 +1929,9

[Mesa-dev] [PATCH 09/16] anv: handle out of memory scenarios in anv_batch_emit_batch()

2017-03-06 Thread Iago Toral Quiroga
Fixes: dEQP-VK.api.out_of_host_memory.cmd_execute_commands --- src/intel/vulkan/anv_batch_chain.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/intel/vulkan/anv_batch_chain.c b/src/intel/vulkan/anv_batch_chain.c index 162ef2e..d0a1b03 100644 ---

[Mesa-dev] [PATCH 05/16] anv: do not try to ref/unref NULL shaders

2017-03-06 Thread Iago Toral Quiroga
This situation can happen if we failed to allocate memory for the shader. --- src/intel/vulkan/anv_private.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h index c73196a..d3e32bc 100644 --- a/src/intel/vulkan/anv_private.h

[Mesa-dev] [PATCH 01/16] blorp: handle out of memory in blorp_emitn()

2017-03-06 Thread Iago Toral Quiroga
--- src/intel/blorp/blorp_genX_exec.h | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/intel/blorp/blorp_genX_exec.h b/src/intel/blorp/blorp_genX_exec.h index f0c4f38..8f322b0 100644 --- a/src/intel/blorp/blorp_genX_exec.h +++

[Mesa-dev] [PATCH 06/16] anv/blorp: return early if we failed to create the shader binary

2017-03-06 Thread Iago Toral Quiroga
--- src/intel/vulkan/anv_blorp.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/intel/vulkan/anv_blorp.c b/src/intel/vulkan/anv_blorp.c index d79c5e0..c871f03 100644 --- a/src/intel/vulkan/anv_blorp.c +++ b/src/intel/vulkan/anv_blorp.c @@ -72,6 +72,9 @@ upload_blorp_shader(struct

[Mesa-dev] [PATCH 12/16] anv: ensure that we don't ever try to adjust relocations more than once

2017-03-06 Thread Iago Toral Quiroga
There is a CTS tests that creates that situation by forcing OOM during a queue submision and then trying again without the OOM enforcement. The driver returns the appropriate out of memory error on the first try, but the relocations had already been computed and stored, so in the second attempt,

[Mesa-dev] [PATCH 04/16] anv: handle out of memory situations in anv_batch_emit_dwords()

2017-03-06 Thread Iago Toral Quiroga
--- src/intel/vulkan/anv_batch_chain.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/intel/vulkan/anv_batch_chain.c b/src/intel/vulkan/anv_batch_chain.c index 4cbfb4d..162ef2e 100644 --- a/src/intel/vulkan/anv_batch_chain.c +++

[Mesa-dev] [PATCH 10/16] anv/cmd_buffer: handle out of memory during vkCmdPushConstants

2017-03-06 Thread Iago Toral Quiroga
Fixes: dEQP-VK.api.out_of_host_memory.cmd_push_constants --- src/intel/vulkan/anv_cmd_buffer.c | 14 +++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/intel/vulkan/anv_cmd_buffer.c b/src/intel/vulkan/anv_cmd_buffer.c index 01447b0..dd5e6c8 100644 ---

[Mesa-dev] [PATCH 00/16] anv: Handle out of memory situations better

2017-03-06 Thread Iago Toral Quiroga
. Iago Toral Quiroga (16): blorp: handle out of memory in blorp_emitn() blorp: handle out of memory without crashing in various batch emissions anv: don't crash if we fail to grow the reloc list anv: handle out of memory situations in anv_batch_emit_dwords() anv: do not try to ref/unref

Re: [Mesa-dev] [PATCH] i965: Assert that the binding table isn't bigger than surf_offsets

2017-03-02 Thread Iago Toral
Reviewed-by: Iago Toral Quiroga <ito...@igalia.com> On Wed, 2017-03-01 at 22:40 -0800, Jason Ekstrand wrote: > We used to have an assert in mark_surface_used to protect us from > this > but it's gone now.  Instead, we'll assert right before we try to > memcpy > the co

Re: [Mesa-dev] [PATCH 2/2] anv: do not subtract the base layer to copute depth in 3DSTATE_DEPTH_BUFFER

2017-03-01 Thread Iago Toral
On Wed, 2017-03-01 at 11:39 -0800, Jason Ekstrand wrote: > On Tue, Feb 28, 2017 at 11:33 PM, Iago Toral <ito...@igalia.com> > wrote: > > On Fri, 2017-02-24 at 07:25 -0800, Jason Ekstrand wrote: > > > On Feb 23, 2017 11:40 PM, "Iago Toral Quiroga"

[Mesa-dev] [PATCH 2/2 v2] anv: do not subtract the base layer to compute depth in 3DSTATE_DEPTH_BUFFER

2017-03-01 Thread Iago Toral Quiroga
According to the PRM description of the Depth field: "This field specifies the total number of levels for a volume texture or the number of array elements allowed to be accessed starting at the Minimum Array Element for arrayed surfaces" However, ISL defines array_len as the length of

Re: [Mesa-dev] [PATCH 2/2] anv: do not subtract the base layer to copute depth in 3DSTATE_DEPTH_BUFFER

2017-02-28 Thread Iago Toral
On Fri, 2017-02-24 at 07:25 -0800, Jason Ekstrand wrote: > On Feb 23, 2017 11:40 PM, "Iago Toral Quiroga" <ito...@igalia.com> > wrote: > According to the PRM description of the Depth field: > >   "This field specifies the total number of levels for a volume &

Re: [Mesa-dev] i965: Remove duplicate checks

2017-02-24 Thread Iago Toral
I think the comment affects the hunk after these checks, so maybe removing the checks after the comment makes more sense? Either way: Reviewed-by: Iago Toral Quiroga <ito...@igalia.com> On Fri, 2017-02-24 at 15:10 +0200, Juha-Pekka Heikkila wrote: > On both sides of the comment on wha

[Mesa-dev] [PATCH 2/2] anv: do not subtract the base layer to copute depth in 3DSTATE_DEPTH_BUFFER

2017-02-23 Thread Iago Toral Quiroga
According to the PRM description of the Depth field: "This field specifies the total number of levels for a volume texture or the number of array elements allowed to be accessed starting at the Minimum Array Element for arrayed surfaces" However, ISL defines array_len as the length of

[Mesa-dev] [PATCH 1/2] isl: document the meaning of the array_len field in isl_view

2017-02-23 Thread Iago Toral Quiroga
--- src/intel/isl/isl.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/src/intel/isl/isl.h b/src/intel/isl/isl.h index c340e6a..e6e9459 100644 --- a/src/intel/isl/isl.h +++ b/src/intel/isl/isl.h @@ -934,6 +934,12 @@ struct isl_view { * for texturing, they are ignored. */

Re: [Mesa-dev] [PATCH] anv: ensure that we do not emit negative Depth in 3DSTATE_DEPTH_BUFFER

2017-02-23 Thread Iago Toral
On Thu, 2017-02-23 at 12:10 +0100, Iago Toral wrote: > On Wed, 2017-02-22 at 09:38 -0800, Jason Ekstrand wrote: > > > > On Wed, Feb 22, 2017 at 6:45 AM, Iago Toral Quiroga <itoral@igalia. > > co > > m> wrote: > > > > > > This fixes a number of n

Re: [Mesa-dev] [PATCH] anv: ensure that we do not emit negative Depth in 3DSTATE_DEPTH_BUFFER

2017-02-23 Thread Iago Toral
On Wed, 2017-02-22 at 09:38 -0800, Jason Ekstrand wrote: > On Wed, Feb 22, 2017 at 6:45 AM, Iago Toral Quiroga <ito...@igalia.co > m> wrote: > > This fixes a number of new CTS tests that would crash otherwise: > > dEQP-VK.pipeline.render_to_image.* > > --- > >

Re: [Mesa-dev] [PATCH] glsl: enable early_fragment_tests implicitly with post_depth_coverage

2017-02-22 Thread Iago Toral
On Wed, 2017-02-22 at 21:15 +0100, Marek Olšák wrote: > On Wed, Feb 22, 2017 at 9:11 PM, Matt Turner <matts...@gmail.com> > wrote: > > > > On Wed, Feb 22, 2017 at 12:06 AM, Iago Toral Quiroga <itoral@igalia > > .com> wrote: > > > &g

Re: [Mesa-dev] [PATCH] anv: ensure that we do not emit negative Depth in 3DSTATE_DEPTH_BUFFER

2017-02-22 Thread Iago Toral
t miss anything right?). > > On 22/02/17 14:45, Iago Toral Quiroga wrote: > > > > This fixes a number of new CTS tests that would crash otherwise: > > dEQP-VK.pipeline.render_to_image.* > > --- > >   src/intel/vulkan/genX_cmd_buffer.c | 3 ++- > &g

[Mesa-dev] [PATCH] anv: ensure that we do not emit negative Depth in 3DSTATE_DEPTH_BUFFER

2017-02-22 Thread Iago Toral Quiroga
This fixes a number of new CTS tests that would crash otherwise: dEQP-VK.pipeline.render_to_image.* --- src/intel/vulkan/genX_cmd_buffer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c index

[Mesa-dev] [PATCH] glsl: enable early_fragment_tests implicitly with post_depth_coverage

2017-02-22 Thread Iago Toral Quiroga
From: Iago Toral Quiroga <ito...@atlantix-intelskylake.local.igalia.com> From ARB_post_depth_coverage: "This extension allows the fragment shader to control whether values in gl_SampleMaskIn[] reflect the coverage after application of the early depth and stencil tests. T

Re: [Mesa-dev] [PATCH 1/7] i965: Drop dead Gen8+ code from Gen7/sometimes-HSW driver hooks.

2017-02-17 Thread Iago Toral
And patches 6-7 are also: Reviewed-by: Iago Toral Quiroga <ito...@igalia.com> On Fri, 2017-02-17 at 13:21 +0100, Iago Toral wrote: > Patches 1-5 are: > > Reviewed-by: Iago Toral Quiroga <ito...@igalia.com> > > On Fri, 2017-02-17 at 01:56 -0800, Kenneth Graunke w

Re: [Mesa-dev] [PATCH 1/7] i965: Drop dead Gen8+ code from Gen7/sometimes-HSW driver hooks.

2017-02-17 Thread Iago Toral
Patches 1-5 are: Reviewed-by: Iago Toral Quiroga <ito...@igalia.com> On Fri, 2017-02-17 at 01:56 -0800, Kenneth Graunke wrote: > These driver hooks are not used when MI_MATH and MI_LOAD_REGISTER_REG > are supported, which Gen8+ can always do.  So this code is dead. > > Sign

Re: [Mesa-dev] [PATCH] glsl: link error if unsized array not-last in ssbo

2017-02-17 Thread Iago Toral
Reviewed-by: Iago Toral Quiroga <ito...@igali.com> You can also add the new piglit tests that this fixes to the commit log. Iago  On Wed, 2017-02-15 at 15:12 +0100, Jose Maria Casanova Crespo wrote: > If an unsized declared array is not the last in an SSBO > and an impli

Re: [Mesa-dev] [PATCH 1/2] util: Add helpers for iterating over Vulkan extension structs

2017-02-14 Thread Iago Toral
Both patches are: Reviewed-by: Iago Toral Quiroga <ito...@igalia.com> On Tue, 2017-02-14 at 16:03 -0800, Jason Ekstrand wrote: > --- >  src/util/Makefile.sources |  3 ++- >  src/util/vk_util.h| 43 > +++ >  2 files changed

Re: [Mesa-dev] [PATCH 1/2] spirv: Add support for SpvCapabilityStorageImageWriteWithoutFormat

2017-02-14 Thread Iago Toral
On Tue, 2017-02-14 at 11:42 +, Alex Smith wrote: > Hi Iago, > > On 14 February 2017 at 11:19, Iago Toral <ito...@igalia.com> wrote: > > On Tue, 2017-02-14 at 09:46 +, Alex Smith wrote: > > > On 14 February 2017 at 08:45, Iago Toral <ito...@igalia.com> &

Re: [Mesa-dev] [PATCH 1/2] spirv: Add support for SpvCapabilityStorageImageWriteWithoutFormat

2017-02-14 Thread Iago Toral
On Tue, 2017-02-14 at 11:37 +, Lionel Landwerlin wrote: > On 14/02/17 11:19, Iago Toral wrote: > > > > On Tue, 2017-02-14 at 09:46 +, Alex Smith wrote: > > > > > > On 14 February 2017 at 08:45, Iago Toral <ito...@igalia.com> > > > wrote: &g

Re: [Mesa-dev] [PATCH 1/2] spirv: Add support for SpvCapabilityStorageImageWriteWithoutFormat

2017-02-14 Thread Iago Toral
On Tue, 2017-02-14 at 09:46 +, Alex Smith wrote: > On 14 February 2017 at 08:45, Iago Toral <ito...@igalia.com> wrote: > > On Mon, 2017-02-13 at 16:29 +, Lionel Landwerlin wrote: > > > Run this by our CI earlier today and got a few fai

Re: [Mesa-dev] [PATCH] nir/spirv: do not require a format with images that are not sampled

2017-02-14 Thread Iago Toral
On Tue, 2017-02-14 at 11:32 +0100, Iago Toral Quiroga wrote: > As soon as we support shaderStorageImageWriteWithoutFormat we can see > write-only images (sampled == 2) that don't have a format specified. > --- I didn't do a thorough testing yet, but I caught this immediately after

[Mesa-dev] [PATCH] nir/spirv: do not require a format with images that are not sampled

2017-02-14 Thread Iago Toral Quiroga
As soon as we support shaderStorageImageWriteWithoutFormat we can see write-only images (sampled == 2) that don't have a format specified. --- src/compiler/spirv/spirv_to_nir.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/compiler/spirv/spirv_to_nir.c

Re: [Mesa-dev] [PATCH 1/2] spirv: Add support for SpvCapabilityStorageImageWriteWithoutFormat

2017-02-14 Thread Iago Toral
On Mon, 2017-02-13 at 16:29 +, Lionel Landwerlin wrote: > Run this by our CI earlier today and got a few failures : > > dEQP-VK.image.load_store.buffer.r8g8b8a8_snorm > dEQP-VK.image.load_store.buffer.r8g8b8a8_unorm > dEQP-VK.image.format_reinterpret.buffer.r32_uint_r8g8b8a8_snorm >

Re: [Mesa-dev] [PATCH 2/2] glsl: Nerf assert about qualifiers in lower_packed_varyings().

2017-02-13 Thread Iago Toral
On Sat, 2017-02-11 at 02:36 -0800, Kenneth Graunke wrote: > In ES 3.0, interpret_interpolation_qualifier() defaults unset > interpolation qualifiers to "smooth"...which has the strange result > of marking some integer variables "smooth". > > Interpolation qualifiers really only matter for

Re: [Mesa-dev] [PATCH 1/2] glsl: Handle packed_type == ivec4[] in lower_packed_varyings().

2017-02-13 Thread Iago Toral
This patch is: Reviewed-by: Iago Toral Quiroga <ito...@igalia.com> On Sat, 2017-02-11 at 02:36 -0800, Kenneth Graunke wrote: > For GS input arrays, we may turn a packed_type of ivec4 into an > array of ivec4s.  We still want flat qualification. > > Found by inspection. 

Re: [Mesa-dev] [PATCH 2/2] i965: Get rid of mark_surface_used()

2017-02-07 Thread Iago Toral
e >  brw_type_for_base_type(const struct glsl_type *type) >  { > @@ -1155,7 +1145,7 @@ backend_shader::calculate_cfg() >   * unused but also make sure that addition of small offsets to them > will >   * trigger some of our asserts that surface indices are < > BRW_MAX

<    5   6   7   8   9   10   11   12   13   14   >