sna: Add DBG hints for using inplace CPU mmappings

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2014-06-02 08:25:52 +01:00
parent 487df2e7b1
commit bb49222a51
2 changed files with 19 additions and 6 deletions

View File

@ -683,14 +683,22 @@ static inline bool kgem_bo_can_map__cpu(struct kgem *kgem,
struct kgem_bo *bo,
bool write)
{
DBG(("%s: handle=%d\n", __FUNCTION__, bo->handle));
assert(bo->refcnt);
if (bo->purged || (bo->scanout && write))
if (bo->purged || (bo->scanout && write)) {
DBG(("%s: no, writing to scanout? %d, or is stolen [inaccessible via CPU]? %d\n",
__FUNCTION__, bo->scanout && write, bo->purged));
return false;
}
if (kgem->has_llc)
if (kgem->has_llc) {
DBG(("%s: yes, has LLC and target is in LLC\n", __FUNCTION__));
return true;
}
DBG(("%s: non-LLC - CPU domain? %d, clean? %d\n",
__FUNCTION__, bo->domain == DOMAIN_CPU, !write || bo->exec == NULL));
if (bo->domain != DOMAIN_CPU)
return false;

View File

@ -636,11 +636,16 @@ fallback:
static bool upload_inplace__tiled(struct kgem *kgem, struct kgem_bo *bo)
{
if (!kgem->memcpy_to_tiled_x)
return false;
if (bo->tiling != I915_TILING_X)
DBG(("%s: tiling=%d\n", __FUNCTION__, bo->tiling));
switch (bo->tiling) {
case I915_TILING_Y:
return false;
case I915_TILING_X:
if (!kgem->memcpy_to_tiled_x)
return false;
default:
break;
}
return kgem_bo_can_map__cpu(kgem, bo, true);
}