summaryrefslogtreecommitdiff
path: root/src/sna/gen6_render.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-01-02 13:47:51 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2013-01-02 16:16:10 +0000
commitbc67bdcec832f4302951f2789456666dee2f496c (patch)
treeed2a6afbb9f85f64118c1bbc85068c211b2a47fc /src/sna/gen6_render.c
parent2559cfcc4cbc1d0d84b048565cad3bfee61df8da (diff)
sna/gen6+: Fine tune placement of DRI copies
Avoid offsetting the overhead of the render copy only to be penalised by the overhead of the semaphore. So compromise. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/gen6_render.c')
-rw-r--r--src/sna/gen6_render.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/src/sna/gen6_render.c b/src/sna/gen6_render.c
index 77bd8536..a4b5746f 100644
--- a/src/sna/gen6_render.c
+++ b/src/sna/gen6_render.c
@@ -1772,7 +1772,8 @@ gen6_composite_set_target(struct sna *sna,
}
inline static bool can_switch_to_blt(struct sna *sna,
- struct kgem_bo *bo)
+ struct kgem_bo *bo,
+ unsigned flags)
{
if (sna->kgem.ring != KGEM_RENDER)
return true;
@@ -1783,6 +1784,9 @@ inline static bool can_switch_to_blt(struct sna *sna,
if (!sna->kgem.has_semaphores)
return false;
+ if (flags & COPY_LAST)
+ return true;
+
if (bo && RQ_IS_BLT(bo->rq))
return true;
@@ -1803,9 +1807,10 @@ static int prefer_blt_bo(struct sna *sna, struct kgem_bo *bo)
}
inline static bool prefer_blt_ring(struct sna *sna,
- struct kgem_bo *bo)
+ struct kgem_bo *bo,
+ unsigned flags)
{
- return can_switch_to_blt(sna, bo);
+ return can_switch_to_blt(sna, bo, flags);
}
static bool
@@ -1824,7 +1829,7 @@ try_blt(struct sna *sna,
return true;
}
- if (sna_picture_is_solid(src, NULL) && can_switch_to_blt(sna, NULL))
+ if (sna_picture_is_solid(src, NULL) && can_switch_to_blt(sna, NULL, 0))
return true;
return false;
@@ -2045,7 +2050,7 @@ prefer_blt_composite(struct sna *sna, struct sna_composite_op *tmp)
untiled_tlb_miss(tmp->src.bo))
return true;
- if (!prefer_blt_ring(sna, tmp->dst.bo))
+ if (!prefer_blt_ring(sna, tmp->dst.bo, 0))
return false;
return (prefer_blt_bo(sna, tmp->dst.bo) | prefer_blt_bo(sna, tmp->src.bo)) > 0;
@@ -2454,17 +2459,14 @@ static inline bool prefer_blt_copy(struct sna *sna,
if (sna->kgem.ring == KGEM_BLT)
return true;
- if (src_bo == dst_bo && can_switch_to_blt(sna, dst_bo))
- return true;
-
- if ((flags & COPY_LAST && sna->kgem.ring != KGEM_RENDER))
+ if (src_bo == dst_bo && can_switch_to_blt(sna, dst_bo, flags))
return true;
if (untiled_tlb_miss(src_bo) ||
untiled_tlb_miss(dst_bo))
return true;
- if (!prefer_blt_ring(sna, dst_bo))
+ if (!prefer_blt_ring(sna, dst_bo, flags))
return false;
return (prefer_blt_bo(sna, src_bo) >= 0 &&
@@ -2549,7 +2551,7 @@ fallback_blt:
if (too_large(extents.x2-extents.x1, extents.y2-extents.y1))
goto fallback_blt;
- if ((flags & COPY_LAST || can_switch_to_blt(sna, dst_bo)) &&
+ if (can_switch_to_blt(sna, dst_bo, flags) &&
sna_blt_compare_depth(&src->drawable, &dst->drawable) &&
sna_blt_copy_boxes(sna, alu,
src_bo, src_dx, src_dy,
@@ -2877,7 +2879,7 @@ static inline bool prefer_blt_fill(struct sna *sna,
if (untiled_tlb_miss(bo))
return true;
- return prefer_blt_ring(sna, bo) || prefer_blt_bo(sna, bo) >= 0;
+ return prefer_blt_ring(sna, bo, 0) || prefer_blt_bo(sna, bo) >= 0;
}
static bool