diff options
author | Rob Clark <[email protected]> | 2013-03-06 10:45:58 -0500 |
---|---|---|
committer | Rob Clark <[email protected]> | 2013-03-25 13:05:44 -0400 |
commit | 732b0b5ebc5a30b6e87f67aabfb0e25d3e662d41 (patch) | |
tree | 9990fab014019ba0108fea776cd14aeab3aac8d7 /src/gallium/drivers/freedreno/freedreno_context.h | |
parent | 8a4750fe5e3fb5368edecbc7a0f835aada32d49e (diff) |
freedreno: track maximal scissor bounds
Optimize out parts of the render target that are scissored out by taking
into account maximal scissor bounds in fd_gmem_render_tiles().
This is a big win on things like gnome-shell which frequently do partial
screen updates.
Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/freedreno_context.h')
-rw-r--r-- | src/gallium/drivers/freedreno/freedreno_context.h | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_context.h b/src/gallium/drivers/freedreno/freedreno_context.h index 6fff8f611b4..4ed31593d41 100644 --- a/src/gallium/drivers/freedreno/freedreno_context.h +++ b/src/gallium/drivers/freedreno/freedreno_context.h @@ -79,11 +79,13 @@ struct fd_vertexbuf_stateobj { uint32_t dirty_mask; }; -struct fd_framebuffer_stateobj { - struct pipe_framebuffer_state base; +struct fd_gmem_stateobj { + struct pipe_scissor_state scissor; + uint cpp; + uint16_t minx, miny; uint16_t bin_h, nbins_y; uint16_t bin_w, nbins_x; - uint32_t pa_su_sc_mode_cntl; + uint16_t width, height; }; struct fd_context { @@ -129,6 +131,17 @@ struct fd_context { */ struct pipe_scissor_state scissor; + /* Track the maximal bounds of the scissor of all the draws within a + * batch. Used at the tile rendering step (fd_gmem_render_tiles(), + * mem2gmem/gmem2mem) to avoid needlessly moving data in/out of gmem. + */ + struct pipe_scissor_state max_scissor; + + /* Current gmem/tiling configuration.. gets updated on render_tiles() + * if out of date with current maximal-scissor/cpp: + */ + struct fd_gmem_stateobj gmem; + /* which state objects need to be re-emit'd: */ enum { FD_DIRTY_BLEND = (1 << 0), @@ -163,7 +176,7 @@ struct fd_context { struct pipe_blend_color blend_color; struct pipe_stencil_ref stencil_ref; unsigned sample_mask; - struct fd_framebuffer_stateobj framebuffer; + struct pipe_framebuffer_state framebuffer; struct pipe_poly_stipple stipple; struct pipe_viewport_state viewport; struct fd_constbuf_stateobj constbuf[PIPE_SHADER_TYPES]; |