diff options
author | Marek Olšák <[email protected]> | 2012-01-29 23:35:10 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2012-01-31 23:12:30 +0100 |
commit | bc70bcfc6915883bd5c60712b70e9ed7e1d80ea8 (patch) | |
tree | a42401ab4a3c6f99ecbd497e8654446bfe96582e | |
parent | e4340c1908a6a3b09e1a15d5195f6da7d00494d0 (diff) |
r600g: don't initialize the screen and winsys pointer twice
-rw-r--r-- | src/gallium/drivers/r600/evergreen_hw_context.c | 7 | ||||
-rw-r--r-- | src/gallium/drivers/r600/r600.h | 4 | ||||
-rw-r--r-- | src/gallium/drivers/r600/r600_hw_context.c | 7 | ||||
-rw-r--r-- | src/gallium/drivers/r600/r600_pipe.c | 4 |
4 files changed, 8 insertions, 14 deletions
diff --git a/src/gallium/drivers/r600/evergreen_hw_context.c b/src/gallium/drivers/r600/evergreen_hw_context.c index b95491a4d6e..f8820f9d5bf 100644 --- a/src/gallium/drivers/r600/evergreen_hw_context.c +++ b/src/gallium/drivers/r600/evergreen_hw_context.c @@ -908,13 +908,10 @@ static int evergreen_loop_const_init(struct r600_context *ctx, uint32_t offset) return r600_context_add_block(ctx, r600_loop_consts, nreg, PKT3_SET_LOOP_CONST, EVERGREEN_LOOP_CONST_OFFSET); } -int evergreen_context_init(struct r600_context *ctx, struct r600_screen *screen) +int evergreen_context_init(struct r600_context *ctx) { int r; - ctx->screen = screen; - ctx->ws = screen->ws; - LIST_INITHEAD(&ctx->active_query_list); /* init dirty list */ @@ -998,7 +995,7 @@ int evergreen_context_init(struct r600_context *ctx, struct r600_screen *screen) if (r) goto out_err; - ctx->cs = screen->ws->cs_create(screen->ws); + ctx->cs = ctx->ws->cs_create(ctx->ws); /* allocate cs variables */ ctx->bo = calloc(RADEON_MAX_CMDBUF_DWORDS, sizeof(void *)); diff --git a/src/gallium/drivers/r600/r600.h b/src/gallium/drivers/r600/r600.h index a32c3b1e8db..626ab4dec8a 100644 --- a/src/gallium/drivers/r600/r600.h +++ b/src/gallium/drivers/r600/r600.h @@ -213,7 +213,7 @@ struct r600_context; struct r600_screen; void r600_get_backend_mask(struct r600_context *ctx); -int r600_context_init(struct r600_context *ctx, struct r600_screen *screen); +int r600_context_init(struct r600_context *ctx); void r600_context_fini(struct r600_context *ctx); void r600_context_pipe_state_set(struct r600_context *ctx, struct r600_pipe_state *state); void r600_context_pipe_state_set_ps_resource(struct r600_context *ctx, struct r600_pipe_resource_state *state, unsigned rid); @@ -244,7 +244,7 @@ void r600_context_streamout_begin(struct r600_context *ctx); void r600_context_streamout_end(struct r600_context *ctx); void r600_context_draw_opaque_count(struct r600_context *ctx, struct r600_so_target *t); -int evergreen_context_init(struct r600_context *ctx, struct r600_screen *screen); +int evergreen_context_init(struct r600_context *ctx); void evergreen_context_draw(struct r600_context *ctx, const struct r600_draw *draw); void evergreen_context_flush_dest_caches(struct r600_context *ctx); void evergreen_context_pipe_state_set_ps_resource(struct r600_context *ctx, struct r600_pipe_resource_state *state, unsigned rid); diff --git a/src/gallium/drivers/r600/r600_hw_context.c b/src/gallium/drivers/r600/r600_hw_context.c index b25006d2240..b6375c25f8c 100644 --- a/src/gallium/drivers/r600/r600_hw_context.c +++ b/src/gallium/drivers/r600/r600_hw_context.c @@ -827,13 +827,10 @@ int r600_setup_block_table(struct r600_context *ctx) return 0; } -int r600_context_init(struct r600_context *ctx, struct r600_screen *screen) +int r600_context_init(struct r600_context *ctx) { int r; - ctx->screen = screen; - ctx->ws = screen->ws; - LIST_INITHEAD(&ctx->active_query_list); /* init dirty list */ @@ -909,7 +906,7 @@ int r600_context_init(struct r600_context *ctx, struct r600_screen *screen) if (r) goto out_err; - ctx->cs = screen->ws->cs_create(screen->ws); + ctx->cs = ctx->ws->cs_create(ctx->ws); /* allocate cs variables */ ctx->bo = calloc(RADEON_MAX_CMDBUF_DWORDS, sizeof(void *)); diff --git a/src/gallium/drivers/r600/r600_pipe.c b/src/gallium/drivers/r600/r600_pipe.c index 9f86f4a8a08..d61855d7498 100644 --- a/src/gallium/drivers/r600/r600_pipe.c +++ b/src/gallium/drivers/r600/r600_pipe.c @@ -236,7 +236,7 @@ static struct pipe_context *r600_create_context(struct pipe_screen *screen, void case R600: case R700: r600_init_state_functions(rctx); - if (r600_context_init(rctx, rctx->screen)) { + if (r600_context_init(rctx)) { r600_destroy_context(&rctx->context); return NULL; } @@ -246,7 +246,7 @@ static struct pipe_context *r600_create_context(struct pipe_screen *screen, void case EVERGREEN: case CAYMAN: evergreen_init_state_functions(rctx); - if (evergreen_context_init(rctx, rctx->screen)) { + if (evergreen_context_init(rctx)) { r600_destroy_context(&rctx->context); return NULL; } |