From fe790a3c346b5edb8b64cfc937b0d5cd9e337412 Mon Sep 17 00:00:00 2001 From: Jerome Glisse Date: Tue, 28 Sep 2010 14:21:35 -0400 Subject: [PATCH] r600g: suspend/resume occlusion query around clear/copy Signed-off-by: Jerome Glisse --- src/gallium/drivers/r600/r600.h | 2 ++ src/gallium/drivers/r600/r600_state2.c | 8 ++++++++ src/gallium/winsys/r600/drm/r600_state2.c | 7 ++----- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/gallium/drivers/r600/r600.h b/src/gallium/drivers/r600/r600.h index b8c74675e60..adc35afc025 100644 --- a/src/gallium/drivers/r600/r600.h +++ b/src/gallium/drivers/r600/r600.h @@ -278,6 +278,8 @@ boolean r600_context_query_result(struct r600_context *ctx, boolean wait, void *vresult); void r600_query_begin(struct r600_context *ctx, struct r600_query *query); void r600_query_end(struct r600_context *ctx, struct r600_query *query); +void r600_context_queries_suspend(struct r600_context *ctx); +void r600_context_queries_resume(struct r600_context *ctx); int evergreen_context_init(struct r600_context *ctx, struct radeon *radeon); void evergreen_context_draw(struct r600_context *ctx, const struct r600_draw *draw); diff --git a/src/gallium/drivers/r600/r600_state2.c b/src/gallium/drivers/r600/r600_state2.c index 153780594e5..72d04534e62 100644 --- a/src/gallium/drivers/r600/r600_state2.c +++ b/src/gallium/drivers/r600/r600_state2.c @@ -757,6 +757,7 @@ int r600_blit_uncompress_depth2(struct pipe_context *ctx, struct r600_resource_t int level = 0; float depth = 1.0f; + r600_context_queries_suspend(&rctx->ctx); for (int i = 0; i < fb.nr_cbufs; i++) { fb.cbufs[i] = NULL; pipe_surface_reference(&fb.cbufs[i], rctx->pframebuffer->cbufs[i]); @@ -785,6 +786,7 @@ int r600_blit_uncompress_depth2(struct pipe_context *ctx, struct r600_resource_t pipe_surface_reference(&fb.cbufs[i], NULL); } pipe_surface_reference(&fb.zsbuf, NULL); + r600_context_queries_resume(&rctx->ctx); return 0; } @@ -795,10 +797,12 @@ static void r600_clear(struct pipe_context *ctx, unsigned buffers, struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx; struct pipe_framebuffer_state *fb = &rctx->framebuffer; + r600_context_queries_suspend(&rctx->ctx); r600_blitter_save_states(ctx); util_blitter_clear(rctx->blitter, fb->width, fb->height, fb->nr_cbufs, buffers, rgba, depth, stencil); + r600_context_queries_resume(&rctx->ctx); } static void r600_clear_render_target(struct pipe_context *ctx, @@ -810,9 +814,11 @@ static void r600_clear_render_target(struct pipe_context *ctx, struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx; struct pipe_framebuffer_state *fb = &rctx->framebuffer; + r600_context_queries_suspend(&rctx->ctx); util_blitter_save_framebuffer(rctx->blitter, fb); util_blitter_clear_render_target(rctx->blitter, dst, rgba, dstx, dsty, width, height); + r600_context_queries_resume(&rctx->ctx); } static void r600_clear_depth_stencil(struct pipe_context *ctx, @@ -826,9 +832,11 @@ static void r600_clear_depth_stencil(struct pipe_context *ctx, struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx; struct pipe_framebuffer_state *fb = &rctx->framebuffer; + r600_context_queries_suspend(&rctx->ctx); util_blitter_save_framebuffer(rctx->blitter, fb); util_blitter_clear_depth_stencil(rctx->blitter, dst, clear_flags, depth, stencil, dstx, dsty, width, height); + r600_context_queries_resume(&rctx->ctx); } diff --git a/src/gallium/winsys/r600/drm/r600_state2.c b/src/gallium/winsys/r600/drm/r600_state2.c index 97aecc7a42c..779138656a6 100644 --- a/src/gallium/winsys/r600/drm/r600_state2.c +++ b/src/gallium/winsys/r600/drm/r600_state2.c @@ -61,9 +61,6 @@ void radeon_bo_reference(struct radeon *radeon, unsigned radeon_ws_bo_get_handle(struct radeon_ws_bo *pb_bo); -/* queries */ -static void r600_context_queries_suspend(struct r600_context *ctx); -static void r600_context_queries_resume(struct r600_context *ctx); static int r600_group_id_register_offset(struct r600_context *ctx, unsigned offset) { @@ -1292,7 +1289,7 @@ boolean r600_context_query_result(struct r600_context *ctx, return TRUE; } -static void r600_context_queries_suspend(struct r600_context *ctx) +void r600_context_queries_suspend(struct r600_context *ctx) { struct r600_query *query; @@ -1304,7 +1301,7 @@ static void r600_context_queries_suspend(struct r600_context *ctx) } } -static void r600_context_queries_resume(struct r600_context *ctx) +void r600_context_queries_resume(struct r600_context *ctx) { struct r600_query *query; -- 2.30.2