[Mesa-dev] [PATCH 2/2] gallium/u_threaded: remove 16 bytes from tc_batch

Samuel Pitoiset samuel.pitoiset at gmail.com
Mon Jun 5 16:15:07 UTC 2017


Both patches are:

Reviewed-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>

On 06/01/2017 08:09 PM, Marek Olšák wrote:
> From: Marek Olšák <marek.olsak at amd.com>
> 
> All other sentinels occupy what is otherwise unused space.
> ---
>   src/gallium/auxiliary/util/u_threaded_context.c | 2 --
>   src/gallium/auxiliary/util/u_threaded_context.h | 1 -
>   2 files changed, 3 deletions(-)
> 
> diff --git a/src/gallium/auxiliary/util/u_threaded_context.c b/src/gallium/auxiliary/util/u_threaded_context.c
> index 34206bf..71211e6 100644
> --- a/src/gallium/auxiliary/util/u_threaded_context.c
> +++ b/src/gallium/auxiliary/util/u_threaded_context.c
> @@ -60,21 +60,20 @@ enum tc_call_id {
>   };
>   
>   typedef void (*tc_execute)(struct pipe_context *pipe, union tc_payload *payload);
>   
>   static const tc_execute execute_func[TC_NUM_CALLS];
>   
>   static void
>   tc_batch_check(struct tc_batch *batch)
>   {
>      tc_assert(batch->sentinel == TC_SENTINEL);
> -   tc_assert(batch->sentinel2 == TC_SENTINEL);
>      tc_assert(batch->num_total_call_slots <= TC_CALLS_PER_BATCH);
>   }
>   
>   static void
>   tc_debug_check(struct threaded_context *tc)
>   {
>      for (unsigned i = 0; i < TC_MAX_BATCHES; i++) {
>         tc_batch_check(&tc->batch_slots[i]);
>         tc_assert(tc->batch_slots[i].pipe == tc->pipe);
>      }
> @@ -2200,21 +2199,20 @@ threaded_context_create(struct pipe_context *pipe,
>   
>      /* The queue size is the number of batches "waiting". Batches are removed
>       * from the queue before being executed, so keep one tc_batch slot for that
>       * execution. Also, keep one unused slot for an unflushed batch.
>       */
>      if (!util_queue_init(&tc->queue, "gallium_drv", TC_MAX_BATCHES - 2, 1))
>         goto fail;
>   
>      for (unsigned i = 0; i < TC_MAX_BATCHES; i++) {
>         tc->batch_slots[i].sentinel = TC_SENTINEL;
> -      tc->batch_slots[i].sentinel2 = TC_SENTINEL;
>         tc->batch_slots[i].pipe = pipe;
>         util_queue_fence_init(&tc->batch_slots[i].fence);
>      }
>   
>      LIST_INITHEAD(&tc->unflushed_queries);
>   
>      slab_create_child(&tc->pool_transfers, parent_transfer_pool);
>   
>   #define CTX_INIT(_member) \
>      tc->base._member = tc->pipe->_member ? tc_##_member : NULL
> diff --git a/src/gallium/auxiliary/util/u_threaded_context.h b/src/gallium/auxiliary/util/u_threaded_context.h
> index 5d2a10c..2e7e301 100644
> --- a/src/gallium/auxiliary/util/u_threaded_context.h
> +++ b/src/gallium/auxiliary/util/u_threaded_context.h
> @@ -286,21 +286,20 @@ struct ALIGN16 tc_call {
>      ushort call_id;
>      union tc_payload payload;
>   };
>   
>   struct tc_batch {
>      struct pipe_context *pipe;
>      unsigned sentinel;
>      unsigned num_total_call_slots;
>      struct util_queue_fence fence;
>      struct tc_call call[TC_CALLS_PER_BATCH];
> -   unsigned sentinel2;
>   };
>   
>   struct threaded_context {
>      struct pipe_context base;
>      struct pipe_context *pipe;
>      struct slab_child_pool pool_transfers;
>      tc_replace_buffer_storage_func replace_buffer_storage;
>      unsigned map_buffer_alignment;
>   
>      struct list_head unflushed_queries;
> 


More information about the mesa-dev mailing list