[Mesa-dev] [PATCH v3 30/34] i965: Initialize sha1 hash of dri config options

Kenneth Graunke kenneth at whitecape.org
Mon Oct 30 22:52:50 UTC 2017


On Sunday, October 22, 2017 1:01:38 PM PDT Jordan Justen wrote:
> Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
> Reviewed-by: Timothy Arceri <tarceri at itsqueeze.com>
> ---
>  src/mesa/drivers/dri/i965/brw_context.c | 4 ++++
>  src/mesa/drivers/dri/i965/brw_context.h | 1 +
>  2 files changed, 5 insertions(+)
> 
> diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c
> index c8de0746387..949ec4a2a3d 100644
> --- a/src/mesa/drivers/dri/i965/brw_context.c
> +++ b/src/mesa/drivers/dri/i965/brw_context.c
> @@ -1033,6 +1033,10 @@ brwCreateContext(gl_api api,
>     vbo_use_buffer_objects(ctx);
>     vbo_always_unmap_buffers(ctx);
>  
> +   driComputeOptionsSha1(&brw->screen->optionCache,
> +                         brw->dri_config_options_sha1);
> +   brw->ctx.Const.dri_config_options_sha1 = brw->dri_config_options_sha1;
> +
>     return true;
>  }
>  
> diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h
> index 26e71e62b54..834b9ae3d5a 100644
> --- a/src/mesa/drivers/dri/i965/brw_context.h
> +++ b/src/mesa/drivers/dri/i965/brw_context.h
> @@ -1211,6 +1211,7 @@ struct brw_context
>     bool draw_aux_buffer_disabled[MAX_DRAW_BUFFERS];
>  
>     __DRIcontext *driContext;
> +   unsigned char dri_config_options_sha1[20];
>     struct intel_screen *screen;
>  };
>  
> 

Why are we storing this in brw_context?  Maybe I'm missing something,
but it looks like we store it in ctx->Const and never use the
brw_context copy again.  Seems like we could put it there directly.

Can we also move this to brw_process_driconf_options() instead of
the end of brwCreateContext?

I'm always a bit confused about the driver/screen split here, but
I think this looks right.

With those changes,
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20171030/9db56459/attachment.sig>


More information about the mesa-dev mailing list