summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarek Olšák <marek.olsak@amd.com>2013-07-30 22:29:20 +0200
committerMarek Olšák <marek.olsak@amd.com>2013-07-30 23:31:24 +0200
commitdda936e057b01b6401de7747038d341332c6d128 (patch)
tree02f7c09a9e26eb381bd465f20fbdf4699fd1cf4b /src
parent772070527f6a6db72505575d6571470280a131ab (diff)
st/dri: move enabling postprocessing to dri_screen
The driconf options are global. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Brian Paul <brianp@vmware.com>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/state_trackers/dri/common/dri_context.c15
-rw-r--r--src/gallium/state_trackers/dri/common/dri_context.h2
-rw-r--r--src/gallium/state_trackers/dri/common/dri_screen.c13
-rw-r--r--src/gallium/state_trackers/dri/common/dri_screen.h4
4 files changed, 18 insertions, 16 deletions
diff --git a/src/gallium/state_trackers/dri/common/dri_context.c b/src/gallium/state_trackers/dri/common/dri_context.c
index ab80fc75bd4..66034915447 100644
--- a/src/gallium/state_trackers/dri/common/dri_context.c
+++ b/src/gallium/state_trackers/dri/common/dri_context.c
@@ -39,16 +39,6 @@
#include "pipe/p_context.h"
#include "state_tracker/st_context.h"
-static void
-dri_pp_query(struct dri_context *ctx)
-{
- unsigned int i;
-
- for (i = 0; i < PP_FILTERS; i++) {
- ctx->pp_enabled[i] = driQueryOptioni(&ctx->optionCache, pp_filters[i].name);
- }
-}
-
static void dri_fill_st_options(struct st_config_options *options,
const struct driOptionCache * optionCache)
{
@@ -156,11 +146,8 @@ dri_create_context(gl_api api, const struct gl_config * visual,
ctx->st->st_manager_private = (void *) ctx;
ctx->stapi = stapi;
- // Context successfully created. See if post-processing is requested.
- dri_pp_query(ctx);
-
if (ctx->st->cso_context) {
- ctx->pp = pp_init(ctx->st->pipe, ctx->pp_enabled, ctx->st->cso_context);
+ ctx->pp = pp_init(ctx->st->pipe, screen->pp_enabled, ctx->st->cso_context);
ctx->hud = hud_create(ctx->st->pipe, ctx->st->cso_context);
}
diff --git a/src/gallium/state_trackers/dri/common/dri_context.h b/src/gallium/state_trackers/dri/common/dri_context.h
index 5af2861377a..2734ee50daa 100644
--- a/src/gallium/state_trackers/dri/common/dri_context.h
+++ b/src/gallium/state_trackers/dri/common/dri_context.h
@@ -34,7 +34,6 @@
#include "dri_util.h"
#include "pipe/p_compiler.h"
-#include "postprocess/filters.h"
#include "hud/hud_context.h"
struct pipe_context;
@@ -59,7 +58,6 @@ struct dri_context
struct st_api *stapi;
struct st_context_iface *st;
struct pp_queue_t *pp;
- unsigned int pp_enabled[PP_FILTERS];
struct hud_context *hud;
};
diff --git a/src/gallium/state_trackers/dri/common/dri_screen.c b/src/gallium/state_trackers/dri/common/dri_screen.c
index f19998bb7ba..bb4d5b674d9 100644
--- a/src/gallium/state_trackers/dri/common/dri_screen.c
+++ b/src/gallium/state_trackers/dri/common/dri_screen.c
@@ -382,6 +382,17 @@ dri_destroy_screen(__DRIscreen * sPriv)
sPriv->extensions = NULL;
}
+static void
+dri_postprocessing_init(struct dri_screen *screen)
+{
+ unsigned i;
+
+ for (i = 0; i < PP_FILTERS; i++) {
+ screen->pp_enabled[i] = driQueryOptioni(&screen->optionCache,
+ pp_filters[i].name);
+ }
+}
+
const __DRIconfig **
dri_init_screen_helper(struct dri_screen *screen,
struct pipe_screen *pscreen)
@@ -426,6 +437,8 @@ dri_init_screen_helper(struct dri_screen *screen,
util_format_s3tc_enabled = TRUE;
}
+ dri_postprocessing_init(screen);
+
return dri_fill_in_modes(screen);
}
diff --git a/src/gallium/state_trackers/dri/common/dri_screen.h b/src/gallium/state_trackers/dri/common/dri_screen.h
index 859ebfd7f32..18ede869ad7 100644
--- a/src/gallium/state_trackers/dri/common/dri_screen.h
+++ b/src/gallium/state_trackers/dri/common/dri_screen.h
@@ -39,6 +39,7 @@
#include "pipe/p_context.h"
#include "pipe/p_state.h"
#include "state_tracker/st_api.h"
+#include "postprocess/filters.h"
struct dri_context;
struct dri_drawable;
@@ -63,6 +64,9 @@ struct dri_screen
/** The screen's effective configuration options */
driOptionCache optionCache;
+ /* Which postprocessing filters are enabled. */
+ unsigned pp_enabled[PP_FILTERS];
+
/* drm */
int fd;