diff options
author | Marek Olšák <[email protected]> | 2015-07-25 18:40:59 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2015-08-26 19:25:18 +0200 |
commit | 0fc21ecfc0891d239f20bf7724e51bc75503570c (patch) | |
tree | 19ffd27a9700601cae150dd229518637e369eb98 /src/gallium/drivers | |
parent | 7b5c92391f15533ec02327d617c4e8639a2f8bb4 (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]>
Diffstat (limited to 'src/gallium/drivers')
30 files changed, 45 insertions, 37 deletions
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); |