summaryrefslogtreecommitdiff
path: root/src/gallium/state_trackers/dri/dri_screen.c
diff options
context:
space:
mode:
authorNicolai Hähnle <nicolai.haehnle@amd.com>2017-06-28 17:50:19 +0200
committerNicolai Hähnle <nicolai.haehnle@amd.com>2017-07-13 13:27:46 +0200
commit82163029b3aeae8429a3fdfadfd370f72ac50b2f (patch)
tree8d70e1c548112ce87de1ad2ff0ec0c006e312778 /src/gallium/state_trackers/dri/dri_screen.c
parent5c10f0e8e36acb8b07680396d9a58feb6fbd41fe (diff)
gallium: move loading of drirc to pipe-loader
Diffstat (limited to 'src/gallium/state_trackers/dri/dri_screen.c')
-rw-r--r--src/gallium/state_trackers/dri/dri_screen.c41
1 files changed, 7 insertions, 34 deletions
diff --git a/src/gallium/state_trackers/dri/dri_screen.c b/src/gallium/state_trackers/dri/dri_screen.c
index 2117dbb29a..c13009105a 100644
--- a/src/gallium/state_trackers/dri/dri_screen.c
+++ b/src/gallium/state_trackers/dri/dri_screen.c
@@ -59,7 +59,7 @@ static void
dri_fill_st_options(struct dri_screen *screen)
{
struct st_config_options *options = &screen->options;
- const struct driOptionCache *optionCache = &screen->optionCache;
+ const struct driOptionCache *optionCache = &screen->dev->option_cache;
options->disable_blend_func_extended =
driQueryOptionb(optionCache, "disable_blend_func_extended");
@@ -118,7 +118,7 @@ dri_fill_in_modes(struct dri_screen *screen)
GLX_NONE, GLX_SWAP_UNDEFINED_OML, GLX_SWAP_COPY_OML
};
- if (driQueryOptionb(&screen->optionCache, "always_have_depth_buffer")) {
+ if (driQueryOptionb(&screen->dev->option_cache, "always_have_depth_buffer")) {
/* all visuals will have a depth buffer */
depth_buffer_factor = 0;
}
@@ -349,28 +349,6 @@ dri_get_param(struct st_manager *smapi,
}
}
-static void
-dri_destroy_option_cache(struct dri_screen * screen)
-{
- int i;
-
- if (screen->optionCache.info) {
- for (i = 0; i < (1 << screen->optionCache.tableSize); ++i) {
- free(screen->optionCache.info[i].name);
- free(screen->optionCache.info[i].ranges);
- }
- free(screen->optionCache.info);
- }
-
- free(screen->optionCache.values);
-
- /* Default values are copied to screen->optionCache->values in
- * initOptionCache. The info field, however, is a pointer copy, so don't free
- * that twice.
- */
- free(screen->optionCacheDefaults.values);
-}
-
void
dri_destroy_screen_helper(struct dri_screen * screen)
{
@@ -380,7 +358,6 @@ dri_destroy_screen_helper(struct dri_screen * screen)
if (screen->base.screen)
screen->base.screen->destroy(screen->base.screen);
- dri_destroy_option_cache(screen);
mtx_destroy(&screen->opencl_func_mutex);
}
@@ -404,7 +381,7 @@ dri_postprocessing_init(struct dri_screen *screen)
unsigned i;
for (i = 0; i < PP_FILTERS; i++) {
- screen->pp_enabled[i] = driQueryOptioni(&screen->optionCache,
+ screen->pp_enabled[i] = driQueryOptioni(&screen->dev->option_cache,
pp_filters[i].name);
}
}
@@ -429,19 +406,15 @@ dri_set_background_context(struct st_context_iface *st,
}
unsigned
-dri_init_options_get_screen_flags(struct dri_screen *screen,
- const char* driver_name)
+dri_init_options_get_screen_flags(struct dri_screen *screen)
{
unsigned flags = 0;
- driParseOptionInfo(&screen->optionCacheDefaults, gallium_config_options.xml);
- driParseConfigFiles(&screen->optionCache,
- &screen->optionCacheDefaults,
- screen->sPriv->myNum,
- driver_name);
+ pipe_loader_load_options(screen->dev);
+
dri_fill_st_options(screen);
- if (driQueryOptionb(&screen->optionCache,
+ if (driQueryOptionb(&screen->dev->option_cache,
"glsl_correct_derivatives_after_discard"))
flags |= PIPE_SCREEN_ENABLE_CORRECT_TGSI_DERIVATIVES_AFTER_KILL;