diff options
author | Michel Dänzer <[email protected]> | 2014-02-13 11:51:09 +0900 |
---|---|---|
committer | Michel Daenzer <[email protected]> | 2014-02-18 10:46:23 +0900 |
commit | cf0172d46ab940a691da6516057c81f28961482f (patch) | |
tree | ad7d1487d75730537f9d8fdf8a085f076a9e77cb /src/gallium/drivers/radeonsi | |
parent | adad8fb2e947e3ea9e9d84cb3722e46de91346e4 (diff) |
r600g,radeonsi: Consolidate logic for short-circuiting flushes
Fixes radeonsi emitting command streams to the kernel even when there
have been no draw calls before a flush, potentially powering up the GPU
needlessly.
Incidentally, this also cuts the runtime of piglit gpu.py in about half
on my Kaveri system, probably because an X11 client going away no longer
always results in a command stream being submitted to the kernel via
glamor.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=65761
Cc: "10.1" [email protected]
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi')
-rw-r--r-- | src/gallium/drivers/radeonsi/si_hw_context.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gallium/drivers/radeonsi/si_hw_context.c b/src/gallium/drivers/radeonsi/si_hw_context.c index 7e40255a6f2..3437f59d60b 100644 --- a/src/gallium/drivers/radeonsi/si_hw_context.c +++ b/src/gallium/drivers/radeonsi/si_hw_context.c @@ -81,7 +81,7 @@ void si_context_flush(struct si_context *ctx, unsigned flags) { struct radeon_winsys_cs *cs = ctx->b.rings.gfx.cs; - if (!cs->cdw) + if (cs->cdw == ctx->b.initial_gfx_cs_size) return; /* suspend queries */ @@ -177,6 +177,8 @@ void si_begin_new_cs(struct si_context *ctx) } si_all_descriptors_begin_new_cs(ctx); + + ctx->b.initial_gfx_cs_size = ctx->b.rings.gfx.cs->cdw; } #if SI_TRACE_CS |