diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-01-10 01:42:37 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-01-10 17:08:15 +0000 |
commit | 87f73b043426c47efa7670fb65bdcc7dfcf71fc3 (patch) | |
tree | 77cc6003904baed1a5d94d84078b465968be4433 /src/sna/gen2_render.c | |
parent | 2ccb31c5a4120efb940168c5e52154add01b0586 (diff) |
sna/gen[23]: Tile render fill to oversized bo
If we are forced to perform a render operation to a bo too large to fit
in the pipeline, copy to an intermediate and split the operation into
tiles rather than fallback.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/gen2_render.c')
-rw-r--r-- | src/sna/gen2_render.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/src/sna/gen2_render.c b/src/sna/gen2_render.c index 8f6a1647..30dd6941 100644 --- a/src/sna/gen2_render.c +++ b/src/sna/gen2_render.c @@ -112,7 +112,7 @@ static const struct formatinfo { static inline bool too_large(int width, int height) { - return (width | height) > MAX_3D_SIZE; + return width > MAX_3D_SIZE || height > MAX_3D_SIZE; } static inline uint32_t @@ -2365,10 +2365,21 @@ gen2_render_fill_boxes(struct sna *sna, if (too_large(dst->drawable.width, dst->drawable.height) || dst_bo->pitch < 8 || dst_bo->pitch > 8192 || - !gen2_check_dst_format(format)) - return gen2_render_fill_boxes_try_blt(sna, op, format, color, - dst, dst_bo, - box, n); + !gen2_check_dst_format(format)) { + DBG(("%s: try blt, too large or incompatible destination\n", + __FUNCTION__)); + if (gen2_render_fill_boxes_try_blt(sna, op, format, color, + dst, dst_bo, + box, n)) + return TRUE; + + if (!gen2_check_dst_format(format)) + return FALSE; + + assert(dst_bo->pitch >= 8); + return sna_tiling_fill_boxes(sna, op, format, color, + dst, dst_bo, box, n); + } if (prefer_blt_fill(sna) && gen2_render_fill_boxes_try_blt(sna, op, format, color, |