summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r600/r600_pipe.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2012-02-21 18:08:32 +0100
committerMarek Olšák <[email protected]>2012-02-23 20:29:55 +0100
commit9670e72f6ef85f0e6f6c9afe136dc67c017e3fae (patch)
treefdca21669641276cb34e0e28ae087cc4871836cc /src/gallium/drivers/r600/r600_pipe.c
parentf841b8a833f32074c79724c66c85cdc7b48087e2 (diff)
r600g: consolidate common context init code
Reviewed-by: Jerome Glisse <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
Diffstat (limited to 'src/gallium/drivers/r600/r600_pipe.c')
-rw-r--r--src/gallium/drivers/r600/r600_pipe.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/gallium/drivers/r600/r600_pipe.c b/src/gallium/drivers/r600/r600_pipe.c
index 3d35ed289ce..e7ba97110ef 100644
--- a/src/gallium/drivers/r600/r600_pipe.c
+++ b/src/gallium/drivers/r600/r600_pipe.c
@@ -208,6 +208,10 @@ static void r600_destroy_context(struct pipe_context *context)
r600_update_num_contexts(rctx->screen, -1);
r600_release_command_buffer(&rctx->atom_start_cs);
+
+ rctx->ws->cs_destroy(rctx->cs);
+
+ FREE(rctx->range);
FREE(rctx);
}
@@ -233,6 +237,16 @@ static struct pipe_context *r600_create_context(struct pipe_screen *screen, void
rctx->chip_class = rscreen->chip_class;
LIST_INITHEAD(&rctx->dirty_states);
+ LIST_INITHEAD(&rctx->active_query_list);
+ LIST_INITHEAD(&rctx->dirty);
+ LIST_INITHEAD(&rctx->resource_dirty);
+ LIST_INITHEAD(&rctx->enable_list);
+
+ rctx->range = CALLOC(NUM_RANGES, sizeof(struct r600_range));
+ if (!rctx->range) {
+ FREE(rctx);
+ return NULL;
+ }
r600_init_blit_functions(rctx);
r600_init_query_functions(rctx);
@@ -272,7 +286,9 @@ static struct pipe_context *r600_create_context(struct pipe_screen *screen, void
return NULL;
}
+ rctx->cs = rctx->ws->cs_create(rctx->ws);
rctx->ws->cs_set_flush_callback(rctx->cs, r600_flush_from_winsys, rctx);
+ r600_emit_atom(rctx, &rctx->atom_start_cs.atom);
util_slab_create(&rctx->pool_transfers,
sizeof(struct pipe_transfer), 64,