From: Marek Olšák Date: Sun, 29 Jan 2012 22:35:10 +0000 (+0100) Subject: r600g: don't initialize the screen and winsys pointer twice X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bc70bcfc6915883bd5c60712b70e9ed7e1d80ea8;p=mesa.git r600g: don't initialize the screen and winsys pointer twice --- 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; }