[Mesa-stable] [Mesa-dev] [PATCH 01/11] anv: Add support for INTEL_DEBUG=sync, state

Kenneth Graunke kenneth at whitecape.org
Fri Jun 17 21:33:25 UTC 2016


On Friday, June 17, 2016 1:53:18 PM PDT Jason Ekstrand wrote:
> Signed-off-by: Jason Ekstrand <jason at jlekstrand.net>
> Cc: "12.0" <mesa-stable at lists.freedesktop.org>
> ---
>  src/intel/vulkan/gen8_cmd_buffer.c | 9 +++++++++
>  src/intel/vulkan/genX_cmd_buffer.c | 9 +++++++++
>  2 files changed, 18 insertions(+)
> 
> diff --git a/src/intel/vulkan/gen8_cmd_buffer.c b/src/intel/vulkan/gen8_cmd_buffer.c
> index df4036a..2600615 100644
> --- a/src/intel/vulkan/gen8_cmd_buffer.c
> +++ b/src/intel/vulkan/gen8_cmd_buffer.c
> @@ -365,6 +365,15 @@ genX(cmd_buffer_flush_compute_state)(struct anv_cmd_buffer *cmd_buffer)
>  
>     assert(pipeline->active_stages == VK_SHADER_STAGE_COMPUTE_BIT);
>  
> +   if (unlikely(INTEL_DEBUG & DEBUG_SYNC)) {
> +      cmd_buffer->state.pending_pipe_bits =
> +         ANV_PIPE_FLUSH_BITS | ANV_PIPE_INVALIDATE_BITS | ANV_PIPE_CS_STALL_BIT;
> +   }
> +
> +   if (unlikely(INTEL_DEBUG & DEBUG_STATE)) {
> +      cmd_buffer->state.dirty = ~0;
> +   }
> +
>     genX(cmd_buffer_config_l3)(cmd_buffer, pipeline);
>  
>     genX(flush_pipeline_select_gpgpu)(cmd_buffer);
> diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c
> index d9acf58..10ed73a 100644
> --- a/src/intel/vulkan/genX_cmd_buffer.c
> +++ b/src/intel/vulkan/genX_cmd_buffer.c
> @@ -417,6 +417,15 @@ genX(cmd_buffer_flush_state)(struct anv_cmd_buffer *cmd_buffer)
>  
>     assert((pipeline->active_stages & VK_SHADER_STAGE_COMPUTE_BIT) == 0);
>  
> +   if (unlikely(INTEL_DEBUG & DEBUG_SYNC)) {
> +      cmd_buffer->state.pending_pipe_bits =
> +         ANV_PIPE_FLUSH_BITS | ANV_PIPE_INVALIDATE_BITS | ANV_PIPE_CS_STALL_BIT;
> +   }
> +
> +   if (unlikely(INTEL_DEBUG & DEBUG_STATE)) {
> +      cmd_buffer->state.dirty = ~0;
> +   }
> +
>     genX(cmd_buffer_config_l3)(cmd_buffer, pipeline);
>  
>     genX(flush_pipeline_select_3d)(cmd_buffer);
> 

NAK.  This reuses established INTEL_DEBUG environment variable flags
but has a completely different meaning for both of them.

In i965, INTEL_DEBUG=sync means: when you flush a batchbuffer and submit
it to the GPU...use i915_gem_object_wait_rendering() to stall until the
GPU has completely finished that batchbuffer's rendering.  Only then
will it return from the glDrawFoo() API call.

This seems more like always_flush_cache=true, which is a driconf option
for some reason.  I don't know why that's a driconf option, as we'd
never want to set it in /etc/drirc.  I suppose we could change that.

In i965, INTEL_DEBUG=state means: periodically print out statistics
about how frequently state is dirtied, i.e.

0x0000000000200000:          429 (BRW_NEW_SURFACES)                             
0x0000000000400000:          429 (BRW_NEW_BINDING_TABLE_POINTERS)               
0x0000000000800000:          572 (BRW_NEW_INDICES)                              
0x0000000001000000:          572 (BRW_NEW_VERTICES)                             
0x0000000004000000:           48 (BRW_NEW_BATCH)

I am definitely a fan of creating an INTEL_DEBUG option for "re-emit all
state"...I've wanted one of those in the i965 driver too.  (Our code for
this is just an if (0) currently.)  Perhaps INTEL_DEBUG=reemit?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/mesa-stable/attachments/20160617/f6e56845/attachment.sig>


More information about the mesa-stable mailing list