From 7637f547ca34668ef9d4f0c417de16e7126927b5 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Wed, 24 Sep 2014 15:43:53 +0100 Subject: sna: Tweak partial Picture extraction to prefer limiting to max 3D coordinates Where possible, keep the offset of the partial Picture within the 3D coordinate limit so that we can use the DrawRectangle offset to automatically adjust the coordinates. Signed-off-by: Chris Wilson --- src/sna/sna_render.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/sna/sna_render.c') diff --git a/src/sna/sna_render.c b/src/sna/sna_render.c index 71330c1f..af072f02 100644 --- a/src/sna/sna_render.c +++ b/src/sna/sna_render.c @@ -1977,6 +1977,14 @@ sna_render_composite_redirect(struct sna *sna, box.x1 = box.x1 & ~(tile_width * 8 / op->dst.pixmap->drawable.bitsPerPixel - 1); box.x2 = ALIGN(box.x2, tile_width * 8 / op->dst.pixmap->drawable.bitsPerPixel); + if (box.x1 > sna->render.max_3d_size && + box.x2 <= 2*sna->render.max_3d_size) + box.x1 = sna->render.max_3d_size; + + if (box.y1 > sna->render.max_3d_size && + box.y2 <= 2*sna->render.max_3d_size) + box.y1 = sna->render.max_3d_size; + offset = box.x1 * op->dst.pixmap->drawable.bitsPerPixel / 8 / tile_width * tile_size; } else { if (sna->kgem.gen < 040) { @@ -1993,6 +2001,14 @@ sna_render_composite_redirect(struct sna *sna, box.x2 = ALIGN(box.x2, 2); } + if (box.x1 > sna->render.max_3d_size && + box.x2 <= 2*sna->render.max_3d_size) + box.x1 = sna->render.max_3d_size; + + if (box.y1 > sna->render.max_3d_size && + box.y2 <= 2*sna->render.max_3d_size) + box.y1 = sna->render.max_3d_size; + offset = box.x1 * op->dst.pixmap->drawable.bitsPerPixel / 8; } -- cgit v1.2.3