[Mesa-dev] [PATCH v2 2/4] i965/state: Support multiple pipelines in brw->num_atoms

Kenneth Graunke kenneth at whitecape.org
Sun Mar 15 21:30:14 PDT 2015


On Wednesday, March 11, 2015 11:53:38 AM Jordan Justen wrote:
> brw->num_atoms is converted to an array, but currently just an array
> of length 1.
> 
> Adds brw_copy_pipeline_atoms which copies the atoms for a pipeline,
> and sets brw->num_atoms[p] for pipeline p.
> 
> v2:
>  * Rename brw->atoms[] to render_atoms
>  * Rename brw_add_pipeline_atoms to brw_copy_pipeline_atoms
>  * Rename brw_pipeline_first_atom to brw_get_pipeline_atoms
> 
> Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
> ---
>  src/mesa/drivers/dri/i965/brw_context.h      | 10 ++-
>  src/mesa/drivers/dri/i965/brw_state_upload.c | 94 +++++++++++++++++-----------
>  2 files changed, 65 insertions(+), 39 deletions(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h
> index 682fbe9..91b4054 100644
> --- a/src/mesa/drivers/dri/i965/brw_context.h
> +++ b/src/mesa/drivers/dri/i965/brw_context.h
> @@ -149,6 +149,12 @@ struct brw_vue_prog_key;
>  struct brw_wm_prog_key;
>  struct brw_wm_prog_data;
>  
> +enum brw_pipeline {
> +   BRW_RENDER_PIPELINE,
> +
> +   BRW_NUM_PIPELINES
> +};
> +
>  enum brw_cache_id {
>     BRW_CACHE_FS_PROG,
>     BRW_CACHE_BLORP_BLIT_PROG,
> @@ -1386,8 +1392,8 @@ struct brw_context
>        int entries_per_oa_snapshot;
>     } perfmon;
>  
> -   int num_atoms;
> -   const struct brw_tracked_state atoms[57];
> +   int num_atoms[BRW_NUM_PIPELINES];
> +   const struct brw_tracked_state render_atoms[57];
>  
>     /* If (INTEL_DEBUG & DEBUG_BATCH) */
>     struct {
> diff --git a/src/mesa/drivers/dri/i965/brw_state_upload.c b/src/mesa/drivers/dri/i965/brw_state_upload.c
> index 3b64a05..4f21002 100644
> --- a/src/mesa/drivers/dri/i965/brw_state_upload.c
> +++ b/src/mesa/drivers/dri/i965/brw_state_upload.c
> @@ -174,7 +174,7 @@ static const struct brw_tracked_state *gen6_atoms[] =
>     &brw_vertices,
>  };
>  
> -static const struct brw_tracked_state *gen7_atoms[] =
> +static const struct brw_tracked_state *gen7_render_atoms[] =
>  {
>     /* Command packets: */
>  
> @@ -246,7 +246,7 @@ static const struct brw_tracked_state *gen7_atoms[] =
>     &haswell_cut_index,
>  };
>  
> -static const struct brw_tracked_state *gen8_atoms[] =
> +static const struct brw_tracked_state *gen8_render_atoms[] =
>  {
>     /* Command packets: */
>     &gen8_state_base_address,
> @@ -342,48 +342,68 @@ brw_upload_initial_gpu_state(struct brw_context *brw)
>     }
>  }
>  
> +static inline const struct brw_tracked_state *
> +brw_get_pipeline_atoms(struct brw_context *brw,
> +                       enum brw_pipeline pipeline)
> +{
> +   switch (pipeline) {
> +   case BRW_RENDER_PIPELINE:
> +      return &brw->render_atoms[0];

Shouldn't this just be:

      return brw->render_atoms;

The array itself is already a pointer to the start of the array; taking
a pointer to the first element doesn't really clarify anything...

Either way, patches 1-3 are:
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
-------------- 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: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20150315/f7a5eb4a/attachment.sig>


More information about the mesa-dev mailing list