summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2015-07-25 18:40:59 +0200
committerMarek Olšák <[email protected]>2015-08-26 19:25:18 +0200
commit0fc21ecfc0891d239f20bf7724e51bc75503570c (patch)
tree19ffd27a9700601cae150dd229518637e369eb98
parent7b5c92391f15533ec02327d617c4e8639a2f8bb4 (diff)
gallium: add flags parameter to pipe_screen::context_create
This allows creating compute-only and debug contexts. Reviewed-by: Brian Paul <[email protected]> Acked-by: Christian König <[email protected]> Acked-by: Alex Deucher <[email protected]>
-rw-r--r--src/gallium/auxiliary/util/u_tests.c2
-rw-r--r--src/gallium/auxiliary/vl/vl_mpeg12_decoder.c2
-rw-r--r--src/gallium/drivers/freedreno/a2xx/fd2_context.c2
-rw-r--r--src/gallium/drivers/freedreno/a2xx/fd2_context.h2
-rw-r--r--src/gallium/drivers/freedreno/a3xx/fd3_context.c2
-rw-r--r--src/gallium/drivers/freedreno/a3xx/fd3_context.h2
-rw-r--r--src/gallium/drivers/freedreno/a4xx/fd4_context.c2
-rw-r--r--src/gallium/drivers/freedreno/a4xx/fd4_context.h2
-rw-r--r--src/gallium/drivers/i915/i915_context.c2
-rw-r--r--src/gallium/drivers/i915/i915_context.h2
-rw-r--r--src/gallium/drivers/ilo/ilo_context.c2
-rw-r--r--src/gallium/drivers/llvmpipe/lp_context.c3
-rw-r--r--src/gallium/drivers/llvmpipe/lp_context.h3
-rw-r--r--src/gallium/drivers/noop/noop_pipe.c3
-rw-r--r--src/gallium/drivers/nouveau/nv30/nv30_context.c2
-rw-r--r--src/gallium/drivers/nouveau/nv30/nv30_context.h2
-rw-r--r--src/gallium/drivers/nouveau/nv50/nv50_context.c2
-rw-r--r--src/gallium/drivers/nouveau/nv50/nv50_context.h2
-rw-r--r--src/gallium/drivers/nouveau/nvc0/nvc0_context.c2
-rw-r--r--src/gallium/drivers/nouveau/nvc0/nvc0_context.h2
-rw-r--r--src/gallium/drivers/r300/r300_context.c2
-rw-r--r--src/gallium/drivers/r300/r300_context.h2
-rw-r--r--src/gallium/drivers/r600/r600_pipe.c5
-rw-r--r--src/gallium/drivers/radeonsi/si_pipe.c5
-rw-r--r--src/gallium/drivers/rbug/rbug_screen.c6
-rw-r--r--src/gallium/drivers/softpipe/sp_context.c4
-rw-r--r--src/gallium/drivers/softpipe/sp_context.h2
-rw-r--r--src/gallium/drivers/svga/svga_context.c4
-rw-r--r--src/gallium/drivers/svga/svga_context.h2
-rw-r--r--src/gallium/drivers/trace/tr_screen.c7
-rw-r--r--src/gallium/drivers/vc4/vc4_context.c2
-rw-r--r--src/gallium/drivers/vc4/vc4_context.h2
-rw-r--r--src/gallium/include/pipe/p_defines.h15
-rw-r--r--src/gallium/include/pipe/p_screen.h11
-rw-r--r--src/gallium/state_trackers/clover/core/queue.cpp2
-rw-r--r--src/gallium/state_trackers/glx/xlib/xm_st.c2
-rw-r--r--src/gallium/state_trackers/nine/device9.c2
-rw-r--r--src/gallium/state_trackers/omx/vid_dec.c2
-rw-r--r--src/gallium/state_trackers/omx/vid_enc.c4
-rw-r--r--src/gallium/state_trackers/va/context.c3
-rw-r--r--src/gallium/state_trackers/vdpau/device.c2
-rw-r--r--src/gallium/state_trackers/xa/xa_context.c2
-rw-r--r--src/gallium/state_trackers/xvmc/context.c2
-rw-r--r--src/gallium/tests/graw/clear.c2
-rw-r--r--src/gallium/tests/graw/fs-test.c2
-rw-r--r--src/gallium/tests/graw/graw_util.h2
-rw-r--r--src/gallium/tests/graw/gs-test.c2
-rw-r--r--src/gallium/tests/graw/quad-sample.c2
-rw-r--r--src/gallium/tests/graw/shader-leak.c2
-rw-r--r--src/gallium/tests/graw/tri-gs.c2
-rw-r--r--src/gallium/tests/graw/tri-instanced.c2
-rw-r--r--src/gallium/tests/graw/vs-test.c2
-rw-r--r--src/gallium/tests/trivial/compute.c2
-rw-r--r--src/gallium/tests/trivial/quad-tex.c2
-rw-r--r--src/gallium/tests/trivial/tri.c2
-rw-r--r--src/gallium/winsys/sw/wrapper/wrapper_sw_winsys.c2
-rw-r--r--src/mesa/state_tracker/st_manager.c2
57 files changed, 96 insertions, 65 deletions
diff --git a/src/gallium/auxiliary/util/u_tests.c b/src/gallium/auxiliary/util/u_tests.c
index 6a489d63c09..a94e5cc2949 100644
--- a/src/gallium/auxiliary/util/u_tests.c
+++ b/src/gallium/auxiliary/util/u_tests.c
@@ -457,7 +457,7 @@ null_constant_buffer(struct pipe_context *ctx)
void
util_run_tests(struct pipe_screen *screen)
{
- struct pipe_context *ctx = screen->context_create(screen, NULL);
+ struct pipe_context *ctx = screen->context_create(screen, NULL, 0);
tgsi_vs_window_space_position(ctx);
null_sampler_view(ctx, TGSI_TEXTURE_2D);
diff --git a/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c b/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c
index b7009837293..9d0e4a1eae0 100644
--- a/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c
+++ b/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c
@@ -1120,7 +1120,7 @@ vl_create_mpeg12_decoder(struct pipe_context *context,
dec->base = *templat;
dec->base.context = context;
- dec->context = context->screen->context_create(context->screen, NULL);
+ dec->context = context->screen->context_create(context->screen, NULL, 0);
dec->base.destroy = vl_mpeg12_destroy;
dec->base.begin_frame = vl_mpeg12_begin_frame;
diff --git a/src/gallium/drivers/freedreno/a2xx/fd2_context.c b/src/gallium/drivers/freedreno/a2xx/fd2_context.c
index 6089ebc1516..3bed73573a6 100644
--- a/src/gallium/drivers/freedreno/a2xx/fd2_context.c
+++ b/src/gallium/drivers/freedreno/a2xx/fd2_context.c
@@ -86,7 +86,7 @@ static const uint8_t a20x_primtypes[PIPE_PRIM_MAX] = {
};
struct pipe_context *
-fd2_context_create(struct pipe_screen *pscreen, void *priv)
+fd2_context_create(struct pipe_screen *pscreen, void *priv, unsigned flags)
{
struct fd_screen *screen = fd_screen(pscreen);
struct fd2_context *fd2_ctx = CALLOC_STRUCT(fd2_context);
diff --git a/src/gallium/drivers/freedreno/a2xx/fd2_context.h b/src/gallium/drivers/freedreno/a2xx/fd2_context.h
index 74147107930..eeadf84ff20 100644
--- a/src/gallium/drivers/freedreno/a2xx/fd2_context.h
+++ b/src/gallium/drivers/freedreno/a2xx/fd2_context.h
@@ -47,6 +47,6 @@ fd2_context(struct fd_context *ctx)
}
struct pipe_context *
-fd2_context_create(struct pipe_screen *pscreen, void *priv);
+fd2_context_create(struct pipe_screen *pscreen, void *priv, unsigned flags);
#endif /* FD2_CONTEXT_H_ */
diff --git a/src/gallium/drivers/freedreno/a3xx/fd3_context.c b/src/gallium/drivers/freedreno/a3xx/fd3_context.c
index dc33783e398..74cbbf2edd8 100644
--- a/src/gallium/drivers/freedreno/a3xx/fd3_context.c
+++ b/src/gallium/drivers/freedreno/a3xx/fd3_context.c
@@ -98,7 +98,7 @@ static const uint8_t primtypes[PIPE_PRIM_MAX] = {
};
struct pipe_context *
-fd3_context_create(struct pipe_screen *pscreen, void *priv)
+fd3_context_create(struct pipe_screen *pscreen, void *priv, unsigned flags)
{
struct fd_screen *screen = fd_screen(pscreen);
struct fd3_context *fd3_ctx = CALLOC_STRUCT(fd3_context);
diff --git a/src/gallium/drivers/freedreno/a3xx/fd3_context.h b/src/gallium/drivers/freedreno/a3xx/fd3_context.h
index 6e20b2ff9bc..250bcf89596 100644
--- a/src/gallium/drivers/freedreno/a3xx/fd3_context.h
+++ b/src/gallium/drivers/freedreno/a3xx/fd3_context.h
@@ -119,6 +119,6 @@ fd3_context(struct fd_context *ctx)
}
struct pipe_context *
-fd3_context_create(struct pipe_screen *pscreen, void *priv);
+fd3_context_create(struct pipe_screen *pscreen, void *priv, unsigned flags);
#endif /* FD3_CONTEXT_H_ */
diff --git a/src/gallium/drivers/freedreno/a4xx/fd4_context.c b/src/gallium/drivers/freedreno/a4xx/fd4_context.c
index e172d350517..625512ccd1b 100644
--- a/src/gallium/drivers/freedreno/a4xx/fd4_context.c
+++ b/src/gallium/drivers/freedreno/a4xx/fd4_context.c
@@ -96,7 +96,7 @@ static const uint8_t primtypes[PIPE_PRIM_MAX] = {
};
struct pipe_context *
-fd4_context_create(struct pipe_screen *pscreen, void *priv)
+fd4_context_create(struct pipe_screen *pscreen, void *priv, unsigned flags)
{
struct fd_screen *screen = fd_screen(pscreen);
struct fd4_context *fd4_ctx = CALLOC_STRUCT(fd4_context);
diff --git a/src/gallium/drivers/freedreno/a4xx/fd4_context.h b/src/gallium/drivers/freedreno/a4xx/fd4_context.h
index 0b749916841..af9475699db 100644
--- a/src/gallium/drivers/freedreno/a4xx/fd4_context.h
+++ b/src/gallium/drivers/freedreno/a4xx/fd4_context.h
@@ -97,6 +97,6 @@ fd4_context(struct fd_context *ctx)
}
struct pipe_context *
-fd4_context_create(struct pipe_screen *pscreen, void *priv);
+fd4_context_create(struct pipe_screen *pscreen, void *priv, unsigned flags);
#endif /* FD4_CONTEXT_H_ */
diff --git a/src/gallium/drivers/i915/i915_context.c b/src/gallium/drivers/i915/i915_context.c
index 788381bbe2e..05f8e93ddea 100644
--- a/src/gallium/drivers/i915/i915_context.c
+++ b/src/gallium/drivers/i915/i915_context.c
@@ -155,7 +155,7 @@ static void i915_destroy(struct pipe_context *pipe)
}
struct pipe_context *
-i915_create_context(struct pipe_screen *screen, void *priv)
+i915_create_context(struct pipe_screen *screen, void *priv, unsigned flags)
{
struct i915_context *i915;
diff --git a/src/gallium/drivers/i915/i915_context.h b/src/gallium/drivers/i915/i915_context.h
index c8c7d64f5cb..1ed685188db 100644
--- a/src/gallium/drivers/i915/i915_context.h
+++ b/src/gallium/drivers/i915/i915_context.h
@@ -401,7 +401,7 @@ void i915_init_string_functions( struct i915_context *i915 );
* i915_context.c
*/
struct pipe_context *i915_create_context(struct pipe_screen *screen,
- void *priv);
+ void *priv, unsigned flags);
/***********************************************************************
diff --git a/src/gallium/drivers/ilo/ilo_context.c b/src/gallium/drivers/ilo/ilo_context.c
index b9a16aab81d..2a00cf1c93c 100644
--- a/src/gallium/drivers/ilo/ilo_context.c
+++ b/src/gallium/drivers/ilo/ilo_context.c
@@ -135,7 +135,7 @@ ilo_context_destroy(struct pipe_context *pipe)
}
static struct pipe_context *
-ilo_context_create(struct pipe_screen *screen, void *priv)
+ilo_context_create(struct pipe_screen *screen, void *priv, unsigned flags)
{
struct ilo_screen *is = ilo_screen(screen);
struct ilo_context *ilo;
diff --git a/src/gallium/drivers/llvmpipe/lp_context.c b/src/gallium/drivers/llvmpipe/lp_context.c
index 80cb6578bd1..bd7c0a1e4af 100644
--- a/src/gallium/drivers/llvmpipe/lp_context.c
+++ b/src/gallium/drivers/llvmpipe/lp_context.c
@@ -128,7 +128,8 @@ llvmpipe_render_condition ( struct pipe_context *pipe,
}
struct pipe_context *
-llvmpipe_create_context( struct pipe_screen *screen, void *priv )
+llvmpipe_create_context(struct pipe_screen *screen, void *priv,
+ unsigned flags)
{
struct llvmpipe_context *llvmpipe;
diff --git a/src/gallium/drivers/llvmpipe/lp_context.h b/src/gallium/drivers/llvmpipe/lp_context.h
index c273b25f096..c9a5d678244 100644
--- a/src/gallium/drivers/llvmpipe/lp_context.h
+++ b/src/gallium/drivers/llvmpipe/lp_context.h
@@ -160,7 +160,8 @@ struct llvmpipe_context {
struct pipe_context *
-llvmpipe_create_context( struct pipe_screen *screen, void *priv );
+llvmpipe_create_context(struct pipe_screen *screen, void *priv,
+ unsigned flags);
struct pipe_resource *
llvmpipe_user_buffer_create(struct pipe_screen *screen,
diff --git a/src/gallium/drivers/noop/noop_pipe.c b/src/gallium/drivers/noop/noop_pipe.c
index aeec6778b6d..e644685123e 100644
--- a/src/gallium/drivers/noop/noop_pipe.c
+++ b/src/gallium/drivers/noop/noop_pipe.c
@@ -260,7 +260,8 @@ static void noop_destroy_context(struct pipe_context *ctx)
FREE(ctx);
}
-static struct pipe_context *noop_create_context(struct pipe_screen *screen, void *priv)
+static struct pipe_context *noop_create_context(struct pipe_screen *screen,
+ void *priv, unsigned flags)
{
struct pipe_context *ctx = CALLOC_STRUCT(pipe_context);
diff --git a/src/gallium/drivers/nouveau/nv30/nv30_context.c b/src/gallium/drivers/nouveau/nv30/nv30_context.c
index 6e88ed725d6..46590eecdf3 100644
--- a/src/gallium/drivers/nouveau/nv30/nv30_context.c
+++ b/src/gallium/drivers/nouveau/nv30/nv30_context.c
@@ -190,7 +190,7 @@ nv30_context_destroy(struct pipe_context *pipe)
} while(0)
struct pipe_context *
-nv30_context_create(struct pipe_screen *pscreen, void *priv)
+nv30_context_create(struct pipe_screen *pscreen, void *priv, unsigned flags)
{
struct nv30_screen *screen = nv30_screen(pscreen);
struct nv30_context *nv30 = CALLOC_STRUCT(nv30_context);
diff --git a/src/gallium/drivers/nouveau/nv30/nv30_context.h b/src/gallium/drivers/nouveau/nv30/nv30_context.h
index d5c18bb62dc..0ab2f95bc20 100644
--- a/src/gallium/drivers/nouveau/nv30/nv30_context.h
+++ b/src/gallium/drivers/nouveau/nv30/nv30_context.h
@@ -132,7 +132,7 @@ nv30_context(struct pipe_context *pipe)
}
struct pipe_context *
-nv30_context_create(struct pipe_screen *pscreen, void *priv);
+nv30_context_create(struct pipe_screen *pscreen, void *priv, unsigned flags);
void
nv30_vbo_init(struct pipe_context *pipe);
diff --git a/src/gallium/drivers/nouveau/nv50/nv50_context.c b/src/gallium/drivers/nouveau/nv50/nv50_context.c
index f8d46db7c67..11638dd7f14 100644
--- a/src/gallium/drivers/nouveau/nv50/nv50_context.c
+++ b/src/gallium/drivers/nouveau/nv50/nv50_context.c
@@ -240,7 +240,7 @@ nv50_context_get_sample_position(struct pipe_context *, unsigned, unsigned,
float *);
struct pipe_context *
-nv50_create(struct pipe_screen *pscreen, void *priv)
+nv50_create(struct pipe_screen *pscreen, void *priv, unsigned flags)
{
struct nv50_screen *screen = nv50_screen(pscreen);
struct nv50_context *nv50;
diff --git a/src/gallium/drivers/nouveau/nv50/nv50_context.h b/src/gallium/drivers/nouveau/nv50/nv50_context.h
index ce12e714774..e7adf472ed0 100644
--- a/src/gallium/drivers/nouveau/nv50/nv50_context.h
+++ b/src/gallium/drivers/nouveau/nv50/nv50_context.h
@@ -186,7 +186,7 @@ nv50_context_shader_stage(unsigned pipe)
}
/* nv50_context.c */
-struct pipe_context *nv50_create(struct pipe_screen *, void *);
+struct pipe_context *nv50_create(struct pipe_screen *, void *, unsigned flags);
void nv50_bufctx_fence(struct nouveau_bufctx *, bool on_flush);
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_context.c b/src/gallium/drivers/nouveau/nvc0/nvc0_context.c
index 7a15a11f560..613cad69aa5 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_context.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_context.c
@@ -262,7 +262,7 @@ nvc0_context_get_sample_position(struct pipe_context *, unsigned, unsigned,
float *);
struct pipe_context *
-nvc0_create(struct pipe_screen *pscreen, void *priv)
+nvc0_create(struct pipe_screen *pscreen, void *priv, unsigned flags)
{
struct nvc0_screen *screen = nvc0_screen(pscreen);
struct nvc0_context *nvc0;
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_context.h b/src/gallium/drivers/nouveau/nvc0/nvc0_context.h
index df1a891a43e..6ed79cf9553 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_context.h
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_context.h
@@ -214,7 +214,7 @@ nvc0_shader_stage(unsigned pipe)
/* nvc0_context.c */
-struct pipe_context *nvc0_create(struct pipe_screen *, void *);
+struct pipe_context *nvc0_create(struct pipe_screen *, void *, unsigned flags);
void nvc0_bufctx_fence(struct nvc0_context *, struct nouveau_bufctx *,
bool on_flush);
void nvc0_default_kick_notify(struct nouveau_pushbuf *);
diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c
index 8c24ad6d98a..b393769c861 100644
--- a/src/gallium/drivers/r300/r300_context.c
+++ b/src/gallium/drivers/r300/r300_context.c
@@ -363,7 +363,7 @@ static void r300_init_states(struct pipe_context *pipe)
}
struct pipe_context* r300_create_context(struct pipe_screen* screen,
- void *priv)
+ void *priv, unsigned flags)
{
struct r300_context* r300 = CALLOC_STRUCT(r300_context);
struct r300_screen* r300screen = r300_screen(screen);
diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h
index 18ae11a3a24..f298d88004b 100644
--- a/src/gallium/drivers/r300/r300_context.h
+++ b/src/gallium/drivers/r300/r300_context.h
@@ -705,7 +705,7 @@ r300_get_nonnull_cb(struct pipe_framebuffer_state *fb, unsigned i)
}
struct pipe_context* r300_create_context(struct pipe_screen* screen,
- void *priv);
+ void *priv, unsigned flags);
/* Context initialization. */
struct draw_stage* r300_draw_stage(struct r300_context* r300);
diff --git a/src/gallium/drivers/r600/r600_pipe.c b/src/gallium/drivers/r600/r600_pipe.c
index 6ffe5615fbf..f6efaa312f2 100644
--- a/src/gallium/drivers/r600/r600_pipe.c
+++ b/src/gallium/drivers/r600/r600_pipe.c
@@ -108,7 +108,8 @@ static void r600_destroy_context(struct pipe_context *context)
FREE(rctx);
}
-static struct pipe_context *r600_create_context(struct pipe_screen *screen, void *priv)
+static struct pipe_context *r600_create_context(struct pipe_screen *screen,
+ void *priv, unsigned flags)
{
struct r600_context *rctx = CALLOC_STRUCT(r600_context);
struct r600_screen* rscreen = (struct r600_screen *)screen;
@@ -624,7 +625,7 @@ struct pipe_screen *r600_screen_create(struct radeon_winsys *ws)
rscreen->global_pool = compute_memory_pool_new(rscreen);
/* Create the auxiliary context. This must be done last. */
- rscreen->b.aux_context = rscreen->b.b.context_create(&rscreen->b.b, NULL);
+ rscreen->b.aux_context = rscreen->b.b.context_create(&rscreen->b.b, NULL, 0);
#if 0 /* This is for testing whether aux_context and buffer clearing work correctly. */
struct pipe_resource templ = {};
diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c
index 473a2e9ad12..029b3cce488 100644
--- a/src/gallium/drivers/radeonsi/si_pipe.c
+++ b/src/gallium/drivers/radeonsi/si_pipe.c
@@ -92,7 +92,8 @@ si_amdgpu_get_reset_status(struct pipe_context *ctx)
return sctx->b.ws->ctx_query_reset_status(sctx->b.ctx);
}
-static struct pipe_context *si_create_context(struct pipe_screen *screen, void *priv)
+static struct pipe_context *si_create_context(struct pipe_screen *screen,
+ void *priv, unsigned flags)
{
struct si_context *sctx = CALLOC_STRUCT(si_context);
struct si_screen* sscreen = (struct si_screen *)screen;
@@ -586,7 +587,7 @@ struct pipe_screen *radeonsi_screen_create(struct radeon_winsys *ws)
sscreen->b.debug_flags |= DBG_FS | DBG_VS | DBG_GS | DBG_PS | DBG_CS;
/* Create the auxiliary context. This must be done last. */
- sscreen->b.aux_context = sscreen->b.b.context_create(&sscreen->b.b, NULL);
+ sscreen->b.aux_context = sscreen->b.b.context_create(&sscreen->b.b, NULL, 0);
return &sscreen->b.b;
}
diff --git a/src/gallium/drivers/rbug/rbug_screen.c b/src/gallium/drivers/rbug/rbug_screen.c
index 7da4e81560a..ac764029a2f 100644
--- a/src/gallium/drivers/rbug/rbug_screen.c
+++ b/src/gallium/drivers/rbug/rbug_screen.c
@@ -129,13 +129,13 @@ rbug_screen_is_format_supported(struct pipe_screen *_screen,
static struct pipe_context *
rbug_screen_context_create(struct pipe_screen *_screen,
- void *priv)
+ void *priv, unsigned flags)
{
struct rbug_screen *rb_screen = rbug_screen(_screen);
struct pipe_screen *screen = rb_screen->screen;
struct pipe_context *result;
- result = screen->context_create(screen, priv);
+ result = screen->context_create(screen, priv, flags);
if (result)
return rbug_context_create(_screen, result);
return NULL;
@@ -281,7 +281,7 @@ rbug_screen_create(struct pipe_screen *screen)
rb_screen->screen = screen;
- rb_screen->private_context = screen->context_create(screen, NULL);
+ rb_screen->private_context = screen->context_create(screen, NULL, 0);
if (!rb_screen->private_context)
goto err_free;
diff --git a/src/gallium/drivers/softpipe/sp_context.c b/src/gallium/drivers/softpipe/sp_context.c
index 34d2b80f19b..d2a32200e47 100644
--- a/src/gallium/drivers/softpipe/sp_context.c
+++ b/src/gallium/drivers/softpipe/sp_context.c
@@ -186,8 +186,8 @@ softpipe_render_condition( struct pipe_context *pipe,
struct pipe_context *
-softpipe_create_context( struct pipe_screen *screen,
- void *priv )
+softpipe_create_context(struct pipe_screen *screen,
+ void *priv, unsigned flags)
{
struct softpipe_screen *sp_screen = softpipe_screen(screen);
struct softpipe_context *softpipe = CALLOC_STRUCT(softpipe_context);
diff --git a/src/gallium/drivers/softpipe/sp_context.h b/src/gallium/drivers/softpipe/sp_context.h
index 577df814b29..073b71a913e 100644
--- a/src/gallium/drivers/softpipe/sp_context.h
+++ b/src/gallium/drivers/softpipe/sp_context.h
@@ -211,7 +211,7 @@ softpipe_context( struct pipe_context *pipe )
struct pipe_context *
-softpipe_create_context( struct pipe_screen *, void *priv );
+softpipe_create_context(struct pipe_screen *, void *priv, unsigned flags);
struct pipe_resource *
softpipe_user_buffer_create(struct pipe_screen *screen,
diff --git a/src/gallium/drivers/svga/svga_context.c b/src/gallium/drivers/svga/svga_context.c
index 0ffff9c506b..673d17ad4a7 100644
--- a/src/gallium/drivers/svga/svga_context.c
+++ b/src/gallium/drivers/svga/svga_context.c
@@ -81,8 +81,8 @@ static void svga_destroy( struct pipe_context *pipe )
-struct pipe_context *svga_context_create( struct pipe_screen *screen,
- void *priv )
+struct pipe_context *svga_context_create(struct pipe_screen *screen,
+ void *priv, unsigned flags)
{
struct svga_screen *svgascreen = svga_screen(screen);
struct svga_context *svga = NULL;
diff --git a/src/gallium/drivers/svga/svga_context.h b/src/gallium/drivers/svga/svga_context.h
index 71f038df8c1..2726346bc50 100644
--- a/src/gallium/drivers/svga/svga_context.h
+++ b/src/gallium/drivers/svga/svga_context.h
@@ -478,7 +478,7 @@ void svga_surfaces_flush(struct svga_context *svga);
struct pipe_context *
svga_context_create(struct pipe_screen *screen,
- void *priv);
+ void *priv, unsigned flags);
/***********************************************************************
diff --git a/src/gallium/drivers/trace/tr_screen.c b/src/gallium/drivers/trace/tr_screen.c
index 1d86a378eea..8b02680c77e 100644
--- a/src/gallium/drivers/trace/tr_screen.c
+++ b/src/gallium/drivers/trace/tr_screen.c
@@ -204,7 +204,8 @@ trace_screen_is_format_supported(struct pipe_screen *_screen,
static struct pipe_context *
-trace_screen_context_create(struct pipe_screen *_screen, void *priv)
+trace_screen_context_create(struct pipe_screen *_screen, void *priv,
+ unsigned flags)
{
struct trace_screen *tr_scr = trace_screen(_screen);
struct pipe_screen *screen = tr_scr->screen;
@@ -213,8 +214,10 @@ trace_screen_context_create(struct pipe_screen *_screen, void *priv)
trace_dump_call_begin("pipe_screen", "context_create");
trace_dump_arg(ptr, screen);
+ trace_dump_arg(ptr, priv);
+ trace_dump_arg(uint, flags);
- result = screen->context_create(screen, priv);
+ result = screen->context_create(screen, priv, flags);
trace_dump_ret(ptr, result);
diff --git a/src/gallium/drivers/vc4/vc4_context.c b/src/gallium/drivers/vc4/vc4_context.c
index fff63158c9d..87d781d088d 100644
--- a/src/gallium/drivers/vc4/vc4_context.c
+++ b/src/gallium/drivers/vc4/vc4_context.c
@@ -194,7 +194,7 @@ vc4_context_destroy(struct pipe_context *pctx)
}
struct pipe_context *
-vc4_context_create(struct pipe_screen *pscreen, void *priv)
+vc4_context_create(struct pipe_screen *pscreen, void *priv, unsigned flags)
{
struct vc4_screen *screen = vc4_screen(pscreen);
struct vc4_context *vc4;
diff --git a/src/gallium/drivers/vc4/vc4_context.h b/src/gallium/drivers/vc4/vc4_context.h
index 3a63af8f2b0..33b6ec2b92d 100644
--- a/src/gallium/drivers/vc4/vc4_context.h
+++ b/src/gallium/drivers/vc4/vc4_context.h
@@ -365,7 +365,7 @@ vc4_sampler_state(struct pipe_sampler_state *psampler)
}
struct pipe_context *vc4_context_create(struct pipe_screen *pscreen,
- void *priv);
+ void *priv, unsigned flags);
void vc4_draw_init(struct pipe_context *pctx);
void vc4_state_init(struct pipe_context *pctx);
void vc4_program_init(struct pipe_context *pctx);
diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h
index 4f2aa14e129..88e37e9f056 100644
--- a/src/gallium/include/pipe/p_defines.h
+++ b/src/gallium/include/pipe/p_defines.h
@@ -334,6 +334,21 @@ enum pipe_flush_flags
#define PIPE_DEBUG_DEVICE_IS_HUNG (1 << 0)
/**
+ * Create a compute-only context. Use in pipe_screen::context_create.
+ * This disables draw, blit, and clear*, render_condition, and other graphics
+ * functions. Interop with other graphics contexts is still allowed.
+ * This allows scheduling jobs on a compute-only hardware command queue that
+ * can run in parallel with graphics without stalling it.
+ */
+#define PIPE_CONTEXT_COMPUTE_ONLY (1 << 0)
+
+/**
+ * Gather debug information and expect that pipe_context::dump_debug_state
+ * will be called. Use in pipe_screen::context_create.
+ */
+#define PIPE_CONTEXT_DEBUG (1 << 1)
+
+/**
* Flags for pipe_context::memory_barrier.
*/
#define PIPE_BARRIER_MAPPED_BUFFER (1 << 0)
diff --git a/src/gallium/include/pipe/p_screen.h b/src/gallium/include/pipe/p_screen.h
index 0d2658313e5..a7b7b72ac89 100644
--- a/src/gallium/include/pipe/p_screen.h
+++ b/src/gallium/include/pipe/p_screen.h
@@ -125,8 +125,15 @@ struct pipe_screen {
*/
uint64_t (*get_timestamp)(struct pipe_screen *);
- struct pipe_context * (*context_create)( struct pipe_screen *,
- void *priv );
+ /**
+ * Create a context.
+ *
+ * \param screen pipe screen
+ * \param priv a pointer to set in pipe_context::priv
+ * \param flags a mask of PIPE_CONTEXT_* flags
+ */
+ struct pipe_context * (*context_create)(struct pipe_screen *screen,
+ void *priv, unsigned flags);
/**
* Check if the given pipe_format is supported as a texture or
diff --git a/src/gallium/state_trackers/clover/core/queue.cpp b/src/gallium/state_trackers/clover/core/queue.cpp
index 87f9dcc6476..4aaf67de241 100644
--- a/src/gallium/state_trackers/clover/core/queue.cpp
+++ b/src/gallium/state_trackers/clover/core/queue.cpp
@@ -30,7 +30,7 @@ using namespace clover;
command_queue::command_queue(clover::context &ctx, clover::device &dev,
cl_command_queue_properties props) :
context(ctx), device(dev), props(props) {
- pipe = dev.pipe->context_create(dev.pipe, NULL);
+ pipe = dev.pipe->context_create(dev.pipe, NULL, PIPE_CONTEXT_COMPUTE_ONLY);
if (!pipe)
throw error(CL_INVALID_DEVICE);
}
diff --git a/src/gallium/state_trackers/glx/xlib/xm_st.c b/src/gallium/state_trackers/glx/xlib/xm_st.c
index 9d0f2d25025..f598430dc26 100644
--- a/src/gallium/state_trackers/glx/xlib/xm_st.c
+++ b/src/gallium/state_trackers/glx/xlib/xm_st.c
@@ -398,7 +398,7 @@ xmesa_get_context(struct st_framebuffer_iface *stfbi)
pipe = xstfb->display->pipe;
if (!pipe) {
- pipe = xstfb->screen->context_create(xstfb->screen, NULL);
+ pipe = xstfb->screen->context_create(xstfb->screen, NULL, 0);
if (!pipe)
return NULL;
xstfb->display->pipe = pipe;
diff --git a/src/gallium/state_trackers/nine/device9.c b/src/gallium/state_trackers/nine/device9.c
index 99197a4361b..f14ffea13e1 100644
--- a/src/gallium/state_trackers/nine/device9.c
+++ b/src/gallium/state_trackers/nine/device9.c
@@ -163,7 +163,7 @@ NineDevice9_ctor( struct NineDevice9 *This,
if (This->params.BehaviorFlags & D3DCREATE_MIXED_VERTEXPROCESSING)
DBG("Application asked mixed Software Vertex Processing. Ignoring.\n");
- This->pipe = This->screen->context_create(This->screen, NULL);
+ This->pipe = This->screen->context_create(This->screen, NULL, 0);
if (!This->pipe) { return E_OUTOFMEMORY; } /* guess */
This->cso = cso_create_context(This->pipe);
diff --git a/src/gallium/state_trackers/omx/vid_dec.c b/src/gallium/state_trackers/omx/vid_dec.c
index 9e7e7ba7787..5584348761e 100644
--- a/src/gallium/state_trackers/omx/vid_dec.c
+++ b/src/gallium/state_trackers/omx/vid_dec.c
@@ -162,7 +162,7 @@ static OMX_ERRORTYPE vid_dec_Constructor(OMX_COMPONENTTYPE *comp, OMX_STRING nam
return OMX_ErrorInsufficientResources;
screen = priv->screen->pscreen;
- priv->pipe = screen->context_create(screen, priv->screen);
+ priv->pipe = screen->context_create(screen, priv->screen, 0);
if (!priv->pipe)
return OMX_ErrorInsufficientResources;
diff --git a/src/gallium/state_trackers/omx/vid_enc.c b/src/gallium/state_trackers/omx/vid_enc.c
index 2bd0194189f..aa45089ae04 100644
--- a/src/gallium/state_trackers/omx/vid_enc.c
+++ b/src/gallium/state_trackers/omx/vid_enc.c
@@ -185,7 +185,7 @@ static OMX_ERRORTYPE vid_enc_Constructor(OMX_COMPONENTTYPE *comp, OMX_STRING nam
PIPE_VIDEO_ENTRYPOINT_ENCODE,
PIPE_VIDEO_CAP_STACKED_FRAMES);
- priv->s_pipe = screen->context_create(screen, priv->screen);
+ priv->s_pipe = screen->context_create(screen, priv->screen, 0);
if (!priv->s_pipe)
return OMX_ErrorInsufficientResources;
@@ -202,7 +202,7 @@ static OMX_ERRORTYPE vid_enc_Constructor(OMX_COMPONENTTYPE *comp, OMX_STRING nam
return OMX_ErrorInsufficientResources;
}
- priv->t_pipe = screen->context_create(screen, priv->screen);
+ priv->t_pipe = screen->context_create(screen, priv->screen, 0);
if (!priv->t_pipe)
return OMX_ErrorInsufficientResources;
diff --git a/src/gallium/state_trackers/va/context.c b/src/gallium/state_trackers/va/context.c
index 0a733b39004..8b003aedaec 100644
--- a/src/gallium/state_trackers/va/context.c
+++ b/src/gallium/state_trackers/va/context.c
@@ -100,7 +100,8 @@ VA_DRIVER_INIT_FUNC(VADriverContextP ctx)
if (!drv->vscreen)
goto error_screen;
- drv->pipe = drv->vscreen->pscreen->context_create(drv->vscreen->pscreen, drv->vscreen);
+ drv->pipe = drv->vscreen->pscreen->context_create(drv->vscreen->pscreen,
+ drv->vscreen, 0);
if (!drv->pipe)
goto error_pipe;
diff --git a/src/gallium/state_trackers/vdpau/device.c b/src/gallium/state_trackers/vdpau/device.c
index ba36afc9421..31c95054f56 100644
--- a/src/gallium/state_trackers/vdpau/device.c
+++ b/src/gallium/state_trackers/vdpau/device.c
@@ -70,7 +70,7 @@ vdp_imp_device_create_x11(Display *display, int screen, VdpDevice *device,
}
pscreen = dev->vscreen->pscreen;
- dev->context = pscreen->context_create(pscreen, dev->vscreen);
+ dev->context = pscreen->context_create(pscreen, dev->vscreen, 0);
if (!dev->context) {
ret = VDP_STATUS_RESOURCES;
goto no_context;
diff --git a/src/gallium/state_trackers/xa/xa_context.c b/src/gallium/state_trackers/xa/xa_context.c
index ebfb290af13..5553beb2014 100644
--- a/src/gallium/state_trackers/xa/xa_context.c
+++ b/src/gallium/state_trackers/xa/xa_context.c
@@ -56,7 +56,7 @@ xa_context_create(struct xa_tracker *xa)
struct xa_context *ctx = calloc(1, sizeof(*ctx));
ctx->xa = xa;
- ctx->pipe = xa->screen->context_create(xa->screen, NULL);
+ ctx->pipe = xa->screen->context_create(xa->screen, NULL, 0);
ctx->cso = cso_create_context(ctx->pipe);
ctx->shaders = xa_shaders_create(ctx);
renderer_init_state(ctx);
diff --git a/src/gallium/state_trackers/xvmc/context.c b/src/gallium/state_trackers/xvmc/context.c
index 9ded2e5f2e2..4702b44d1f4 100644
--- a/src/gallium/state_trackers/xvmc/context.c
+++ b/src/gallium/state_trackers/xvmc/context.c
@@ -237,7 +237,7 @@ Status XvMCCreateContext(Display *dpy, XvPortID port, int surface_type_id,
return BadAlloc;
}
- pipe = vscreen->pscreen->context_create(vscreen->pscreen, vscreen);
+ pipe = vscreen->pscreen->context_create(vscreen->pscreen, vscreen, 0);
if (!pipe) {
XVMC_MSG(XVMC_ERR, "[XvMC] Could not create VL context.\n");
vl_screen_destroy(vscreen);
diff --git a/src/gallium/tests/graw/clear.c b/src/gallium/tests/graw/clear.c
index f38da47407f..533ce9f58d0 100644
--- a/src/gallium/tests/graw/clear.c
+++ b/src/gallium/tests/graw/clear.c
@@ -61,7 +61,7 @@ static void init( void )
exit(1);
}
- ctx = screen->context_create(screen, NULL);
+ ctx = screen->context_create(screen, NULL, 0);
if (ctx == NULL)
exit(3);
diff --git a/src/gallium/tests/graw/fs-test.c b/src/gallium/tests/graw/fs-test.c
index fc5803fd3a9..bd5259afe46 100644
--- a/src/gallium/tests/graw/fs-test.c
+++ b/src/gallium/tests/graw/fs-test.c
@@ -398,7 +398,7 @@ static void init( void )
exit(1);
}
- ctx = screen->context_create(screen, NULL);
+ ctx = screen->context_create(screen, NULL, 0);
if (ctx == NULL)
exit(3);
diff --git a/src/gallium/tests/graw/graw_util.h b/src/gallium/tests/graw/graw_util.h
index e7cd0aa3ac3..f09c1eadc9c 100644
--- a/src/gallium/tests/graw/graw_util.h
+++ b/src/gallium/tests/graw/graw_util.h
@@ -60,7 +60,7 @@ graw_util_create_window(struct graw_info *info,
return FALSE;
}
- info->ctx = info->screen->context_create(info->screen, NULL);
+ info->ctx = info->screen->context_create(info->screen, NULL, 0);
if (info->ctx == NULL) {
debug_printf("graw: Failed to create context\n");
return FALSE;
diff --git a/src/gallium/tests/graw/gs-test.c b/src/gallium/tests/graw/gs-test.c
index b685323fe3c..c680b62eaaa 100644
--- a/src/gallium/tests/graw/gs-test.c
+++ b/src/gallium/tests/graw/gs-test.c
@@ -505,7 +505,7 @@ static void init( void )
exit(1);
}
- ctx = screen->context_create(screen, NULL);
+ ctx = screen->context_create(screen, NULL, 0);
if (ctx == NULL)
exit(3);
diff --git a/src/gallium/tests/graw/quad-sample.c b/src/gallium/tests/graw/quad-sample.c
index 2953fe16a8a..97f241ff844 100644
--- a/src/gallium/tests/graw/quad-sample.c
+++ b/src/gallium/tests/graw/quad-sample.c
@@ -313,7 +313,7 @@ static void init( void )
exit(1);
}
- ctx = screen->context_create(screen, NULL);
+ ctx = screen->context_create(screen, NULL, 0);
if (ctx == NULL)
exit(3);
diff --git a/src/gallium/tests/graw/shader-leak.c b/src/gallium/tests/graw/shader-leak.c
index 3c585c0a5a6..a4502afff64 100644
--- a/src/gallium/tests/graw/shader-leak.c
+++ b/src/gallium/tests/graw/shader-leak.c
@@ -188,7 +188,7 @@ static void init( void )
exit(1);
}
- ctx = screen->context_create(screen, NULL);
+ ctx = screen->context_create(screen, NULL, 0);
if (ctx == NULL)
exit(3);
diff --git a/src/gallium/tests/graw/tri-gs.c b/src/gallium/tests/graw/tri-gs.c
index 5c6f426e96a..6aad51c94a0 100644
--- a/src/gallium/tests/graw/tri-gs.c
+++ b/src/gallium/tests/graw/tri-gs.c
@@ -195,7 +195,7 @@ static void init( void )
exit(1);
}
- ctx = screen->context_create(screen, NULL);
+ ctx = screen->context_create(screen, NULL, 0);
if (ctx == NULL)
exit(3);
diff --git a/src/gallium/tests/graw/tri-instanced.c b/src/gallium/tests/graw/tri-instanced.c
index a71bf71b61b..2065c11f68d 100644
--- a/src/gallium/tests/graw/tri-instanced.c
+++ b/src/gallium/tests/graw/tri-instanced.c
@@ -246,7 +246,7 @@ static void init( void )
exit(1);
}
- ctx = screen->context_create(screen, NULL);
+ ctx = screen->context_create(screen, NULL, 0);
if (ctx == NULL)
exit(3);
diff --git a/src/gallium/tests/graw/vs-test.c b/src/gallium/tests/graw/vs-test.c
index 5189d815f4c..5c7843eb11a 100644
--- a/src/gallium/tests/graw/vs-test.c
+++ b/src/gallium/tests/graw/vs-test.c
@@ -392,7 +392,7 @@ static void init( void )
exit(1);
}
- ctx = screen->context_create(screen, NULL);
+ ctx = screen->context_create(screen, NULL, 0);
if (ctx == NULL)
exit(3);
diff --git a/src/gallium/tests/trivial/compute.c b/src/gallium/tests/trivial/compute.c
index 4edb8576f52..b344f78b25c 100644
--- a/src/gallium/tests/trivial/compute.c
+++ b/src/gallium/tests/trivial/compute.c
@@ -77,7 +77,7 @@ static void init_ctx(struct context *ctx)
ctx->screen = pipe_loader_create_screen(ctx->dev, PIPE_SEARCH_DIR);
assert(ctx->screen);
- ctx->pipe = ctx->screen->context_create(ctx->screen, NULL);
+ ctx->pipe = ctx->screen->context_create(ctx->screen, NULL, 0);
assert(ctx->pipe);
DUMP_COMPUTE_PARAM(p, PIPE_COMPUTE_CAP_GRID_DIMENSION);
diff --git a/src/gallium/tests/trivial/quad-tex.c b/src/gallium/tests/trivial/quad-tex.c
index c019c7bb0a3..f66f63043da 100644
--- a/src/gallium/tests/trivial/quad-tex.c
+++ b/src/gallium/tests/trivial/quad-tex.c
@@ -100,7 +100,7 @@ static void init_prog(struct program *p)
assert(p->screen);
/* create the pipe driver context and cso context */
- p->pipe = p->screen->context_create(p->screen, NULL);
+ p->pipe = p->screen->context_create(p->screen, NULL, 0);
p->cso = cso_create_context(p->pipe);
/* set clear color */
diff --git a/src/gallium/tests/trivial/tri.c b/src/gallium/tests/trivial/tri.c
index 078beb8f43f..a555200842e 100644
--- a/src/gallium/tests/trivial/tri.c
+++ b/src/gallium/tests/trivial/tri.c
@@ -95,7 +95,7 @@ static void init_prog(struct program *p)
assert(p->screen);
/* create the pipe driver context and cso context */
- p->pipe = p->screen->context_create(p->screen, NULL);
+ p->pipe = p->screen->context_create(p->screen, NULL, 0);
p->cso = cso_create_context(p->pipe);
/* set clear color */
diff --git a/src/gallium/winsys/sw/wrapper/wrapper_sw_winsys.c b/src/gallium/winsys/sw/wrapper/wrapper_sw_winsys.c
index 9b90eaa018b..5c179930d9b 100644
--- a/src/gallium/winsys/sw/wrapper/wrapper_sw_winsys.c
+++ b/src/gallium/winsys/sw/wrapper/wrapper_sw_winsys.c
@@ -299,7 +299,7 @@ wrapper_sw_winsys_wrap_pipe_screen(struct pipe_screen *screen)
wsw->base.destroy = wsw_destroy;
wsw->screen = screen;
- wsw->pipe = screen->context_create(screen, NULL);
+ wsw->pipe = screen->context_create(screen, NULL, 0);
if (!wsw->pipe)
goto err_free;
diff --git a/src/mesa/state_tracker/st_manager.c b/src/mesa/state_tracker/st_manager.c
index 2e2c8ffaed9..7abd128e719 100644
--- a/src/mesa/state_tracker/st_manager.c
+++ b/src/mesa/state_tracker/st_manager.c
@@ -657,7 +657,7 @@ st_api_create_context(struct st_api *stapi, struct st_manager *smapi,
break;
}
- pipe = smapi->screen->context_create(smapi->screen, NULL);
+ pipe = smapi->screen->context_create(smapi->screen, NULL, 0);
if (!pipe) {
*error = ST_CONTEXT_ERROR_NO_MEMORY;
return NULL;