i965: Don't parse driconf again
authorIan Romanick <ian.d.romanick@intel.com>
Wed, 27 Jan 2021 20:01:26 +0000 (12:01 -0800)
committerIan Romanick <ian.d.romanick@intel.com>
Thu, 28 Jan 2021 03:10:05 +0000 (19:10 -0800)
It was already parsed in intelInitScree2, and the results are stored in
the screen.

Fixes: d67ef485804 ("i965/screen: Allow drirc to set 'allow_rgb10_configs' again.")
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7387>

src/mesa/drivers/dri/i965/brw_context.c
src/mesa/drivers/dri/i965/brw_context.h
src/mesa/drivers/dri/i965/intel_extensions.c

index c26387f..43a150f 100644 (file)
@@ -579,7 +579,7 @@ brw_initialize_context_constants(struct brw_context *brw)
    int max_samples;
    const int *msaa_modes = intel_supported_msaa_modes(brw->screen);
    const int clamp_max_samples =
-      driQueryOptioni(&brw->optionCache, "clamp_max_samples");
+      driQueryOptioni(&brw->screen->optionCache, "clamp_max_samples");
 
    if (clamp_max_samples < 0) {
       max_samples = msaa_modes[0];
@@ -858,11 +858,7 @@ brw_process_driconf_options(struct brw_context *brw)
 {
    const struct gen_device_info *devinfo = &brw->screen->devinfo;
    struct gl_context *ctx = &brw->ctx;
-
-   driOptionCache *options = &brw->optionCache;
-   driParseConfigFiles(options, &brw->screen->optionCache,
-                       brw->driContext->driScreenPriv->myNum,
-                       "i965", NULL, NULL, 0, NULL, 0);
+   const driOptionCache *const options = &brw->screen->optionCache;
 
    if (INTEL_DEBUG & DEBUG_NO_HIZ) {
        brw->has_hiz = false;
@@ -889,9 +885,9 @@ brw_process_driconf_options(struct brw_context *brw)
       brw->disable_throttling = true;
    }
 
-   brw->precompile = driQueryOptionb(&brw->optionCache, "shader_precompile");
+   brw->precompile = driQueryOptionb(&brw->screen->optionCache, "shader_precompile");
 
-   if (driQueryOptionb(&brw->optionCache, "precise_trig"))
+   if (driQueryOptionb(&brw->screen->optionCache, "precise_trig"))
       brw->screen->compiler->precise_trig = true;
 
    ctx->Const.ForceGLSLExtensionsWarn =
@@ -1267,8 +1263,6 @@ intelDestroyContext(__DRIcontext * driContextPriv)
    brw->throttle_batch[1] = NULL;
    brw->throttle_batch[0] = NULL;
 
-   driDestroyOptionCache(&brw->optionCache);
-
    /* free the Mesa context */
    _mesa_free_context_data(&brw->ctx, true);
 
index aaf1a7e..fac7802 100644 (file)
@@ -813,8 +813,6 @@ struct brw_context
    bool disable_throttling;
    bool precompile;
    bool dual_color_blend_by_location;
-
-   driOptionCache optionCache;
    /** @} */
 
    GLuint primitive; /**< Hardware primitive, such as _3DPRIM_TRILIST. */
index f78cd82..dd7f5a8 100644 (file)
@@ -180,7 +180,7 @@ intelInitExtensions(struct gl_context *ctx)
 
    if (devinfo->gen >= 6) {
       ctx->Extensions.ARB_blend_func_extended =
-         !driQueryOptionb(&brw->optionCache, "disable_blend_func_extended");
+         !driQueryOptionb(&brw->screen->optionCache, "disable_blend_func_extended");
       ctx->Extensions.ARB_conditional_render_inverted = true;
       ctx->Extensions.ARB_cull_distance = true;
       ctx->Extensions.ARB_draw_buffers_blend = true;