sna: Avoid stalling on a SHM upload when otherwise idle

Fixes regresion from

commit 09ea1f4402
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Jan 10 16:26:24 2013 +0000

    sna: Prefer to use the GPU for copies from SHM onto tiled destinations

As the stalls on IVB 64-bit machines at least greatly offset the
benefits. As those earlier measurements were made on the same IVB
machine but running in 32-bit mode, I need to double-check whether or
not this is another 32-bit peculiarity.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2013-02-13 17:15:46 +00:00
parent 4bf51ec7bc
commit f2a64dbdfc
2 changed files with 6 additions and 8 deletions

View File

@ -4737,7 +4737,9 @@ void kgem_bo_sync__cpu(struct kgem *kgem, struct kgem_bo *bo)
void kgem_bo_sync__cpu_full(struct kgem *kgem, struct kgem_bo *bo, bool write)
{
assert(bo->proxy == NULL);
kgem_bo_submit(kgem, bo);
if (write || bo->needs_flush)
kgem_bo_submit(kgem, bo);
if (bo->domain != DOMAIN_CPU) {
struct drm_i915_gem_set_domain set_domain;

View File

@ -4138,17 +4138,14 @@ static bool use_shm_bo(struct sna *sna,
DBG(("%s: yes, complex alu=%d\n", __FUNCTION__, alu));
return true;
}
if (bo->tiling) {
DBG(("%s:, yes, dst tiled=%d\n", __FUNCTION__, bo->tiling));
return true;
}
if (__kgem_bo_is_busy(&sna->kgem, bo)) {
DBG(("%s: yes, dst is busy\n", __FUNCTION__));
return true;
}
if (__kgem_bo_is_busy(&sna->kgem, priv->cpu_bo)) {
if (priv->cpu_bo->needs_flush &&
__kgem_bo_is_busy(&sna->kgem, priv->cpu_bo)) {
DBG(("%s: yes, src is busy\n", __FUNCTION__));
return true;
}
@ -4378,8 +4375,7 @@ sna_copy_boxes(DrawablePtr src, DrawablePtr dst, GCPtr gc,
src_priv == NULL &&
sna->kgem.has_userptr &&
box_inplace(src_pixmap, &region->extents) &&
((sna->kgem.has_llc && bo->tiling && !bo->scanout) ||
__kgem_bo_is_busy(&sna->kgem, bo))) {
__kgem_bo_is_busy(&sna->kgem, bo)) {
struct kgem_bo *src_bo;
bool ok = false;