diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2015-11-08 12:54:09 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2015-11-08 17:15:47 +0000 |
commit | 7fc15ec3975e3a99a6bbb869c07172cdee6e5f63 (patch) | |
tree | cacba7044b019d5ddcdb366fe02db6d642ebeca7 /src/sna/gen3_render.c | |
parent | 694e9bc4e2e9a73ce72b1fb9ef8ecbf773b901fe (diff) |
sna/video: Move the composite offsets into the dstRegion
Move the application of the composite offset from the backends into the
caller so that we correctly apply the offset to the dstRegion prior to
calling move-to-gpu with that set of boxes.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/gen3_render.c')
-rw-r--r-- | src/sna/gen3_render.c | 37 |
1 files changed, 3 insertions, 34 deletions
diff --git a/src/sna/gen3_render.c b/src/sna/gen3_render.c index 3c87b366..322de02a 100644 --- a/src/sna/gen3_render.c +++ b/src/sna/gen3_render.c @@ -5495,17 +5495,7 @@ gen3_render_video(struct sna *sna, pix_yoff = -dstRegion->extents.y1; copy = 1; } else { - /* Set up the offset for translating from the given region - * (in screen coordinates) to the backing pixmap. - */ -#ifdef COMPOSITE - pix_xoff = -pixmap->screen_x + pixmap->drawable.x; - pix_yoff = -pixmap->screen_y + pixmap->drawable.y; -#else - pix_xoff = 0; - pix_yoff = 0; -#endif - + pix_xoff = pix_yoff = 0; dst_width = pixmap->drawable.width; dst_height = pixmap->drawable.height; } @@ -5561,16 +5551,9 @@ gen3_render_video(struct sna *sna, } while (nbox); if (copy) { -#ifdef COMPOSITE - pix_xoff = -pixmap->screen_x + pixmap->drawable.x; - pix_yoff = -pixmap->screen_y + pixmap->drawable.y; -#else - pix_xoff = 0; - pix_yoff = 0; -#endif sna_blt_copy_boxes(sna, GXcopy, dst_bo, -dstRegion->extents.x1, -dstRegion->extents.y1, - priv->gpu_bo, pix_xoff, pix_yoff, + priv->gpu_bo, 0, 0, pixmap->drawable.bitsPerPixel, region_rects(dstRegion), region_num_rects(dstRegion)); @@ -5578,21 +5561,7 @@ gen3_render_video(struct sna *sna, kgem_bo_destroy(&sna->kgem, dst_bo); } - if (!DAMAGE_IS_ALL(priv->gpu_damage)) { - if ((pix_xoff | pix_yoff) == 0) { - sna_damage_add(&priv->gpu_damage, dstRegion); - sna_damage_subtract(&priv->cpu_damage, dstRegion); - } else { - sna_damage_add_boxes(&priv->gpu_damage, - region_rects(dstRegion), - region_num_rects(dstRegion), - pix_xoff, pix_yoff); - sna_damage_subtract_boxes(&priv->cpu_damage, - region_rects(dstRegion), - region_num_rects(dstRegion), - pix_xoff, pix_yoff); - } - } + sna_damage_add(&priv->gpu_damage, dstRegion); return true; } |