From 598dae9af99495cb738c6ddbe8602f8fa19dc0df Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Wed, 25 Sep 2013 10:53:11 +0100 Subject: [PATCH] sna/gen[35]: Remove dead code for choosing between BLT/render composite For these gen, we always want to use BLT where possible - even if it incurs a context switch. Signed-off-by: Chris Wilson --- src/sna/gen3_render.c | 47 ------------------------------------------- src/sna/gen5_render.c | 28 -------------------------- 2 files changed, 75 deletions(-) diff --git a/src/sna/gen3_render.c b/src/sna/gen3_render.c index cb8f046d..4c058e1a 100644 --- a/src/sna/gen3_render.c +++ b/src/sna/gen3_render.c @@ -3119,52 +3119,6 @@ gen3_composite_picture(struct sna *sna, x, y, w, h, dst_x, dst_y); } -static inline bool -source_use_blt(struct sna *sna, PicturePtr picture) -{ - /* If it is a solid, try to use the BLT paths */ - if (!picture->pDrawable) - return picture->pSourcePict->type == SourcePictTypeSolidFill; - - if (picture->pDrawable->width == 1 && - picture->pDrawable->height == 1 && - picture->repeat) - return true; - - if (too_large(picture->pDrawable->width, picture->pDrawable->height)) - return true; - - return !is_gpu(sna, picture->pDrawable, PREFER_GPU_RENDER); -} - -static bool -try_blt(struct sna *sna, - PicturePtr dst, - PicturePtr src, - int width, int height) -{ - if (sna->kgem.mode != KGEM_RENDER) { - DBG(("%s: already performing BLT\n", __FUNCTION__)); - return true; - } - - if (too_large(width, height)) { - DBG(("%s: operation too large for 3D pipe (%d, %d)\n", - __FUNCTION__, width, height)); - return true; - } - - if (too_large(dst->pDrawable->width, dst->pDrawable->height)) { - DBG(("%s: target too large for 3D pipe (%d, %d)\n", - __FUNCTION__, - dst->pDrawable->width, dst->pDrawable->height)); - return true; - } - - /* is the source picture only in cpu memory e.g. a shm pixmap? */ - return source_use_blt(sna, src); -} - static void gen3_align_vertex(struct sna *sna, const struct sna_composite_op *op) @@ -3530,7 +3484,6 @@ gen3_render_composite(struct sna *sna, * 3D -> 2D context switch. */ if (mask == NULL && - try_blt(sna, dst, src, width, height) && sna_blt_composite(sna, op, src, dst, src_x, src_y, diff --git a/src/sna/gen5_render.c b/src/sna/gen5_render.c index 7e336f0b..c625639b 100644 --- a/src/sna/gen5_render.c +++ b/src/sna/gen5_render.c @@ -1610,33 +1610,6 @@ gen5_composite_set_target(struct sna *sna, return true; } -static bool -try_blt(struct sna *sna, - PicturePtr dst, PicturePtr src, - int width, int height) -{ - if (sna->kgem.mode != KGEM_RENDER) { - DBG(("%s: already performing BLT\n", __FUNCTION__)); - return true; - } - - if (too_large(width, height)) { - DBG(("%s: operation too large for 3D pipe (%d, %d)\n", - __FUNCTION__, width, height)); - return true; - } - - if (too_large(dst->pDrawable->width, dst->pDrawable->height)) - return true; - - /* The blitter is much faster for solids */ - if (sna_picture_is_solid(src, NULL)) - return true; - - /* is the source picture only in cpu memory e.g. a shm pixmap? */ - return picture_is_cpu(sna, src); -} - static bool is_gradient(PicturePtr picture, bool precise) { @@ -1868,7 +1841,6 @@ gen5_render_composite(struct sna *sna, } if (mask == NULL && - try_blt(sna, dst, src, width, height) && sna_blt_composite(sna, op, src, dst, src_x, src_y,